Skip to content

REF: catch more specific exceptions in Series.__setitem__ #45194

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 2 commits into from
Jan 8, 2022

Conversation

jbrockmendel
Copy link
Member

  • closes #xxxx
  • tests added / passed
  • Ensure all linting tests pass, see here for how to run them
  • whatsnew entry

In a few cases we can avoid some com.is_bool_indexer or lib.infer_dtype checks

@jbrockmendel jbrockmendel changed the title REF: catch more specific exceptions in Series.__setitem__ @jbrockmendel REF: catch more specific exceptions in Series.__setitem__ Jan 5, 2022
@jbrockmendel
Copy link
Member Author

cc @mroeschke

lsof: WARNING: can't stat() nsfs file system /run/docker/netns/e6f7fa210b0b
      Output information may be incomplete.
lsof: WARNING: can't stat() overlay file system /var/lib/docker/overlay2/f8dcbf9270f81fe4daa26f1802aa3e8855accbf4a344b2a7df4f0e97bde6c398/merged
      Output information may be incomplete.
lsof: WARNING: can't stat() nsfs file system /run/docker/netns/634339963c8a
      Output information may be incomplete.
lsof: WARNING: can't stat() overlay file system /var/lib/docker/overlay2/5a39676f965bf508d62143609ce3c0cdc9f8534fb9c6ac8e3eb5a37fb6895649/merged
      Output information may be incomplete.

[...]

E           AssertionError: Caused unexpected warning(s): [('ResourceWarning', ResourceWarning('unclosed file <_io.BufferedRandom name=16>'), '/usr/share/miniconda/envs/pandas-dev/lib/python3.8/inspect.py', 744), ('ResourceWarning', ResourceWarning('unclosed file <_io.BufferedRandom name=17>'), '/usr/share/miniconda/envs/pandas-dev/lib/python3.8/inspect.py', 744), ('ResourceWarning', ResourceWarning('unclosed file <_io.BufferedRandom name=18>'), '/usr/share/miniconda/envs/pandas-dev/lib/python3.8/inspect.py', 744), ('ResourceWarning', ResourceWarning('unclosed file <_io.BufferedRandom name=20>'), '/usr/share/miniconda/envs/pandas-dev/lib/python3.8/inspect.py', 744), ('ResourceWarning', ResourceWarning('unclosed file <_io.BufferedRandom name=19>'), '/usr/share/miniconda/envs/pandas-dev/lib/python3.8/inspect.py', 744), ('ResourceWarning', ResourceWarning('unclosed file <_io.BufferedRandom name=21>'), '/usr/share/miniconda/envs/pandas-dev/lib/python3.8/inspect.py', 744), ('ResourceWarning', ResourceWarning('unclosed file <_io.BufferedRandom name=23>'), '/usr/share/miniconda/envs/pandas-dev/lib/python3.8/inspect.py', 744), ('ResourceWarning', ResourceWarning('unclosed file <_io.BufferedRandom name=22>'), '/usr/share/miniconda/envs/pandas-dev/lib/python3.8/inspect.py', 744)]

@mroeschke
Copy link
Member

cc @mroeschke

lsof: WARNING: can't stat() nsfs file system /run/docker/netns/e6f7fa210b0b
      Output information may be incomplete.
lsof: WARNING: can't stat() overlay file system /var/lib/docker/overlay2/f8dcbf9270f81fe4daa26f1802aa3e8855accbf4a344b2a7df4f0e97bde6c398/merged
      Output information may be incomplete.
lsof: WARNING: can't stat() nsfs file system /run/docker/netns/634339963c8a
      Output information may be incomplete.
lsof: WARNING: can't stat() overlay file system /var/lib/docker/overlay2/5a39676f965bf508d62143609ce3c0cdc9f8534fb9c6ac8e3eb5a37fb6895649/merged
      Output information may be incomplete.

[...]

E           AssertionError: Caused unexpected warning(s): [('ResourceWarning', ResourceWarning('unclosed file <_io.BufferedRandom name=16>'), '/usr/share/miniconda/envs/pandas-dev/lib/python3.8/inspect.py', 744), ('ResourceWarning', ResourceWarning('unclosed file <_io.BufferedRandom name=17>'), '/usr/share/miniconda/envs/pandas-dev/lib/python3.8/inspect.py', 744), ('ResourceWarning', ResourceWarning('unclosed file <_io.BufferedRandom name=18>'), '/usr/share/miniconda/envs/pandas-dev/lib/python3.8/inspect.py', 744), ('ResourceWarning', ResourceWarning('unclosed file <_io.BufferedRandom name=20>'), '/usr/share/miniconda/envs/pandas-dev/lib/python3.8/inspect.py', 744), ('ResourceWarning', ResourceWarning('unclosed file <_io.BufferedRandom name=19>'), '/usr/share/miniconda/envs/pandas-dev/lib/python3.8/inspect.py', 744), ('ResourceWarning', ResourceWarning('unclosed file <_io.BufferedRandom name=21>'), '/usr/share/miniconda/envs/pandas-dev/lib/python3.8/inspect.py', 744), ('ResourceWarning', ResourceWarning('unclosed file <_io.BufferedRandom name=23>'), '/usr/share/miniconda/envs/pandas-dev/lib/python3.8/inspect.py', 744), ('ResourceWarning', ResourceWarning('unclosed file <_io.BufferedRandom name=22>'), '/usr/share/miniconda/envs/pandas-dev/lib/python3.8/inspect.py', 744)]

Thanks I'll look into it. The saga continues...

@jreback jreback added this to the 1.5 milestone Jan 8, 2022
@jreback jreback added Indexing Related to indexing on series/frames, not to indexes themselves Refactor Internal refactoring of code labels Jan 8, 2022
@jreback jreback merged commit b47f1eb into pandas-dev:master Jan 8, 2022
@jbrockmendel jbrockmendel deleted the ref-series-setitem branch January 8, 2022 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Indexing Related to indexing on series/frames, not to indexes themselves Refactor Internal refactoring of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants