diff --git a/application/data_access/digital_land_queries.py b/application/data_access/digital_land_queries.py index 4c351b74..9d7cfce0 100644 --- a/application/data_access/digital_land_queries.py +++ b/application/data_access/digital_land_queries.py @@ -51,9 +51,7 @@ def get_datasets_with_data_by_typology( DatasetOrm, func.count(func.distinct(EntityOrm.entity).label(("entity_count"))), ) - query = query.filter( - DatasetOrm.typology == typology, DatasetOrm.dataset == EntityOrm.dataset - ) + query = query.filter(DatasetOrm.typology == typology) query = query.group_by(DatasetOrm.dataset) datasets = query.all() return [DatasetModel.from_orm(ds.DatasetOrm) for ds in datasets] diff --git a/application/factory.py b/application/factory.py index 3e936e52..bf310ea6 100644 --- a/application/factory.py +++ b/application/factory.py @@ -100,7 +100,6 @@ def home(request: Request): @app.get("/health", response_class=JSONResponse, include_in_schema=False) def health(session: Session = Depends(get_session)): - from sqlalchemy.sql import select try: