- Move security check before ODPS partition detection (auth before backend calls)
- Wrap is_odps_partitioned_table in try/except with warning log and fallback
- Replace OdpsBaseEngineSpec.get_table_metadata body with NotImplementedError
- Fix select_star signature: engine: Engine -> dialect: Dialect (matches base)
- Update Optional[X] -> X | None for modern Python typing
- Remove broken __eq__ that violated frozen dataclass hash contract
- Fix Partition docstring typos and __str__ description
- Add warning log when ODPS URI does not match expected pattern
- Add tests/unit_tests/db_engine_specs/test_odps.py with 7 unit tests
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move the `from odps import ODPS` import from module level to inside
the `is_odps_partitioned_table` method where it is used, wrapped in
try/except ImportError. Also move the `OdpsEngineSpec` import in
`databases/api.py` to be lazy. Remove pyodps from base requirements
since it is an optional dependency (like trino, bigquery, etc).
This prevents ModuleNotFoundError when pyodps is not installed, which
was causing all CI tests to fail with "Failed to create app".
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When using the ODPS (MaxCompute) data source, previewing partitioned
tables in SQLLab would fail because ODPS requires a partition to be
specified for partition tables.
This PR adds ODPS-specific handling:
- New OdpsEngineSpec with partition detection support
- Modified select_star to add partition filter for ODPS partition tables
- New Partition dataclass in sql/parse.py
- New is_odps_partitioned_table method in DatabaseDAO
Closes#32301
Co-Authored-By: zhutong6688 <zhutong66@163.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>