Skip to content

BUG: iloc setting columns not taking effect #33381

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

Closed
wants to merge 10 commits into from

Conversation

ShaharNaveh
Copy link
Member

@ShaharNaveh ShaharNaveh commented Apr 7, 2020

@jbrockmendel
Copy link
Member

are you running the full test suite locally before pushing?

@ShaharNaveh
Copy link
Member Author

are you running the full test suite locally before pushing?

Not fully. usually only the parts I suspect that are related to the changes I make, in this case I tried on pytest -q --cache-clear pandas/tests/frame/methods/ before pushing.

@jbrockmendel
Copy link
Member

Unless you need to save the wattage, its usually good to run the full thing. e.g. i have in .bash_aliases alias ptest="python3 -m pytest pandas/tests --skip-slow --skip-db"

In this case we might expect tests.indexing, tests.frame.indexing, tests.series.indexing, and possibly tests.indexes to be potential trouble spots

@ShaharNaveh
Copy link
Member Author

Unless you need to save the wattage, its usually good to run the full thing. e.g. i have in .bash_aliases alias ptest="python3 -m pytest pandas/tests --skip-slow --skip-db"

That's a good tip.

@@ -1557,7 +1557,10 @@ def _setitem_with_indexer(self, indexer, value):
(blk,) = self.obj._mgr.blocks
if 1 < blk.ndim: # in case of dict, keys are indices
val = list(value.values()) if isinstance(value, dict) else value
take_split_path = not blk._can_hold_element(val)
if isinstance(indexer, tuple) and com.is_null_slice(indexer[0]):
Copy link
Member

Choose a reason for hiding this comment

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

can you add a comment pointing back to this or the original issue

@@ -31,6 +31,15 @@
_slice_msg = "slice indices must be integers or None or have an __index__ method"


def test_unsure_about_the_name_and_location():
Copy link
Member

Choose a reason for hiding this comment

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

we need to make a test_iloc.py file in this directory, might as well do it in this PR

@jbrockmendel
Copy link
Member

Looking at the test logs, there's still some more troubleshooting to be done. What's the next step?

@ShaharNaveh
Copy link
Member Author

ShaharNaveh commented Apr 10, 2020

Looking at the test logs, there's still some more troubleshooting to be done. What's the next step?

@jbrockmendel Looks like we need to check for the length of the index of each one, to decide if we are taking the split path.

what I tried was:

                val = list(value.values()) if isinstance(value, dict) else value
                # https://github.com/pandas-dev/pandas/issues/33198
                if isinstance(indexer, tuple) and com.is_null_slice(indexer[0]):
                    take_spit_path = length_of_indexer(
                        self.obj.index
                    ) == length_of_indexer(indexer[0])

But it does not work.

@jbrockmendel
Copy link
Member

Let's continue troubleshooting in #33198. Closing to clear the queue, can re-open when its ready to go.

@ShaharNaveh ShaharNaveh deleted the BUG-IlocSetInPlace branch May 3, 2021 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: iloc setting columns not taking effect
2 participants