-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
ENH: Timestamp constructor now raises more explanatory error message #31653
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
ENH: Timestamp constructor now raises more explanatory error message #31653
Conversation
…(GH31200) Timestamp constructor now raises explanatory error message when year, month or day is missing
The error message of The use of |
@fujiaxiang do you have a measure on how performance is affected? We don't call the constructor this way often, so a small hit is OK. |
@jbrockmendel I ran %timeit on current master and this implementation, this is what I get: # on current master
>>>%timeit pd.Timestamp(year=2020, month=1, day=1)
1.19 µs ± 4.74 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each)
# re-built from this PR
>>>%timeit pd.Timestamp(year=2020, month=1, day=1)
1.7 µs ± 2.21 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each) Looks like it takes about 43% longer with this PR. |
…ctor_misleading_error_msg
thanks |
Timestamp constructor now raises explanatory error message when year, month or day is missing
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff