-
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
HGI-6418 Create data validation for the three required information #22
Conversation
target_salesforce_v3/sinks.py
Outdated
f'StageName (pipeline_stage_id: {record.get("pipeline_stage_id")} or status: {record.get("status")}), ' | ||
f'CloseDate (close_date: {has_close_date})' | ||
) | ||
except Exception as exc: |
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 it would be better to put the try except on all the preprocess_record
logic, because if any case that we didn't consider fails it will stop the job and the state won't be generated.
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.
Done!
target_salesforce_v3/sinks.py
Outdated
@@ -391,23 +391,39 @@ class DealsSink(SalesforceV3Sink): | |||
def reference_data(self): | |||
params = {"q": "SELECT id, name from Account"} | |||
response = self.request_api("GET", endpoint="query", params=params) | |||
response = response.json()["records"] | |||
response = response.json().get("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.
if records is not present I think it should default to a list so next line doesn't fail.
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.
Done!
49e174b
to
73ce384
Compare
73ce384
to
23e8082
Compare
Included data validation for the three required fields:
Name
StageName
CloseDate
If the data is not present a message is included in
target_state.json