Skip to content

Commit

Permalink
[Requirements] Support PyArrow 3 (#1049)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gal Topper committed Nov 9, 2021
1 parent 2aa1c7d commit a504fe6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
12 changes: 9 additions & 3 deletions mlrun/datastore/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,15 @@ def reader(*args, **kwargs):
kwargs["storage_options"] = storage_options
return reader(url, **kwargs)
else:
# If not dir, use fs.open() to avoid regression when pandas < 1.2 and does not
# support the storage_options parameter.
return reader(fs.open(url), **kwargs)

file = url
# Workaround for ARROW-12472 affecting pyarrow 3.x and 4.x.
if fs.protocol != "file":
# If not dir, use fs.open() to avoid regression when pandas < 1.2 and does not
# support the storage_options parameter.
file = fs.open(url)

return reader(file, **kwargs)

temp_file = tempfile.NamedTemporaryFile(delete=False)
self.download(self._join(subpath), temp_file.name)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ numpy>=1.16.5, <1.20.0
pandas~=1.2; python_version >= '3.7'
pandas~=1.0; python_version < '3.7'
# used as a the engine for parquet files by pandas
pyarrow~=1.0
pyarrow>=1,<4
pyyaml~=5.1
requests~=2.22
sqlalchemy~=1.3
Expand Down
1 change: 1 addition & 0 deletions tests/test_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ def test_requirement_specifiers_convention():
"boto3": {"~=1.9, <1.17.107"},
"azure-storage-blob": {"~=12.0, <12.7.0"},
"dask-ml": {"~=1.4,<1.9.0"},
"pyarrow": {">=1,<4"},
}

for (ignored_requirement_name, ignored_specifiers,) in ignored_invalid_map.items():
Expand Down

0 comments on commit a504fe6

Please sign in to comment.