2024-06-20 16:54:12 +02:00
|
|
|
"""Models for the TableDiff test case"""
|
2024-07-02 12:36:03 +02:00
|
|
|
|
2025-06-27 07:58:48 +02:00
|
|
|
from typing import List, Optional, Union
|
2024-06-20 16:54:12 +02:00
|
|
|
|
2025-10-08 09:32:00 +02:00
|
|
|
from pydantic import BaseModel, Field
|
2024-06-20 16:54:12 +02:00
|
|
|
|
2025-08-19 06:40:49 +02:00
|
|
|
from metadata.generated.schema.entity.data.table import (
|
|
|
|
Column,
|
|
|
|
Table,
|
|
|
|
TableProfilerConfig,
|
|
|
|
)
|
2024-11-11 10:07:23 +01:00
|
|
|
from metadata.generated.schema.entity.services.databaseService import (
|
2025-08-19 06:40:49 +02:00
|
|
|
DatabaseConnection,
|
2024-11-11 10:07:23 +01:00
|
|
|
DatabaseServiceType,
|
|
|
|
)
|
2025-04-23 12:15:42 +02:00
|
|
|
from metadata.ingestion.models.custom_pydantic import CustomSecretStr
|
2024-07-02 12:36:03 +02:00
|
|
|
|
|
|
|
|
|
|
|
class TableParameter(BaseModel):
|
2025-06-27 07:58:48 +02:00
|
|
|
serviceUrl: Union[str, dict]
|
2024-07-02 12:36:03 +02:00
|
|
|
path: str
|
|
|
|
columns: List[Column]
|
2024-11-11 10:07:23 +01:00
|
|
|
database_service_type: DatabaseServiceType
|
2025-04-23 12:15:42 +02:00
|
|
|
privateKey: Optional[CustomSecretStr]
|
|
|
|
passPhrase: Optional[CustomSecretStr]
|
2025-10-08 09:32:00 +02:00
|
|
|
key_columns: Optional[list[str]] = None
|
|
|
|
extra_columns: Optional[list[str]] = None
|
2024-07-02 12:36:03 +02:00
|
|
|
|
2024-06-20 16:54:12 +02:00
|
|
|
|
|
|
|
class TableDiffRuntimeParameters(BaseModel):
|
2024-07-02 12:36:03 +02:00
|
|
|
table1: TableParameter
|
|
|
|
table2: TableParameter
|
2025-10-08 09:32:00 +02:00
|
|
|
keyColumns: Optional[List[str]] = Field(
|
|
|
|
..., deprecated="Please use `tableX.key_columns` instead"
|
|
|
|
)
|
|
|
|
extraColumns: Optional[List[str]] = Field(
|
|
|
|
..., deprecated="Please use `tableX.extra_columns` instead"
|
|
|
|
)
|
2024-06-20 16:54:12 +02:00
|
|
|
whereClause: Optional[str]
|
2024-11-11 10:07:23 +01:00
|
|
|
table_profile_config: Optional[TableProfilerConfig]
|
2025-08-19 06:40:49 +02:00
|
|
|
|
|
|
|
|
|
|
|
class TableCustomSQLQueryRuntimeParameters(BaseModel):
|
|
|
|
conn_config: DatabaseConnection
|
|
|
|
entity: Table
|