-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
[train][tune] Safely check if the storage filesystem is pyarrow.fs.S3FileSystem
#48216
Conversation
can you fix that? I guess there are times the destination_file_system is None |
@ccoulombe I'd prefer not to do the string check. Let's do this instead: try:
from pyarrow.fs import S3FileSystem
except ImportError:
S3FileSystem = None
if S3FileSystem and isinstance(..., S3FileSystem):
... |
Sure, but out of curiosity : why ? fyi, |
String check may be less stable than checking for the class since pyarrow could change the type name. Other Yeah, |
When PyArrow does not have support, checking if the instance is `pyarrow.fs.S3FileSystem` raises an exception. Fixes ray-project#48187 Signed-off-by: Charles Coulombe <ccoulombe@users.noreply.github.com> Signed-off-by: Charles Coulombe <charles.coulombe@calculquebec.ca>
…mport Signed-off-by: Charles Coulombe <charles.coulombe@calculquebec.ca>
@justinvyu Updated, and I signed off the commits afterwards. Cheers |
Signed-off-by: Charles Coulombe <charles.coulombe@calculquebec.ca>
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.
Thanks!
pyarrow.fs.S3FileSystem
…3FileSystem` (ray-project#48216) ## Why are these changes needed? When PyArrow does not have support for S3, accessing `pyarrow.fs.S3FileSystem` raises an exception. Fix by checking if the `S3FileSystem` is importable before doing this typecheck. --------- Signed-off-by: Charles Coulombe <ccoulombe@users.noreply.github.com> Signed-off-by: Charles Coulombe <charles.coulombe@calculquebec.ca>
…3FileSystem` (ray-project#48216) ## Why are these changes needed? When PyArrow does not have support for S3, accessing `pyarrow.fs.S3FileSystem` raises an exception. Fix by checking if the `S3FileSystem` is importable before doing this typecheck. --------- Signed-off-by: Charles Coulombe <ccoulombe@users.noreply.github.com> Signed-off-by: Charles Coulombe <charles.coulombe@calculquebec.ca>
…3FileSystem` (ray-project#48216) ## Why are these changes needed? When PyArrow does not have support for S3, accessing `pyarrow.fs.S3FileSystem` raises an exception. Fix by checking if the `S3FileSystem` is importable before doing this typecheck. --------- Signed-off-by: Charles Coulombe <ccoulombe@users.noreply.github.com> Signed-off-by: Charles Coulombe <charles.coulombe@calculquebec.ca> Signed-off-by: mohitjain2504 <mohit.jain@dream11.com>
Why are these changes needed?
When PyArrow does not have support, checking if the instance is
pyarrow.fs.S3FileSystem
raises an exception.Fix by checking if the
S3FileSystem
is importable before doing this typecheck.Related issue number
Fixes #48187
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.