Skip to content

Commit

Permalink
Fixed read from joblib 3
Browse files Browse the repository at this point in the history
  • Loading branch information
ckunki committed Oct 8, 2024
1 parent a713942 commit b2278a9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ def create_bucketfs_location_from_conn_object(bfs_conn_obj) -> bfs.path.PathLike
def upload_via_joblib(location: bfs.path.PathLike, object: Any):
buffer = BytesIO()
joblib.dump(object, buffer)
location.write(buffer)
location.write(buffer.getvalue())


def read_via_joblib(location: bfs.path.PathLike) -> Any:
buffer = BytesIO()
for chunk in location.read():
buffer.write(chunk)
return joblib.load(buffer.getvalue())
return joblib.load(buffer)


@dataclasses.dataclass
Expand Down

0 comments on commit b2278a9

Please sign in to comment.