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

BUG: Fix indexing on DatetimeBlock #27110

Merged
merged 5 commits into from Jul 1, 2019

Conversation

@jbrockmendel
Copy link
Member

commented Jun 28, 2019

  • closes #xxxx
  • tests added / passed
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

Addresses one of the problems behind #26864, but probably doesn't address the statefullness problem there.

jbrockmendel added some commits Jun 28, 2019

@@ -1539,6 +1539,10 @@ def iget(self, col):
col, loc = col
if not com.is_null_slice(col) and col != 0:
raise IndexError("{0} only contains one item".format(self))
if isinstance(col, slice):

This comment has been minimized.

Copy link
@jreback

jreback Jun 28, 2019

Contributor

could be elif

@@ -421,11 +421,12 @@ def test_agg_timezone_round_trip():
assert ts == grouped.nth(0)['B'].iloc[0]
assert ts == grouped.head(1)['B'].iloc[0]
assert ts == grouped.first()['B'].iloc[0]
assert ts == grouped.apply(lambda x: x.iloc[0])[0]
assert ts == grouped.apply(lambda x: x.iloc[0]).iloc[0, 0]

This comment has been minimized.

Copy link
@jreback

jreback Jun 28, 2019

Contributor

can you reference this issue and maybe put a comment here on whey this is like this

This comment has been minimized.

Copy link
@jreback

jreback Jun 28, 2019

Contributor

or this is actually returning a single column DataFrame right? can you assert that


ts = df['B'].iloc[2]
assert ts == grouped.last()['B'].iloc[0]
assert ts == grouped.apply(lambda x: x.iloc[-1])[0]
# FIXME: the next assertion is wrong; GH#26864

This comment has been minimized.

Copy link
@jreback

jreback Jun 28, 2019

Contributor

same here

This comment has been minimized.

Copy link
@jreback

jreback Jun 28, 2019

Contributor

also ok with moving these to a new test if easier

@jbrockmendel

This comment has been minimized.

Copy link
Member Author

commented Jun 29, 2019

I'm pretty sure this problem also affects other EA blocks, will check and add tests if so

@jbrockmendel

This comment has been minimized.

Copy link
Member Author

commented Jul 1, 2019

@jreback any idea what’s up with the CI?

@jreback

This comment has been minimized.

Copy link
Contributor

commented Jul 1, 2019

/home/vsts/work/1/s/doc/source/whatsnew/v0.25.0.rst:786: WARNING: Unknown interpreted text role "method".
/home/vsts/work/1/s/doc/source/whatsnew/v0.25.0.rst:786: WARNING: Unknown interpreted text role "method".
@jreback

This comment has been minimized.

Copy link
Contributor

commented Jul 1, 2019

method -> meth in the whatnew

@jreback jreback added this to the 0.25.0 milestone Jul 1, 2019

@jreback

jreback approved these changes Jul 1, 2019

@jreback jreback merged commit 58b1732 into pandas-dev:master Jul 1, 2019

14 checks passed

codecov/patch 100% of diff hit (target 50%)
Details
codecov/project 91.86% (target 82%)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
pandas-dev.pandas Build #20190701.49 succeeded
Details
pandas-dev.pandas (Checks) Checks succeeded
Details
pandas-dev.pandas (Docs) Docs succeeded
Details
pandas-dev.pandas (Linux py35_compat) Linux py35_compat succeeded
Details
pandas-dev.pandas (Linux py36_locale_slow) Linux py36_locale_slow succeeded
Details
pandas-dev.pandas (Linux py36_locale_slow_old_np) Linux py36_locale_slow_old_np succeeded
Details
pandas-dev.pandas (Linux py37_locale) Linux py37_locale succeeded
Details
pandas-dev.pandas (Linux py37_np_dev) Linux py37_np_dev succeeded
Details
pandas-dev.pandas (Windows py36_np15) Windows py36_np15 succeeded
Details
pandas-dev.pandas (Windows py37_np141) Windows py37_np141 succeeded
Details
pandas-dev.pandas (macOS py35_macos) macOS py35_macos succeeded
Details
@jreback

This comment has been minimized.

Copy link
Contributor

commented Jul 1, 2019

thanks @jbrockmendel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.