Skip to content

Commit

Permalink
remove testing code
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeGoodall committed Jan 25, 2024
1 parent 3653c31 commit 69b016f
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions application/data_access/digital_land_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,28 +45,6 @@ def get_dataset_query(session: Session, dataset) -> DatasetModel:

def get_datasets_with_data_by_typology(
session: Session, typology
) -> List[DatasetModel]:
# return get_datasets_with_data_by_typology_old(session, typology)
return get_datasets_with_data_by_typology_new(session, typology)


def get_datasets_with_data_by_typology_old(
session: Session, typology
) -> List[DatasetModel]:
from sqlalchemy import func

query = session.query(
DatasetOrm,
func.count(func.distinct(EntityOrm.entity).label(("entity_count"))),
)
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]


def get_datasets_with_data_by_typology_new(
session: Session, typology
) -> List[DatasetModel]:
query = session.query(DatasetOrm).join(
EntityOrm, DatasetOrm.dataset == EntityOrm.dataset
Expand Down

0 comments on commit 69b016f

Please sign in to comment.