Commit Graph

14 Commits

Author SHA1 Message Date
Claude Code
925e20bb04 fix(odps): address review feedback - security, recursion, typing, tests
- 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>
2026-03-11 14:00:48 -07:00
Evan Rusackas
23b8d323a3 fix(odps): make pyodps import lazy to prevent CI failures
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>
2026-03-11 13:56:05 -07:00
Evan Rusackas
a1bf361fe2 fix: ODPS (MaxCompute) data source table preview failed
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>
2026-03-11 13:55:33 -07:00
Amin Ghadersohi
c54b21ef98 fix(mcp): add eager loading to get_info tools to prevent N+1 query timeouts (#38129)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 17:28:58 +01:00
Beto Dealmeida
c458f99dd4 chore: cleanup ssh tunnel (#34388) 2025-12-03 14:26:35 -05:00
Beto Dealmeida
8695239372 feat: OAuth2StoreTokenCommand (#32546) 2025-03-13 09:45:24 -04:00
Maxime Beauchemin
e51b95ffa8 chore: enforce more ruff rules (#31447)
Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>
2024-12-18 17:41:34 -08:00
John Bodley
8fb8199a55 chore(dao/command): Add transaction decorator to try to enforce "unit of work" (#24969) 2024-06-28 12:33:56 -07:00
Beto Dealmeida
38e2843b24 chore: clean up DB create command (#28246) 2024-05-01 11:06:26 -04:00
Beto Dealmeida
9022f5c519 feat(SIP-85): OAuth2 for databases (#27631) 2024-04-02 22:05:33 -04:00
John Bodley
ed0d288ccd chore(dao): Replace save/overwrite with create/update respectively (#24467) 2023-08-11 12:55:39 -07:00
EugeneTorap
fc89718d48 chore: Update pylint to 2.17.4 (#24700)
Co-authored-by: John Bodley <john.bodley@gmail.com>
2023-07-24 17:13:49 -07:00
John Bodley
92e2ee9d07 chore(dao): Add generic type for better type checking (#24465) 2023-06-21 09:30:07 -07:00
John Bodley
3e76736874 chore(dao): Organize DAOs according to SIP-92 (#24331)
Co-authored-by: JUST.in DO IT <justin.park@airbnb.com>
2023-06-18 18:32:32 -07:00