ARROW-9645: [Python] Deprecate pyarrow.filesystem in favor of pyarrow.fs#8149
Conversation
b591d25 to
c46ff8c
Compare
34c84ee to
b274fd8
Compare
|
The main remaining items is I was thinking to keep |
fc5b7fd to
8c57769
Compare
|
I think we should deprecate |
|
We could in theory also add a deprecation in each method on the legacy HadoopFileSystem, so that any use outside of passing it to one of our own functions accepting a filesystem gets deprecated, but not the construction of the filesystem object itself (and then we can eventually return a different object, and for now convert it internally). But, even if we do the effort for that, we are still left with this |
d45a0fe to
dfdc622
Compare
|
@github-actions crossbow submit -g integration |
|
Revision: dfdc622 Submitted crossbow builds: ursa-labs/crossbow @ actions-607 |
python/pyarrow/__init__.py
Outdated
| return _LocalFileSystem | ||
| elif name == "HadoopFileSystem": | ||
| _warnings.warn(_msg.format("HadoopFileSystem", "HadoopFileSystem"), | ||
| DeprecationWarning, stacklevel=2) |
python/pyarrow/__init__.py
Outdated
|
|
||
| if _sys.version_info >= (3, 7): | ||
| def __getattr__(name): | ||
| if name == "localfs": |
There was a problem hiding this comment.
Looks like you want to write a loop and/or helper function to avoid all this copy/pasting?
There was a problem hiding this comment.
Put the info in a dict, and simplified this
python/pyarrow/filesystem.py
Outdated
| warnings.warn( | ||
| "pyarrow.filesystem.LocalFileSystem is deprecated as of 2.0.0, " | ||
| "please use pyarrow.fs.LocalFileSystem instead", | ||
| DeprecationWarning, stacklevel=2) |
There was a problem hiding this comment.
Put a helper in pyarrow.util? (and use FutureWarning?)
There was a problem hiding this comment.
There is a _deprecate_class in pyarrow.util, but that serves a different purpose (it aliases the old name to the new class, but with warning).
And if it is just a helper for raising the warning, I am not sure that is worth it (compared to using a template message that can be filled in).
There was a problem hiding this comment.
Moved a template to pyarrow.util. Can also make it a function raising the warning if you prefer
python/pyarrow/filesystem.py
Outdated
| return LocalFileSystem._get_instance() | ||
|
|
||
| try: | ||
| import fsspec |
There was a problem hiding this comment.
fsspec seems to take some time to import, we should probably lookup directly in sys.modules instead.
No description provided.