Skip to content

Add check to disable validate_records, add support unsigned number using minLength - #170

Draft
Viet Vu (vietvudanh) wants to merge 6 commits into
shaped-ai:mainfrom
cicdata-io:main
Draft

Add check to disable validate_records, add support unsigned number using minLength#170
Viet Vu (vietvudanh) wants to merge 6 commits into
shaped-ai:mainfrom
cicdata-io:main

Conversation

@vietvudanh

Copy link
Copy Markdown

Meltano SDK has config validate_records to disable records validation. However when it is set to false, self._validator is None, cause the sink flow raise error.

This PR add a simple check to skip running validate when the flag is False.

@vietvudanh
Viet Vu (vietvudanh) marked this pull request as draft June 20, 2024 10:39
Comment thread target_clickhouse/sinks.py Outdated
Comment on lines +180 to +181
if self.validate_schema:
self._validator.validate(record)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to convert this whole try-except block into return super()._validate_and_parse(record)?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, only now I have time look at the parent method, looks identical. I was in rush to fix on prod yesterday so didn't read everything. Thank Edgar Ramírez Mondragón (@edgarrmondragon) for the suggestion.

@vietvudanh Viet Vu (vietvudanh) changed the title Add check to disable validate_records Add check to disable validate_records, add support unsigned number using minLength Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants