MeltanoLabs / MeltanoLabs/Singer-Working-Group

Best Practice Target Capability: Data Type Failsafe

Open
#20 0 comments 0 reactions 1 assignee View on GitHub

@aaronsteers is already working on this.

Since Oct 25, 2021.

Dominant language
No language data
Stars
15
Forks
4
PR merge metrics
No merged PRs in 30d

Description

We've run into many, many cases where a specific target receives a JSON schema type that it doesn't expect and then immediately terminates the entire stream.

Rather than failing the sync entirely, we'd like to propose a best practice of always having a failsafe data type which handles two common scenarios:

  1. A catch for parsing exceptions when reading the json schema type. For instance, a $ref or missing properties can cause KeyError during type evaluation. These should be caught and handled with a default type - such as string.
  2. A final else statement at the end of all known cases. Similarly as with the above, if all known cases are evaluated and we've received a type we don't recognize, we should again default to string of similar so that the node's data can still be serialized without terminating the sync.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.