Skip to content

Commit

Permalink
Merge pull request #8 from singer-io/fix-automatic-inclusion
Browse files Browse the repository at this point in the history
Use the instances key_properties instead of the constant
  • Loading branch information
KAllan357 authored May 17, 2018
2 parents 46e2930 + a0f3866 commit 9b1e960
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tap_zendesk/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,12 @@ def load_metadata(self):

mdata = metadata.write(mdata, (), 'table-key-properties', self.key_properties)
mdata = metadata.write(mdata, (), 'forced-replication-method', self.replication_method)
mdata = metadata.write(mdata, (), 'valid-replication-keys', [self.replication_key])

if self.replication_key:
mdata = metadata.write(mdata, (), 'valid-replication-keys', [self.replication_key])

for field_name in schema['properties'].keys():
if field_name in KEY_PROPERTIES or field_name == self.replication_key:
if field_name in self.key_properties or field_name == self.replication_key:
mdata = metadata.write(mdata, ('properties', field_name), 'inclusion', 'automatic')
else:
mdata = metadata.write(mdata, ('properties', field_name), 'inclusion', 'available')
Expand Down

0 comments on commit 9b1e960

Please sign in to comment.