diff --git a/singer_sdk/connectors/sql.py b/singer_sdk/connectors/sql.py index 3a4912160..6b3c3788e 100644 --- a/singer_sdk/connectors/sql.py +++ b/singer_sdk/connectors/sql.py @@ -883,9 +883,9 @@ def discover_catalog_entry( table_name: str, is_view: bool, # noqa: FBT001 *, - reflected_columns: list[reflection.ReflectedColumn], - reflected_pk: reflection.ReflectedPrimaryKeyConstraint | None, - reflected_indices: list[reflection.ReflectedIndex], + reflected_columns: list[reflection.ReflectedColumn] | None = None, + reflected_pk: reflection.ReflectedPrimaryKeyConstraint | None = None, + reflected_indices: list[reflection.ReflectedIndex] | None = None, ) -> CatalogEntry: """Create `CatalogEntry` object for the given table or a view. @@ -906,6 +906,10 @@ def discover_catalog_entry( # Initialize unique stream name unique_stream_id = f"{schema_name}-{table_name}" if schema_name else table_name + # Backwards-compatibility + reflected_columns = reflected_columns or [] + reflected_indices = reflected_indices or [] + # Detect key properties possible_primary_keys: list[list[str]] = [] if reflected_pk and "constrained_columns" in reflected_pk: