Commit fd6102da authored by Marius Kriegerowski's avatar Marius Kriegerowski
Browse files

rebase and adapt to new celery implementation

parent 01df5344
Pipeline #38935 failed with stage
in 2 minutes and 49 seconds
......@@ -106,6 +106,7 @@ class RulesOneUniqueSubGroup:
), base=Rule)
class GetBuildingOccupancy(Rule):
"""A rule to map OSM tags to building occupancies."""
......@@ -123,16 +124,15 @@ class GetBuildingOccupancy(Rule):
async def evaluate(self, payload: dict) -> GEMTag:
building_id = payload["building_id"]
def evaluate(self, building_id: int) -> GEMTag | None:
logger.debug("Processing building: %s", building_id)
tags = await
tags =
f"SELECT tags FROM osm_building_relations WHERE osm_id={building_id} AND index=0"
logger.debug(f"working on tags: {tags}")
if not tags:
# Mapping to GEM taxonomy strings
occupancies = []
......@@ -147,7 +147,3 @@ class GetBuildingOccupancy(Rule):
logger.debug("occupancies %s: %s", building_id, occupancy)
return occupancy
async def apply_mappings(self, tags):
for rule in self.candidates:
......@@ -37,7 +37,7 @@ class GetBuilding(Rule):
"""A rule to copy a building entry from a source database to a destination database.""", base=Rule)
def evaluate(self, building_id):
def evaluate(self, building_id: int):"called building task")
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment