Skip to content

ODB-571: Fix inappropriate defaulting to dtype=StringDType in python … - #43

Merged
simondsmart merged 4 commits into
developfrom
feature/odb-571
Feb 24, 2026
Merged

simondsmart merged 4 commits into
developfrom
feature/odb-571

Conversation

@simondsmart

Copy link
Copy Markdown
Contributor

…3.11 with Pandas 3

Description

Contributor Declaration

By opening this pull request, I affirm the following:

  • All authors agree to the Contributor License Agreement.
  • The code follows the project's coding standards.
  • I have performed self-review and added comments where needed.
  • I have added or updated tests to verify that my changes are effective and functional.
  • I have run all existing tests and confirmed they pass.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 object dtype in pyodc to avoid pandas StringDtype/None incompatibilities.
  • Avoid relying on Series.where(..., inplace=True) in one-shot readers by explicitly assigning the result back to the DataFrame (both pyodc and codc).
  • Adjust codc string decode path to cast to object, and add pytest configuration to include src on pythonpath.

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.

Comment thread src/pyodc/reader.py Resolved
Comment thread src/codc/reader.py Resolved
Comment thread src/pyodc/frame.py Resolved
Comment thread pyproject.toml Resolved
Comment thread tests/test_end_to_end.py Resolved
simondsmart and others added 3 commits February 17, 2026 13:45
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>
@simondsmart
simondsmart merged commit 6d0759a into develop Feb 24, 2026
137 of 139 checks passed
@Oisin-M Oisin-M mentioned this pull request Aug 11, 2026
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.

3 participants