Skip to content

Commit

Permalink
Backwards-compatible API
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Dec 3, 2024
1 parent 307d4d9 commit edd2d99
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions singer_sdk/connectors/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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:
Expand Down

0 comments on commit edd2d99

Please sign in to comment.