Skip to content

CLN: keyerror in versioneer error message #23974

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

Merged
merged 1 commit into from
Nov 28, 2018

Conversation

chris-b1
Copy link
Contributor

broken formatting code from the cleanup in #18010

Not sure if this can be realistically tested - something weird in my local git causing tags to not come through - only impacts dev version reporting.

before:

import pandas as pd  # import fails 

~\Documents\python-dev\pandas\pandas\__init__.py in <module>
     53 # use the closest tagged version if possible
     54 from ._version import get_versions
---> 55 v = get_versions()
     56 __version__ = v.get('closest-tag', v['version'])
     57 __git_version__ = v.get('full-revisionid')

~\Documents\python-dev\pandas\pandas\_version.py in get_versions()
    451
    452     try:
--> 453         pieces = git_pieces_from_vcs(cfg.tag_prefix, root, verbose)
    454         return render(pieces, cfg.style)
    455     except NotThisMethod:

~\Documents\python-dev\pandas\pandas\_version.py in git_pieces_from_vcs(tag_prefix, root, verbose, run_command)
    245             pieces["error"] = ("tag '{full_tag}' doesn't start with "
    246                                "prefix '{tag_prefix}'".format(
--> 247                                    full_tag, tag_prefix))
    248             return pieces
    249         pieces["closest-tag"] = full_tag[len(tag_prefix):]

KeyError: 'full_tag'

after:

import pandas as pd

In [1]: pd.__version__
Out[1]: 'unknown'

In [2]: pd._version.get_versions()
Out[2]:
{'version': 'unknown',
 'full-revisionid': 'eb42b01f687438953cb4bb450205ff23b402bc1c',
 'dirty': None,
 'error': "tag 'list' doesn't start with prefix 'v'"}

@chris-b1 chris-b1 added Error Reporting Incorrect or improved errors from pandas Clean labels Nov 28, 2018
@chris-b1 chris-b1 added this to the 0.24.0 milestone Nov 28, 2018
@pep8speaks
Copy link

Hello @chris-b1! Thanks for submitting the PR.

@jreback
Copy link
Contributor

jreback commented Nov 28, 2018

this is generated code i don’t think u can change this

@chris-b1
Copy link
Contributor Author

It was generated, but has had several manual touch-ups - this bug was introduced in #18010, one of those

@jreback jreback merged commit 15f7046 into pandas-dev:master Nov 28, 2018
@jreback
Copy link
Contributor

jreback commented Nov 28, 2018

thanks @chris-b1

Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Error Reporting Incorrect or improved errors from pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants