mirror of
https://github.com/fhswf/aki_prj23_transparenzregister.git
synced 2025-04-24 13:52:33 +02:00
checkpoint(data-ingestion): Add method to mongo service to fetch companies with yearly results
This commit is contained in:
parent
7a2bc5db2b
commit
b970416641
@ -71,6 +71,15 @@ class CompanyMongoService:
|
||||
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:
|
||||
"""_summary_.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user