checkpoint(data-ingestion): Add method to mongo service to fetch companies with yearly results

This commit is contained in:
TrisNol 2023-08-29 18:50:33 +02:00
parent 7a2bc5db2b
commit b970416641

View File

@ -71,6 +71,15 @@ class CompanyMongoService:
self.collection.find({"$or": [{"yearly_results": {"$exists": False}}]}) self.collection.find({"$or": [{"yearly_results": {"$exists": False}}]})
) )
def get_where_yearly_results(self) -> list[dict]:
"""Get a list of all companies with valid yearly_results (interesting entries for data loader).
Returns:
list[dict]: List of companies
"""
with self.lock:
return list(self.collection.find({"yearly_results": {"$gt": {}}}))
def insert(self, company: Company) -> InsertOneResult: def insert(self, company: Company) -> InsertOneResult:
"""_summary_. """_summary_.