Skip to content

Commit

Permalink
Prevent error on postgresql_id attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Dec 20, 2024
1 parent 7f24e2c commit 4ae5178
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tilecloud_chain/store/postgresql.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,20 @@ def delete_one(self, tile: Tile) -> Tile:
with self.SessionMaker() as session:
if tile.error:
if isinstance(tile.error, Exception):
_LOGGER.warning("Error while processing the tile %s", tile, exc_info=tile.error)
_LOGGER.warning(
"Error while processing the tile %s %s",
tile.tilecoord,
tile.formated_metadata,
exc_info=tile.error,
)

if not hasattr(tile, "postgresql_id"):
_LOGGER.error(
"The tile %s %s does not have the postgresql_id attribute",
tile.tilecoord,
tile.formated_metadata,
)
return tile
sqlalchemy_tile = (
session.query(Queue)
.where(and_(Queue.status == _STATUS_PENDING, Queue.id == tile.postgresql_id)) # type: ignore[attr-defined]
Expand Down

0 comments on commit 4ae5178

Please sign in to comment.