Skip to content

Conversation

@dganesh05
Copy link

  • Updated setuptools version in pyproject.toml to 68.2.2.
  • Updated numpy version in pyproject.toml to >=1.26.0.
  • Added support for Python 3.12 in various GitHub workflows.
  • Modified database query execution to use engine.connect() instead of pd.read_sql_query.
  • Updated .gitignore to include .venv312 and .cursor directories.
  • Added peerDependencies for eslint in package-lock.json.

feat(python): add Python 3.12 support

SUMMARY

This PR adds official support for Python 3.12 to Apache Superset. The changes ensure compatibility with Python 3.12 while maintaining backward compatibility with Python 3.10 and 3.11.

Key changes:

  1. Dependency updates: Updated setuptools to 68.2.2 and numpy to >=1.26.0 to ensure Python 3.12 compatibility
  2. Python classifier: Added "Programming Language :: Python :: 3.12" to pyproject.toml classifiers
  3. CI/CD integration: Updated GitHub Actions workflows to include Python 3.12 in the test matrix:
    • superset-python-unittest.yml: Added "next" (maps to Python 3.12) to the test matrix
    • pre-commit.yml: Already includes "next" in the matrix
    • setup-backend/action.yml: Maps "next" to Python 3.12
  4. Pandas API modernization: Replaced deprecated pd.read_sql_query() calls with engine.connect() context manager pattern in:
    • superset/models/helpers.py
    • superset/connectors/sqla/models.py
  5. Development environment: Updated .gitignore to exclude Python 3.12 virtual environment (.venv312) and .cursor directory

Rationale:

  • Python 3.12 is the latest stable release and provides performance improvements and new features
  • The pandas API changes ensure compatibility with future pandas versions that may deprecate read_sql_query()
  • Using engine.connect() is the recommended SQLAlchemy pattern and provides better resource management

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A - This is a backend compatibility change with no UI impact.

TESTING INSTRUCTIONS

  1. Create a Python 3.12 virtual environment:

    python3.12 -m venv .venv312
    source .venv312/bin/activate
  2. Install Superset:

    pip install -r requirements/base.txt
    pip install -e .
  3. Run the comprehensive test script:

    bash comprehensive_test.sh
  4. Verify all tests pass:

    • All acceptance criteria should pass (9/9)
    • No dependency conflicts (pip check should pass)
    • Unit tests should run successfully on Python 3.12
  5. Manual verification:

    • Start Superset: superset run -p 8088
    • Verify the application starts without errors
    • Create a chart that queries a database
    • Verify the chart renders successfully without pandas-related errors
  6. CI/CD verification:

    • Check that GitHub Actions workflows run successfully with Python 3.12
    • Verify the "next" Python version in the test matrix maps to 3.12

ADDITIONAL INFORMATION

dganesh05 added 2 commits December 1, 2025 01:16
- Updated setuptools version in pyproject.toml to 68.2.2.
- Updated numpy version in pyproject.toml to >=1.26.0.
- Added support for Python 3.12 in various GitHub workflows.
- Modified database query execution to use `engine.connect()` instead of `pd.read_sql_query`.
- Updated .gitignore to include .venv312 and .cursor directories.
- Added peerDependencies for eslint in package-lock.json.
- Introduced a new script `comprehensive_test.sh` to validate acceptance criteria for Python 3.12 compatibility.
- The script checks for Python 3.12 in `pyproject.toml`, verifies dependency compatibility, and ensures no deprecated API usage.
- Includes checks for CI/CD workflows and runs a sample of unit tests to confirm functionality with Python 3.12.
- Provides a summary of test results and manual testing checklist items.
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.

Issue #6 - Table Chart "Sort Descending" control appears when no sort metric is selected and has a confusing UI location

1 participant