Repository navigation
ODB-571: Fix inappropriate defaulting to dtype=StringDType in python … - #43
Merged
Merged
Conversation
…3.11 with Pandas 3
Contributor
There was a problem hiding this comment.
Pull request overview
This PR targets ODB-571 issues seen under Python 3.11 + Pandas 3.x, where decoded string columns can unexpectedly use pandas StringDtype and/or inplace=True operations don’t behave as intended, leading to dtype-related failures and incorrect missing-value handling.
Changes:
- Force decoded STRING columns to
objectdtype inpyodcto avoid pandasStringDtype/Noneincompatibilities. - Avoid relying on
Series.where(..., inplace=True)in one-shot readers by explicitly assigning the result back to the DataFrame (bothpyodcandcodc). - Adjust
codcstring decode path to cast toobject, and add pytest configuration to includesrconpythonpath.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
tests/test_end_to_end.py |
Alters DataFrame equality helper to optionally skip dtype checks to work around the reported dtype comparison issue. |
src/pyodc/reader.py |
Switches from inplace=True to explicit assignment for null→None conversion in object columns. |
src/pyodc/frame.py |
Ensures decoded STRING columns end up as object dtype (not pandas StringDtype) under affected environments. |
src/codc/reader.py |
Mirrors the inplace=True→assignment change for null→None conversion. |
src/codc/frame.py |
Adds a final cast to object after decoding byte strings. |
pyproject.toml |
Adds pytest pythonpath = ["src"] configuration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jharwood0
approved these changes
Feb 17, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…3.11 with Pandas 3
Description
Contributor Declaration
By opening this pull request, I affirm the following: