diff --git a/hub/persistence/repositories/city_object.py b/hub/persistence/repositories/city_object.py index bd90af11..fc9a9929 100644 --- a/hub/persistence/repositories/city_object.py +++ b/hub/persistence/repositories/city_object.py @@ -152,8 +152,14 @@ class CityObject(Repository): buildings = session.execute(select(Model).where( Model.city_id.in_(ids), Model.name.in_(names) )) + if len(buildings) == 0: + # search by aliases instead + buildings = session.execute(select(Model).where( + Model.city_id.in_(ids), Model.name.in_(names) + )) results = [r[0] for r in buildings] - print(ids, buildings) + + print(ids, [r.name for r in results]) return None def get_by_name_or_alias_and_city(self, name, city_id) -> Union[Model, None]: