Skip to content

feat(python): add experimental Python 3.15 compatibility - #45823

Open
luth2 wants to merge 13 commits into
apache:masterfrom
luth2:upgrade/python-support-3-15-readable
Open

luth2 wants to merge 13 commits into
apache:masterfrom
luth2:upgrade/python-support-3-15-readable

Conversation

@luth2

@luth2 luth2 commented Oct 28, 2026

Copy link
Copy Markdown

SUMMARY

Replaces #45821 with a reviewable, line-ending-clean diff. Related to #45019.

The previous PR included repository-wide CRLF/LF churn. This branch is rebuilt from the same original base and preserves its substantive changes without that churn: 49 files changed, 680 insertions, 135 deletions, in one commit. The original branch has not been rewritten.

  • Add experimental Python 3.15 source compatibility while keeping Python 3.11 as the minimum supported version and leaving the default container interpreter and support classifiers unchanged.
  • Select NumPy >=2.5.4,<2.6 and pandas >=3.1.0,<3.2 on Python 3.15 using dependency markers; preserve the existing ranges for Python 3.11-3.14.
  • Update pandas post-processing, result-set handling, SQL parsing and related compatibility paths, with regression coverage.
  • Add a Python 3.11-3.15 compatibility workflow covering focused tests, dependency consistency, a fresh SQLite migration and application health.
  • Use package metadata for the lean/superset Docker dependency stage on Python 3.15, retaining the requirements-based path for older interpreters. Build read-only mounted sources in a disposable writable copy and test cleanup on both success and failure.
  • Declare rich directly for CLI imports and document installation, validation and known limitations.

The frontend Node pin remains v24.16.0 with LF line endings, matching the original base. This avoids carrying the CRLF-corrupted version string that blocked the previous Netlify docs preview. No Netlify configuration or Node version change is needed.

Beyond removing line-ending churn, this replacement adds an explicit union type annotation in the container regression test and the shell script's final newline, as required by local checks.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Not applicable. No intentional UI changes.

TESTING INSTRUCTIONS

Create an isolated Python 3.15 environment and install from package metadata, not the generated Python 3.11 requirement files:

python -m venv .venv
source .venv/bin/activate
python -m pip install -e ./superset-core -e .
python -m pip check
export FLASK_APP=superset
export SUPERSET_HOME="$(mktemp -d)"
export SUPERSET_SECRET_KEY="$(python -c 'import secrets; print(secrets.token_hex(32))')"
python -m flask db upgrade
python -c 'from superset.app import create_app; assert create_app().test_client().get("/health").status_code == 200'

Run the new compatibility workflow and the container regression tests:

PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python -m pytest --noconftest -o addopts= \
  tests/unit_tests/docker_app_dependencies_test.py \
  tests/unit_tests/scripts/docker_release_target_test.py \
  tests/unit_tests/docker_compose_image_tag_test.py -q
bash -n docker/install-app-dependencies.sh

Validation of this replacement commit:

  • All 18 container-related regression tests passed on Python 3.15.2; shell syntax and whitespace checks passed.
  • Pylint passed for the changed backend files, using the repository configuration and a single worker.
  • Pre-commit was run on all staged changes. All applicable hooks passed except MyPy, which reports an unused type: ignore at superset/db_engine_specs/mysql.py:680. The same finding was reproduced on the unchanged original base with the same selection of modified existing files. The new test's MyPy error was corrected before this commit.
  • The complete published diff was checked against the previous branch: substantive content is preserved, apart from the two check corrections described above.

Remaining limits: this is experimental compatibility, not production certification. The complete official image build remains unverified because the reference host ran out of memory during frontend minimization, although the isolated Python 3.15 dependency stage passed. The documented Gunicorn gthread shutdown limitation remains unresolved. The new Netlify preview and PR CI still need to run; /health is liveness, not dependency readiness.

ADDITIONAL INFORMATION

@netlify

netlify Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 6a830c5
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6ae5f5bbcd81fbf347afd017
😎 Deploy Preview https://deploy-preview-45823--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added api Related to the REST API doc Namespace | Anything related to documentation github_actions Pull requests that update GitHub Actions code labels Oct 28, 2026
@codeant-ai-for-open-source

