From 09008452677253799e3998fe5d4cd51fcc973658 Mon Sep 17 00:00:00 2001 From: Kyle Allan Date: Wed, 4 Nov 2020 14:29:36 +0000 Subject: [PATCH] table-key-properties should be a list --- tap_marketo/discover.py | 6 +++--- tests/test_discover.py | 2 +- tests/test_startup.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tap_marketo/discover.py b/tap_marketo/discover.py index 2f77e4e..e4fedf7 100644 --- a/tap_marketo/discover.py +++ b/tap_marketo/discover.py @@ -112,7 +112,7 @@ def get_activity_type_stream(activity): tap_stream_id = "activities_{}".format(activity_type_camel) # The activities steams use "marketoGUID" as the key_properties - mdata = metadata.write(mdata, (), 'table-key-properties', 'marketoGUID') + mdata = metadata.write(mdata, (), 'table-key-properties', ['marketoGUID']) return { "tap_stream_id": tap_stream_id, @@ -160,7 +160,7 @@ def discover_leads(client): properties[field_name] = field_schema # The leads steam uses "id" as the key_properties - mdata = metadata.write(mdata, (), 'table-key-properties', 'id') + mdata = metadata.write(mdata, (), 'table-key-properties', ['id']) return { "tap_stream_id": "leads", @@ -197,7 +197,7 @@ def discover_catalog(name, automatic_inclusion, **kwargs): mdata = metadata.write(mdata, (), 'inclusion', 'automatic') # The steams using discover_catalog all use "id" as the key_properties - mdata = metadata.write(mdata, (), 'table-key-properties', 'id') + mdata = metadata.write(mdata, (), 'table-key-properties', ['id']) discovered_schema["metadata"] = metadata.to_list(mdata) return discovered_schema diff --git a/tests/test_discover.py b/tests/test_discover.py index 29d1b64..e09f1e0 100644 --- a/tests/test_discover.py +++ b/tests/test_discover.py @@ -35,7 +35,7 @@ def test_get_activity_type_stream(self): "key_properties": ["marketoGUID"], "metadata" : [ {'breadcrumb': (), - 'metadata': {'table-key-properties': 'marketoGUID', + 'metadata': {'table-key-properties': ['marketoGUID'], 'marketo.activity-id': 1, 'marketo.primary-attribute-name': 'webpage_id'}}, { diff --git a/tests/test_startup.py b/tests/test_startup.py index de1c105..9cee48f 100644 --- a/tests/test_startup.py +++ b/tests/test_startup.py @@ -17,7 +17,7 @@ def test_validate_state(self): "key_properties": ["marketoGUID"], "metadata" : [ {'breadcrumb': [], - 'metadata': {'table-key-properties': 'marketoGUID', + 'metadata': {'table-key-properties': ['marketoGUID'], 'marketo.activity-id': 1, 'selected' : True, 'marketo.primary-attribute-name': 'webpage_id'}}, @@ -117,7 +117,7 @@ def test_validate_state(self): "key_properties": ["marketoGUID"], "metadata" : [ {'breadcrumb': [], - 'metadata': {'table-key-properties': 'id', + 'metadata': {'table-key-properties': ['id'], 'marketo.activity-id': 1, 'selected' : False, 'marketo.primary-attribute-name': 'webpage_id'}},