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

Propagate name in more cases when using to_datetime #21848

Closed
wants to merge 2 commits into from

Conversation

eyurtsev
Copy link

@eyurtsev eyurtsev commented Jul 10, 2018

Closes #21697

Haven't ran tests yet

@@ -250,8 +243,11 @@ def _convert_listlike_datetimes(arg, box, format, name=None, tz=None,
result, timezones = array_strptime(
arg, format, exact=exact, errors=errors)
if '%Z' in format or '%z' in format:
return _return_parsed_timezone_results(
result, timezones, box, tz)
tz_results = _return_parsed_timezone_results(
Copy link
Author

Choose a reason for hiding this comment

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

missing return here actually

@jreback
Copy link
Contributor

jreback commented Jul 11, 2018

#21703 is also proposed for this issue, though its currently failing. So happy to have you add tests.

@eyurtsev
Copy link
Author

eyurtsev commented Jul 11, 2018

I was trying to stick to the convention in the file, but wanted is there a reason for local imports? Is that the convention in the codebase or is it OK to float the imports to the top?

def my_function():
  from pandas import Index
  return Index(tz_results, name=name)

@codecov
Copy link

codecov bot commented Jul 11, 2018

Codecov Report

Merging #21848 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #21848      +/-   ##
==========================================
+ Coverage   91.92%   91.92%   +<.01%     
==========================================
  Files         160      160              
  Lines       49916    49917       +1     
==========================================
+ Hits        45885    45886       +1     
  Misses       4031     4031
Flag Coverage Δ
#multiple 90.3% <100%> (ø) ⬆️
#single 42.11% <30%> (-0.01%) ⬇️
Impacted Files Coverage Δ
pandas/core/tools/datetimes.py 85.26% <100%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1dd05cc...944e2e5. Read the comment docs.

@jreback
Copy link
Contributor

jreback commented Jul 12, 2018

@eyurtsev you should not use local imports except in very specific circumstances

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

needs tests. also you are changing some extraneous code, can you limit changes to what is needed to solve the issue.

@gfyoung gfyoung added Bug Datetime Datetime data dtype labels Jul 12, 2018
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

needs tests and a whatsnew note

@jreback
Copy link
Contributor

jreback commented Sep 25, 2018

closing as stale. would still take this PR if updated.

@jreback jreback closed this Sep 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Datetime Datetime data dtype
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants