-
Notifications
You must be signed in to change notification settings - Fork 19
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
TDL-22606 fix none replication_value records sync #122
Conversation
tap_pendo/streams.py
Outdated
if isinstance(self, Accounts): | ||
return record['metadata']['auto']['lastupdated'] | ||
|
||
decamalized_replication_key = humps.decamelize(self.replication_key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in "decamalized" should be "decamelized..."
tap_pendo/streams.py
Outdated
return record['metadata']['auto']['lastupdated'] | ||
|
||
decamalized_replication_key = humps.decamelize(self.replication_key) | ||
return record.get(decamalized_replication_key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in "decamalized" should be "decamelized..."
tap_pendo/streams.py
Outdated
@@ -549,20 +550,41 @@ def set_request_body_filters(self, body, start_time, records=None): | |||
|
|||
return body | |||
|
|||
def get_replication_value(self, record): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should rename this to be a little more concise, eg get_replication_key_value
tap_pendo/streams.py
Outdated
@@ -549,20 +550,41 @@ def set_request_body_filters(self, body, start_time, records=None): | |||
|
|||
return body | |||
|
|||
def get_replication_value(self, record): | |||
"""Return the replication value of """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like an incomplete thought; was there more to this docstring?
tap_pendo/streams.py
Outdated
@@ -149,6 +149,7 @@ class Stream(): | |||
def __init__(self, config=None): | |||
self.config = config | |||
self.record_limit = self.get_default_record_limit() | |||
self.none_replication_value_records = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can rename this to make it slightly clearer; something like empty_replication_key_records' or
empty_rk_records' if we want to shorten it
tap_pendo/streams.py
Outdated
decamalized_replication_key = humps.decamelize(self.replication_key) | ||
return record.get(decamalized_replication_key) | ||
|
||
def remove_none_replication_value_records(self, records): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should rename this to align with the change requested above for line 152. something like remove_empty_rk_records
@dsprayberry fixed the comments, please re-review. |
92d4e4f
to
7a62090
Compare
Description of change
Fix TypeError observed while syncing accounts records (TDL-22606)
There were two scenarios which could cause TypeError which we fixed,
Also, refactored code to avoid duplication code and have generic implementation.
Manual QA steps
record_limit
value.Risks
Rollback steps