Skip to content

separate DatetimeIndex timezone tests #19545

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 6 commits into from
Feb 6, 2018

Conversation

jbrockmendel
Copy link
Member

There is probably some overlap with other tests.indexes.datetimes modules. We'll get those in the next pass.

@codecov
Copy link

codecov bot commented Feb 6, 2018

Codecov Report

Merging #19545 into master will increase coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #19545      +/-   ##
==========================================
+ Coverage    91.6%   91.63%   +0.02%     
==========================================
  Files         150      150              
  Lines       48750    48750              
==========================================
+ Hits        44657    44670      +13     
+ Misses       4093     4080      -13
Flag Coverage Δ
#multiple 90% <ø> (+0.02%) ⬆️
#single 41.75% <ø> (ø) ⬆️
Impacted Files Coverage Δ
pandas/io/parsers.py 95.56% <0%> (+0.06%) ⬆️
pandas/plotting/_converter.py 66.95% <0%> (+1.73%) ⬆️

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 93c86aa...aa57279. Read the comment docs.

@jreback jreback added Testing pandas testing functions or related to the test suite Timezones Timezone data dtype labels Feb 6, 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 a rebase

return timedelta(0)


fixed_off = FixedOffset(-420, '-07:00')
Copy link
Contributor

Choose a reason for hiding this comment

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

make these into fixtures

Copy link
Member Author

Choose a reason for hiding this comment

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

They're not being passed into parametrize anywhere.

Copy link
Contributor

Choose a reason for hiding this comment

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

hmm, these should be then.

expected = np.repeat(np.array([3, 4, 5]), np.array([n, n, 1]))
tm.assert_index_equal(idx.hour, Index(expected))

def test_dti_tz_convert_dst(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

parameterize (can be next pass)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yah I parametrized the most egregious of these, but there is bunch of cleanup like this for the next pass.

freq='L')
with pytest.raises(pytz.NonExistentTimeError):
dti.tz_localize(tzstr)

Copy link
Contributor

Choose a reason for hiding this comment

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

prob should dedupe these tz parameters into some nicely named fixtures (and push up what you can to conftest)

Copy link
Contributor

Choose a reason for hiding this comment

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

next PR

localized_is_dst = dr.tz_localize(tz, ambiguous=is_dst)
tm.assert_index_equal(localized, localized_is_dst)

# TODO: belongs outside tz_localize tests?
Copy link
Contributor

Choose a reason for hiding this comment

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

yeah move to construction

Copy link
Member Author

Choose a reason for hiding this comment

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

See the "FIXME" note about 4 lines down. I'm not confident this test is testing what it is intending. This is where the existing indentation typo is: https://github.com/pandas-dev/pandas/pull/19545/files#diff-f67205b3c64b63fa7471c4221e413a19L424


# ------------------------------------------------------------
# DatetimeIndex.__new__

Copy link
Contributor

Choose a reason for hiding this comment

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

hmm maybe should be in construction

tm.assert_index_equal(idx1, other)

# ------------------------------------------------------------
# Arithmetic; may belong in test_arithmetic
Copy link
Contributor

Choose a reason for hiding this comment

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

yes

@jreback jreback added this to the 0.23.0 milestone Feb 6, 2018
@jreback jreback merged commit 04b1f03 into pandas-dev:master Feb 6, 2018
@jreback
Copy link
Contributor

jreback commented Feb 6, 2018

thanks. if you can add the above items to the master TODO list would be great. I know minor, but don't want to forget about them; at the same time no reason to hold up merging this.

@jbrockmendel
Copy link
Member Author

Will do. I appreciate the leeway.

@jbrockmendel jbrockmendel deleted the tztests-dti branch February 7, 2018 00:19
harisbal pushed a commit to harisbal/pandas that referenced this pull request Feb 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite Timezones Timezone data dtype
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants