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

Projects
None yet
2 participants
@mrocklin
Copy link
Member

commented Feb 19, 2019

  • Tests added / passed
  • Passes flake8 dask
>>> typename(int)
'builtins.int'
"""
return typ.__module__ + '.' + typ.__name__

This comment has been minimized.

Copy link
@mrocklin

mrocklin Feb 19, 2019

Author Member

Recommendations on how to do this better would be welcome

This comment has been minimized.

Copy link
@jcrist

jcrist Feb 19, 2019

Member

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

This comment has been minimized.

Copy link
Member

commented Feb 19, 2019

LGTM. Merging.

@jcrist jcrist merged commit f6b61fc into dask:master Feb 19, 2019

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@jcrist jcrist deleted the mrocklin:dataframe-meta-typename branch Feb 19, 2019

jorge-pessoa pushed a commit to jorge-pessoa/dask that referenced this pull request May 14, 2019

Add module name to expected meta error message (dask#4499)
* 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
You can’t perform that action at this time.