Validating Data Schema Before Passing to Destination in Python Connector Code

Summary

In the source-amazon-seller-partner connector code (Python), the user wants to validate the data schema before passing it to the destination. They are specifically looking to ensure that the read data fits the schema defined in the connector for the get_vendor_sales_report stream. The user is considering using the jsonschema validate function but is seeking advice on the best approach or if there are existing functions or examples available.


Question

Hello everyone! In source-amazon-seller-partner connector code (Python) I wanted to make a small change that before passing data to the destination checks if the read data fits the schema (properties in stream describing jsonfile).

I wanted to do this because there is a problem in the schema of read data and schema written in the connector for stream: get_vendor_sales_report (format of date vs date-time fields) and instead of trial and error on migration process I wanted to have a programatic way of saying that what we collect from source 100% fits the schema if that is easy do implement.

I was thinking of using jsonschema validate function. But perhaps there is a better way of doing this. Does anyone know how to do this best, perhaps there is an existing built in function that can be used or there is an existing example of how this can be done?



This topic has been created from a Slack thread to give it more visibility.
It will be on Read-Only mode here. Click here if you want
to access the original thread.

Join the conversation on Slack

["source-amazon-seller-partner", "python-connector", "data-schema", "jsonschema", "validate", "get_vendor_sales_report"]