-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
Fix bug where list like object not returning empty Index. #26471
Conversation
@TomAugspurger could you please share your thoughts, can you also help me locate the file where tests have to be added, i am sorry but i don't understand project structure completely. Thanks in advance. |
I think a new test with the code from the original issue at the top-level of |
Codecov Report
@@ Coverage Diff @@
## master #26471 +/- ##
===========================================
- Coverage 91.75% 41.7% -50.05%
===========================================
Files 174 174
Lines 50765 50765
===========================================
- Hits 46578 21173 -25405
- Misses 4187 29592 +25405
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #26471 +/- ##
===========================================
+ Coverage 42.56% 91.71% +49.14%
===========================================
Files 189 178 -11
Lines 50059 50755 +696
===========================================
+ Hits 21307 46548 +25241
+ Misses 28752 4207 -24545
Continue to review full report at Codecov.
|
6f545b8
to
3f0eb24
Compare
@TomAugspurger changing the behaviour is breaking few tests, i have fixed one of them if the approach is right, i can check what are the other places where tests are breaking and i can fix that. Can you also share command on how can i run tests in individual files please, for example if i only want to run tests from file |
@@ -451,7 +451,7 @@ def test_partial_set_empty_frame(self): | |||
# these work as they don't really change | |||
# anything but the index | |||
# GH5632 | |||
expected = DataFrame(columns=['foo'], index=Index([], dtype='int64')) | |||
expected = DataFrame(columns=['foo'], index=Index([])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want to change this test. IIUC, previously the expected index was an empty Int64Index, which would compare equal to an empty RangeIndex. Now it'll be an empty object-dtype index.
cc @jreback
can you merge master and update to comments |
2. Edit v0.25.0.rst to update changelog.
…subsection. 3. Update another failing test
@jreback Is the PR ok ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a whatsnew note in bug fixes / indexing section
can you merge master and respond to comments |
@sumanau7 there's a merge conflict. Can you update to fix it? |
Merged master & addressed the comments. Let's see if CI passes. |
@jbrockmendel can you give this a quick sanity check? Would be nice for 0.25.1. |
The new test looks good to me, but it isn't obvious that the edited test needs to be changed (not that it is wrong, just not obviously needed) |
@@ -469,22 +469,21 @@ def f(): | |||
expected["foo"] = expected["foo"].astype("float64") | |||
|
|||
def f(): | |||
df = DataFrame() | |||
df = DataFrame(index=Index([], dtype="int64")) | |||
df["foo"] = [] | |||
return df | |||
|
|||
tm.assert_frame_equal(f(), expected) | |||
|
|||
def f(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do these need nested functions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed it's strange, but we'll ignore that, since the modifications are following the existing structure.
Thanks @sumanau7! |
* master: (40 commits) DOC: Fix GL01 and GL02 errors in the docstrings (pandas-dev#27988) Remove Encoding of values in char** For Labels (pandas-dev#27618) TYPING: more type hints for io.formats.printing (pandas-dev#27765) TST: fix compression tests when run without virtualenv/condaenv (pandas-dev#28051) DOC: Start 0.25.2 (pandas-dev#28111) DOC: Fix docstrings lack of punctuation (pandas-dev#28031) DOC: Remove alias for numpy.random.randn from the docs (pandas-dev#28082) DOC: update GroupBy.head()/tail() documentation (pandas-dev#27844) BUG: timedelta merge asof with tolerance (pandas-dev#27650) BUG: Series.rename raises error on values accepted by Series construc… (pandas-dev#27814) Preserve index when setting new column on empty dataframe. (pandas-dev#26471) BUG: Fixed groupby quantile for listlike q (pandas-dev#27827) BUG: iter with readonly values, closes pandas-dev#28055 (pandas-dev#28074) TST: non-strict xfail for period test (pandas-dev#28072) DOC: Update whatsnew (pandas-dev#28073) CI: disable codecov (pandas-dev#28065) CI: Set SHA for codecov upload (pandas-dev#28067) BUG: Correct the previous bug fixing on xlim for plotting (pandas-dev#28059) CI: Add pip dependence explicitly (pandas-dev#28008) DOC: Change document code prun in a row (pandas-dev#28029) ...
git diff upstream/master -u -- "*.py" | flake8 --diff