Add pandas 3 support Status: Open. #96 - #112
Open
vrane-tibco wants to merge 13 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR modernizes Spotfire metadata handling for pandas 3 by centralizing DataFrame metadata operations, updating the public API to use that centralized layer, and aligning SBDF import/export plus tests with the new approach and updated dependency/runtime requirements.
Changes:
- Added a new
spotfire/_metadata.pymodule to manage table metadata, column metadata, and Spotfire types viadf.attrs(with legacy fallbacks and CoW-focused optimizations). - Updated public APIs (
spotfire/public.py,spotfire/__init__.py) and SBDF import/export (spotfire/sbdf.pyx) to use_metadataconsistently. - Updated tests and packaging/runtime constraints (Python 3.11+, pandas 3+, numpy 2+, adjusted CI python matrix).
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| spotfire/version.py | Bumps package version to the next major dev series. |
| spotfire/test/test_sbdf.py | Updates SBDF tests to use _metadata and adjusts expectations for pandas 3 string/NA behavior. |
| spotfire/test/test_data_function.py | Updates data-function tests to use _metadata-based APIs and removes legacy-warning expectations. |
| spotfire/test/files/data_function/table_metadata.txt | Removes legacy warning output that should no longer occur with new metadata handling. |
| spotfire/sbdf.pyx | Refactors SBDF import/export to use _metadata, improves dtype handling, and optimizes metadata/dtype lookup loops. |
| spotfire/public.py | Adds new public metadata getter/setter functions and routes metadata copying/types/geocoding to _metadata. |
| spotfire/data_function.py | Updates metadata debug logging to use _metadata and modernizes scalar value extraction checks. |
| spotfire/_metadata.py | Introduces centralized metadata storage/access layer with CoW dict optimization and legacy/deprecation handling. |
| spotfire/init.py | Exposes new public metadata functions at the package top level. |
| pyproject.toml | Updates Python/dependency requirements (Python 3.11+, pandas 3+, numpy 2+) and tooling config. |
| .github/python-versions.json | Drops Python 3.9/3.10 from the CI test matrix. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…and its implications for metadata mapping
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.
This pull request introduces significant improvements to how Spotfire metadata is handled in DataFrames, modernizing the approach for compatibility with pandas 3 and simplifying the metadata API. The main changes include a new centralized metadata management module, updates to the public API, and adjustments throughout the codebase to use the new system. Additionally, Python and dependency requirements have been updated to support only Python 3.11+ and newer versions of core libraries.
Metadata Management Modernization
_metadata.pymodule that centralizes all Spotfire metadata operations for DataFrames, using pandas 3'sdf.attrsand providing robust, copy-on-write (CoW) optimizations for performance. This module also handles legacy compatibility and deprecation warnings for old metadata patterns.public.pyto use the new_metadatamodule for all table and column metadata operations, replacing direct attribute access and legacy patterns with explicit getter/setter functions.sbdf.pyx) and all internal usages to use the new metadata API, ensuring consistent metadata handling across DataFrame operations and geocoding table support.Dependency and Compatibility Updates
numpy >= 2.0.0andpandas >= 3.0.0, and always includestzdatafor robust timezone handling in minimal containers.API and Usability Improvements
copy_metadatato use the new centralized logic.New Public API Functions -
Bug Fixes and Cleanups
data_function.pyto use type checks instead of module string comparisons, improving reliability and future compatibility.These changes modernize metadata handling, maintainability, and ensure compatibility with the latest Python and pandas releases.