Skip to content

Commit

Permalink
[INTERNAL] Upgrade smart_open version
Browse files Browse the repository at this point in the history
GitOrigin-RevId: e5817b2ec2b9c2084f0c5d253173b66189d0a21a
  • Loading branch information
Jeesh96 committed Dec 9, 2024
1 parent a6aff71 commit 4216cd7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ python_dateutil>=2.8.0
pyyaml==6.0.1
requests>=2.25,<3
rich==13.7.1
smart_open>=2.1.0,<6.0
smart_open>=2.1.0,<8.0
tabulate==0.8.9
tenacity==8.2.2
tqdm<5.0
Expand Down
2 changes: 1 addition & 1 deletion src/gretel_client/docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def copy_files(
with tarfile.open(fileobj=copy_stream, mode="w") as tar_archive:
for file in files:
with smart_open.open(
file.source, "rb", ignore_ext=True
file.source, "rb", compression="disable"
) as src: # type:ignore
src.seek(0, 2)
info = tarfile.TarInfo(name=self._extract_file_name(file.target))
Expand Down
8 changes: 4 additions & 4 deletions src/gretel_client/projects/artifact_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def upload_project_artifact(

with _get_artifact_path_and_file_name(artifact_path) as art_path_and_file:
artifact_path, file_name = art_path_and_file
with smart_open.open(artifact_path, "rb", ignore_ext=True) as src:
with smart_open.open(artifact_path, "rb", compression="disable") as src:
art_resp = self.projects_api.create_artifact(
project_id=self.project_guid, artifact=Artifact(filename=file_name)
)
Expand Down Expand Up @@ -372,7 +372,7 @@ def upload_project_artifact(
open_artifact(
artifact_path,
"rb",
ignore_ext=True,
compression="disable",
) as in_stream,
open_artifact(target_out, "wb") as out_stream,
):
Expand Down Expand Up @@ -523,8 +523,8 @@ def _download(
target_out = output_path / Path(urlparse(download_link).path).name
try:
with (
open_artifact(download_link, "rb", ignore_ext=True) as src,
open_artifact(target_out, "wb", ignore_ext=True) as dest,
open_artifact(download_link, "rb", compression="disable") as src,
open_artifact(target_out, "wb", compression="disable") as dest,
):
shutil.copyfileobj(src, dest)
log.info(f"Downloaded '{artifact_type}' artifact")
Expand Down

0 comments on commit 4216cd7

Please sign in to comment.