-
Notifications
You must be signed in to change notification settings - Fork 18
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-18578 : Errors Observed in Tap Failure Dashboard #41
Conversation
"type": [ | ||
"null", | ||
"string", | ||
"integer" |
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.
There is no meaning of putting integer after string so do put integer before the string in priority.
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.
The schema is able to validate the input json irrespective of the order in which these data types are kept.
The integration tests ran fine and I've validated it through online schema validator as well.
So, wanted to confirm if you're suggesting it as a best practice or does it actually impact any given input ?
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.
The issue is that the singer.Transformer
cares about the order.
Here's an example
$ python3
>>> from singer import Transformer
>>> schema = {
... "type": "object",
... "properties": {
... "string-int": {"type": ["null", "string", "integer"]},
... "int-string": {"type": ["null", "integer", "string"]}
... }
... }
>>> records = [
... {"string-int": 1, "int-string": 1},
... {"string-int": "2", "int-string": "2"}
... ]
>>> with Transformer() as tm:
... for record in records:
... print(tm.transform(record, schema))
...
{'string-int': '1', 'int-string': 1}
{'string-int': '2', 'int-string': 2}
Notice that
string-int
is a field that prioritizesstring
int-string
is a field that prioritizesinteger
- The transformer forces
string-int
to be output as a string - The transformer forces
int-string
to be output as an integer
tap_zendesk_chat/schemas/chats.json
Outdated
"$ref": "chat_webpath" | ||
}, | ||
{ | ||
"$ref": "chat_webpath_array" |
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.
Instead of creating 2 separate files, we can also put anyOf inside the chat_webpath file.
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.
Okay, will make this change.
1) Removed chat_webpath_array.json and kept those changes in chat_webpath.json 2) Modified the order for data types, kept integer before string.
Description of change
(write a short description or paste a link to JIRA)
Manual QA steps
Risks
Rollback steps