Skip to content

Commit

Permalink
fix: solve an issue when loaddata_func is not pickle-able
Browse files Browse the repository at this point in the history
  • Loading branch information
newgene committed May 26, 2023
1 parent eaece62 commit 737a9ec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions biothings/utils/workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ def upload_worker(name, storage_class, loaddata_func, col_name, batch_size, batc
{
"exc": e,
"params": {"name": name, "storage_class": storage_class},
"loaddata_func": loaddata_func,
"loaddata_func": repr(loaddata_func), # loaddata_func may not be pickle-able
"col_name": col_name,
"batch_size": batch_size,
"args": args,
},
open(pickfile, "wb"),
)
except TypeError as ie:
logger.warning("Could not pickle batch errors: %s" % ie)
except (TypeError, pickle.PicklingError) as ie:
logger.warning("Could not pickle batch errors: %s", ie)
raise e

0 comments on commit 737a9ec

Please sign in to comment.