Skip to content

Conversation

@rustamali9183
Copy link
Contributor

What does this PR changes?

This PR cleans up a redundant nested isinstance(na_values, dict) check in test_na_values_scaler for the "pyarrow" engine.
The inner check was always true and the else branch was unreachable.

Behavior after this PR

  • When parser.engine == "pyarrow" and na_values is a dict:
    • ValueError is still expected.
  • When parser.engine == "pyarrow" and na_values is invalid (non-string types):
    • TypeError is still expected.

Issue reference

Closes #63119

Checklist

  • Tests pass locally (233 passed, 1 skipped, 18 xfailed)
  • Code cleanup only - no behavior changes
  • Follows pandas contribution guidelines

Copy link
Member

@rhshadrach rhshadrach left a comment

Choose a reason for hiding this comment

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

pre-commit is failing. If you haven't set this up locally, it might be a good idea: https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit

@rhshadrach
Copy link
Member

The diff here looks off; I think merging main will straighten it out.

Copy link
Member

@rhshadrach rhshadrach left a comment

Choose a reason for hiding this comment

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

lgtm

@rhshadrach rhshadrach added Testing pandas testing functions or related to the test suite Clean labels Nov 18, 2025
@rhshadrach rhshadrach added this to the 3.0 milestone Nov 18, 2025
@rhshadrach rhshadrach merged commit 9048936 into pandas-dev:main Nov 18, 2025
49 of 51 checks passed
@rhshadrach
Copy link
Member

Thanks @rustamali9183

@rustamali9183
Copy link
Contributor Author

lgtm

Thanks @rhshadrach

@rustamali9183 rustamali9183 deleted the fix-na-values-pyarrow branch November 18, 2025 05:25
mittal-aakriti pushed a commit to mittal-aakriti/pandas that referenced this pull request Nov 19, 2025
mittal-aakriti pushed a commit to mittal-aakriti/pandas that referenced this pull request Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Clean Testing pandas testing functions or related to the test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Redundant type checks and dead code requiring refactoring

2 participants