Skip to content

Commit 07de856

Browse files
docs(sql): Expand docstring for get_primary_keys to explain fallback behavior
- Add explanation that method uses primary_key if set explicitly in configured catalog - Otherwise falls back to source_defined_primary_key if set - Addresses GitHub comment from @aaronsteers Co-Authored-By: AJ Steers <[email protected]>
1 parent 565aa64 commit 07de856

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

airbyte_cdk/sql/shared/catalog_providers.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,11 @@ def get_primary_keys(
120120
self,
121121
stream_name: str,
122122
) -> list[str]:
123-
"""Return the primary keys for the given stream."""
123+
"""Return the primary keys for the given stream.
124+
125+
We will use `primary_key` if it is set explicitly in the configured catalog,
126+
otherwise we will fall back to `source_defined_primary_key`, if set.
127+
"""
124128
configured_stream = self.get_configured_stream_info(stream_name)
125129
pks = (
126130
configured_stream.primary_key

0 commit comments

Comments
 (0)