Skip to content
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

Skip gcsfs registration to dask if dask is not installed #129

Merged
merged 1 commit into from
Feb 20, 2019

Conversation

qibin-google
Copy link
Contributor

No description provided.

@@ -118,7 +120,6 @@ def walk(self, path, refresh=False):
dask.bytes.core._filesystems['gs'] = DaskGCSFileSystem


try:
# Register to dask if dask is installed
if 'dask' in sys.modules:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't do what you think, it requires dask to have been already imported. Therefore, if gcsfs happens to be imported before dask, register will never be called.

register()
except ImportError as e:
print(e)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest the easiest thing to do here is to change the print to a logger.debug statement, so it doesn't normally show unless the user enables debug logging.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Martin,

Thanks for pointing it out. Yes, logger.debug will be much easier. Thanks for the suggestion.

Best,

Qibin

gcsfs/dask_link.py Outdated Show resolved Hide resolved
gcsfs/dask_link.py Outdated Show resolved Hide resolved
gcsfs/dask_link.py Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants