Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

table-key-properties should be a list #68

Merged
merged 1 commit into from
Nov 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tap_marketo/discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/test_discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'}},
{
Expand Down
4 changes: 2 additions & 2 deletions tests/test_startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'}},
Expand Down Expand Up @@ -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'}},
Expand Down