-
Notifications
You must be signed in to change notification settings - Fork 3.8k
ARROW-9645: [Python] Deprecate pyarrow.filesystem in favor of pyarrow.fs #8149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use FutureWarning
elsewhere.
python/pyarrow/__init__.py
Outdated
|
||
if _sys.version_info >= (3, 7): | ||
def __getattr__(name): | ||
if name == "localfs": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put a helper in pyarrow.util
? (and use FutureWarning
?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fsspec
seems to take some time to import, we should probably lookup directly in sys.modules
instead.
Closes apache#8149 from jorisvandenbossche/ARROW-9645-deprecate-legacy-filesystems Authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com> Signed-off-by: Antoine Pitrou <antoine@python.org>
Closes apache#8149 from jorisvandenbossche/ARROW-9645-deprecate-legacy-filesystems Authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com> Signed-off-by: Antoine Pitrou <antoine@python.org>
No description provided.