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
Merged

Conversation

jbrockmendel
Copy link
Member

  • 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.

@jreback jreback added Bug Indexing Related to indexing on series/frames, not to indexes themselves Timezones Timezone data dtype labels 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):
Copy link
Contributor

Choose a reason for hiding this comment

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

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]
Copy link
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Contributor

Choose a reason for hiding this comment

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

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
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

Copy link
Contributor

Choose a reason for hiding this comment

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

also ok with moving these to a new test if easier

@jbrockmendel
Copy link
Member Author

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

@jbrockmendel
Copy link
Member Author

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

@jreback
Copy link
Contributor

jreback 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
Copy link
Contributor

jreback commented Jul 1, 2019

method -> meth in the whatnew

@jreback jreback added this to the 0.25.0 milestone Jul 1, 2019
@jreback jreback merged commit 58b1732 into pandas-dev:master Jul 1, 2019
@jreback
Copy link
Contributor

jreback commented Jul 1, 2019

thanks @jbrockmendel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Indexing Related to indexing on series/frames, not to indexes themselves Timezones Timezone data dtype
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants