Repository navigation
fix: handle pandas extension dtypes in ownership calculations - #1377
Merged
dgunning merged 3 commits intoSep 28, 2026
Merged
Conversation
Resolve the conflict with dgunning#1367 in Ownership.shares_traded: keep its None/empty guard and `trades` local, and keep this branch's pd.api.types.is_numeric_dtype check in place of np.issubdtype. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Merged current The #1368 and #1359 regression files pass on both pandas 3.0.6 and 2.3.3: 15 tests per environment, with no skips. The wider network-dependent tests remain unverified locally; their offline failures match the unchanged upstream base. |
Merged
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.
Pandas 3 text columns and pandas nullable numeric dtypes can make NumPy's dtype check raise
TypeErrorin ownership calculations. Use pandas' dtype predicate at both affected sites while retaining the numeric-text fallback and nonnumeric results.Fixes #1368. Thanks to @manantlerio for the reproduction, affected-site analysis, and proposed fix. The empty-trades change in #1367 remains separate.
The regression exercises
Form4.parse_xml()with the checked-in Snowflake fixture modified only in memory. It covers footnoted text, unreadable shares, nullable numeric columns, and the normal share total; the modified XML is synthetic and no cassette is recorded.Validation:
pytest -p tests._offline_harness -p no:pytest-retry -q tests/issues/regression/test_issue_1368_ownership_numeric_dtypes.pyAI assistance: coding, test execution, and an independent model review were performed with AI tools. This is disclosed as AI-assisted work; no human code review is claimed.