Skip to content

Commit 74240ab

Browse files
docs(sql): Clarify that get_primary_keys returns column names, not values
- Updated docstring to specify 'primary key column names' instead of just 'primary keys' - Added Returns section explaining the method returns column names or None - Addresses @dbgold17's clarifying question about terminology in GitHub comment Co-Authored-By: AJ Steers <[email protected]>
1 parent 8d1ecae commit 74240ab

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

airbyte_cdk/sql/shared/catalog_providers.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,14 @@ def get_primary_keys(
120120
self,
121121
stream_name: str,
122122
) -> list[str] | None:
123-
"""Return the primary keys for the given stream.
123+
"""Return the primary key column names for the given stream.
124124
125125
We return `source_defined_primary_key` if set, or `primary_key` otherwise. If both are set,
126126
we assume they should not should differ, since Airbyte data integrity constraints do not
127127
permit overruling a source's pre-defined primary keys. If neither is set, we return `None`.
128+
129+
Returns:
130+
A list of column names that constitute the primary key, or None if no primary key is defined.
128131
"""
129132
configured_stream = self.get_configured_stream_info(stream_name)
130133
pks = configured_stream.stream.source_defined_primary_key or configured_stream.primary_key

0 commit comments

Comments
 (0)