diff --git a/singer_sdk/_singerlib/catalog.py b/singer_sdk/_singerlib/catalog.py index 89dd789c5..51954e0e7 100644 --- a/singer_sdk/_singerlib/catalog.py +++ b/singer_sdk/_singerlib/catalog.py @@ -194,6 +194,8 @@ def get_standard_metadata( for field_name in schema.get("properties", {}).keys(): if key_properties and field_name in key_properties: entry = Metadata(inclusion=Metadata.InclusionType.AUTOMATIC) + elif valid_replication_keys and field_name in valid_replication_keys: + entry = Metadata(inclusion=Metadata.InclusionType.AUTOMATIC) else: entry = Metadata(inclusion=Metadata.InclusionType.AVAILABLE) diff --git a/tests/_singerlib/test_catalog.py b/tests/_singerlib/test_catalog.py index 7c1fc04d7..c589d1836 100644 --- a/tests/_singerlib/test_catalog.py +++ b/tests/_singerlib/test_catalog.py @@ -207,6 +207,7 @@ def test_catalog_parsing(): "properties": { "first_name": {"type": "string"}, "last_name": {"type": "string"}, + "updated_at": {"type": "string", "format": "date-time"}, }, "type": "object", }, @@ -265,3 +266,8 @@ def test_standard_metadata( pk_metadata = metadata[("properties", pk)] assert pk_metadata.inclusion == Metadata.InclusionType.AUTOMATIC assert pk_metadata.selected is None + + for rk in valid_replication_keys or []: + rk_metadata = metadata[("properties", rk)] + assert rk_metadata.inclusion == Metadata.InclusionType.AUTOMATIC + assert rk_metadata.selected is None