-
Notifications
You must be signed in to change notification settings - Fork 0
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
add read only fields to memory, clean record #23
Conversation
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.
Hey @keyn4 ! Great job! I think we should just add a protection layer for the json.loads but it LGTM :)
target_salesforce_v3/sinks.py
Outdated
@@ -1010,6 +1014,12 @@ def upsert_record(self, record, context): | |||
if "INVALID_FIELD_FOR_INSERT_UPDATE" in str(e): | |||
fields = json.loads(str(e))[0]['fields'] |
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 is too generic in my point of view... If the Exception that arises from the try block is not JSON serializable it will raise a json.JSONDecodeError
. Should we put this section in a try-except block to handle it?
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.
added!
target_salesforce_v3/sinks.py
Outdated
if not self._target.read_only_fields.get(self.stream_name): | ||
self._target.read_only_fields[self.stream_name] = fields | ||
else: | ||
self._target.read_only_fields[self.stream_name].extend(fields) |
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.
if not self._target.read_only_fields.get(self.stream_name): | |
self._target.read_only_fields[self.stream_name] = fields | |
else: | |
self._target.read_only_fields[self.stream_name].extend(fields) | |
if not self._target.read_only_fields.get(self.stream_name): | |
self._target.read_only_fields[self.stream_name] = {} | |
self._target.read_only_fields[self.stream_name].extend(fields) |
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.
Great job!
No description provided.