diff --git a/hub/persistence/repositories/city.py b/hub/persistence/repositories/city.py index 17e018a6..65851bd5 100644 --- a/hub/persistence/repositories/city.py +++ b/hub/persistence/repositories/city.py @@ -136,3 +136,7 @@ class City(Repository): except SQLAlchemyError as err: logging.error('Error while fetching city by name %s', err) raise SQLAlchemyError from err + + def get_by_id(self, city_id) -> Model: + with Session(self.engine) as session: + return session.execute(select(Model).where(Model.id == city_id)).first()[0] \ No newline at end of file