Skip to content

Commit

Permalink
Catch some other exceptions possible when unpickling
Browse files Browse the repository at this point in the history
Where the query object in cache was actually pickleable when created but can't be unpickled here
  • Loading branch information
greenape committed Nov 26, 2021
1 parent 2376f2b commit 5f7402a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flowmachine/flowmachine/core/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ def column_names(self):

try:
return get_query_object_by_id(connection, query_id)
except EOFError:
logger.debug("Can't unpickle, creating stub.", query_id=query_id)
except (EOFError, ModuleNotFoundError, AttributeError) as exc:
logger.debug("Can't unpickle, creating stub.", query_id=query_id, exception=exc)
qry = f"SELECT depends_on FROM cache.dependencies WHERE query_id='{query_id}'"
return QStub(
deps=[get_obj_or_stub(connection, res[0]) for res in connection.fetch(qry)],
Expand Down

0 comments on commit 5f7402a

Please sign in to comment.