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

Add module name to expected meta error message #4499

Merged
merged 2 commits into from Feb 19, 2019

Conversation

@mrocklin
Copy link
Member

@mrocklin mrocklin commented Feb 19, 2019

  • Tests added / passed
  • Passes flake8 dask
dask/utils.py Outdated
>>> typename(int)
'builtins.int'
"""
return typ.__module__ + '.' + typ.__name__
Copy link
Member Author

@mrocklin mrocklin Feb 19, 2019

Recommendations on how to do this better would be welcome

Copy link
Member

@jcrist jcrist Feb 19, 2019

Supposedly __module__ can be None (see docs), although I've yet to find a case where it is. You also may want to drop the module name for builtins.

Suggested change
return typ.__module__ + '.' + typ.__name__
m = typ.__module__
n = typ.__name__
return n if m in {None, 'builtins'} else '%s.%s' % (m, n)

@jcrist
Copy link
Member

@jcrist jcrist commented Feb 19, 2019

LGTM. Merging.

@jcrist jcrist merged commit f6b61fc into dask:master Feb 19, 2019
2 checks passed
@jcrist jcrist deleted the dataframe-meta-typename branch Feb 19, 2019
jorge-pessoa pushed a commit to jorge-pessoa/dask that referenced this issue May 14, 2019
* Add module name to expected meta error message

* handle builtins and None in typename
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants