mirror of
https://github.com/apache/superset.git
synced 2026-05-28 11:15:24 +00:00
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>
This commit is contained in:
@@ -326,10 +326,10 @@ class Table:
|
||||
class Partition:
|
||||
"""
|
||||
Partition object, with two attribute keys:
|
||||
ispartitioned_table and partition_comlumn,
|
||||
is_partitioned_table and partition_column,
|
||||
used to provide partition information
|
||||
Here is an example of an object:
|
||||
{"ispartitioned_table":true,"partition_column":["month","day"]}
|
||||
{"is_partitioned_table": true, "partition_column": ["month", "day"]}
|
||||
"""
|
||||
|
||||
is_partitioned_table: bool
|
||||
@@ -337,7 +337,7 @@ class Partition:
|
||||
|
||||
def __str__(self) -> str:
|
||||
"""
|
||||
Return the partition columns of table name.
|
||||
Return a string representation of the Partition object.
|
||||
"""
|
||||
partition_column_str = (
|
||||
", ".join(map(str, self.partition_column))
|
||||
@@ -349,9 +349,6 @@ class Partition:
|
||||
f"partition_column=[{partition_column_str}])"
|
||||
)
|
||||
|
||||
def __eq__(self, other: Any) -> bool:
|
||||
return str(self) == str(other)
|
||||
|
||||
|
||||
# To avoid unnecessary parsing/formatting of queries, the statement has the concept of
|
||||
# an "internal representation", which is the AST of the SQL statement. For most of the
|
||||
|
||||
Reference in New Issue
Block a user