codeant-ai-for-open-source Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

CodeAnt  CodeAnt PR Risk

🟢  Low Risk

  • The PR appears safe to merge; the reviewed datetime-import, pivot-shaping, and boxplot-conversion concerns are fixed in the current code.

Assessed commit: 6a830c53dab6

Comment thread Dockerfile Resolved
Comment thread docker/install-app-dependencies.sh Resolved
Comment thread docker/install-app-dependencies.sh Resolved
Comment thread docs/admin_docs/installation/pypi.mdx Resolved
Comment thread pyproject.toml Resolved
@github-actions github-actions Bot added the i18n Namespace | Anything related to localization label Oct 29, 2026
@luth2
luth2 requested a review from sadpandajoe October 29, 2026 09:22
Comment thread pyproject.toml Resolved
Comment thread superset/models/helpers.py Resolved
Comment thread superset/databases/api.py Resolved
@github-actions github-actions Bot added the requires:rebase Requires rebasing on top of current master label Oct 29, 2026
Comment thread superset/utils/core.py Resolved
Comment thread docs/admin_docs/installation/pypi.mdx Resolved
@github-actions github-actions Bot removed the requires:rebase Requires rebasing on top of current master label Oct 30, 2026
@luth2

luth2 commented Oct 31, 2026

Copy link
Copy Markdown
Author

@sadpandajoe All five latest review findings are fixed in 6b78fdb and their threads have been answered and resolved. I also merged the latest master (1d0fc23) in 7acde2c; GitHub now confirms the branch is up to date and conflict-free.

Post-merge local validation: 630 focused tests passed on Python 3.15/pandas 3.1.0, including temporal imports, joins, date normalization, columnar readers, pandas post-processing, result sets and the static OpenAPI tests. Scoped pre-commit hooks (including MyPy/Ruff and workflow security checks) and the POT drift check pass. Before this master merge, the four modules affected by the latest fixes also passed all 346 tests on each of Python 3.11/pandas 3.0.6 and Python 3.15/pandas 3.1.0.

The remaining merge gates are the required code-owner approval and 24 workflows awaiting maintainer approval. Could a maintainer please approve the CI runs and re-review the updated PR? These local results are not a substitute for the pending hosted CI.

@github-actions github-actions Bot added the requires:rebase Requires rebasing on top of current master label Nov 3, 2026
if pd.api.types.is_datetime64_any_dtype(converted):
df[column_name] = converted
continue
except ValueError:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Wrapping except ValueError around the vectorized pd.to_datetime sends every parse error into the per-row fallback, not just out-of-bounds ones. pandas now infers one format from the first value and raises when a later value doesn't match, so a column like ["01/02/2020", "05/03/2020", "13/02/2020"] used to fail the import with a format mismatch, but now imports as 2020-01-02, 2020-05-03, 2020-02-13: the first two month-first and the third day-first, with no warning since the log only counts out-of-bounds NaTs. Could the fallback be limited to OutOfBoundsDatetime and the "Mixed timezones" case, re-raising other ValueErrors?

# restored all-NaN metric rows are preserved without a dropna= argument.
df = df.stack(level=0).unstack()
if combine_value_with_metric and isinstance(df.columns, pd.MultiIndex):
df = df.reorder_levels([*range(1, df.columns.nlevels), 0], axis=1).sort_index(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This sort_index(axis=1) sorts every column level, whereas the old stack(level=0).unstack() kept the order pivot_table produced. With marginal_distributions=True and combine_value_with_metric=True, a pivot_table result of (m1,AU) (m1,US) (m1,All) (m2,AU) ... used to come back as (AU,m1) (AU,m2) (US,m1) (US,m2) (All,m1) (All,m2) and now comes back as (AU,m1) (AU,m2) (All,m1) (All,m2) (US,m1) (US,m2), so the totals column lands in the middle instead of last. test_pivot_combine_preserves_column_pairs sorts both frames before comparing, so it can't see this. Can the reorder avoid sorting the non-metric levels?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Related to the REST API doc Namespace | Anything related to documentation github_actions Pull requests that update GitHub Actions code i18n Namespace | Anything related to localization requires:rebase Requires rebasing on top of current master size/XXL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants