diff --git a/hub/persistence/repositories/city_object.py b/hub/persistence/repositories/city_object.py index 5c805d15..3fd5c62c 100644 --- a/hub/persistence/repositories/city_object.py +++ b/hub/persistence/repositories/city_object.py @@ -142,12 +142,12 @@ class CityObject(Repository): try: # search by name first with Session(self.engine) as session: - city_object = session.execute(select(Model).where(Model.name == name, Model.city_id in city_ids)).first() + city_object = session.execute(select(Model).where(Model.name == name, Model.city_id.in_(tuple(city_ids)))).first() if city_object is not None: return city_object[0] # name not found, so search by alias instead city_objects = session.execute( - select(Model).where(Model.aliases.contains(name), Model.city_id in city_ids) + select(Model).where(Model.aliases.contains(name), Model.city_id.in_(tuple(city_ids))) ).all() for city_object in city_objects: aliases = city_object[0].aliases.replace('{', '').replace('}', '').split(',')