Skip to content
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

Zavod validate step #673

Merged
merged 37 commits into from
May 20, 2024
Merged

Zavod validate step #673

merged 37 commits into from
May 20, 2024

Conversation

jbothma
Copy link
Contributor

@jbothma jbothma commented Mar 21, 2024

Adds validator interface used in zavod run and zavod validate.

zavod run skips validation for collections.

Both commands exit with non-zero status if an aborting validator triggers abort.

@jbothma jbothma marked this pull request as draft March 21, 2024 13:44
zavod/setup.py Outdated Show resolved Hide resolved
@jbothma jbothma changed the title Zavod verify Zavod validate step Mar 25, 2024

from zavod.entity import Entity
from zavod.meta.assertion import Assertion, Comparison, Metric
from zavod.exporters.statistics import Statistics
Copy link
Contributor Author

@jbothma jbothma Mar 27, 2024

Choose a reason for hiding this comment

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

this feels a tad icky, but rather than move the Statistics object somewhere more general, I think once we want more fancy assertions, we'll build a dedicated aggregator and leave the exporter alone.

Copy link
Member

Choose a reason for hiding this comment

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

no I like this a lot. Let's split it up early. The stats is part of our exposed interface so separating them makes a ton of sense to get ease of change for the validator.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you mean I should implement statistics for the validator now, or use it as implemented here until we want a more powerful validator?

In this PR to see a dataset change in cI
@jbothma jbothma marked this pull request as ready for review March 27, 2024 13:06
Copy link
Member

@pudo pudo left a comment

Choose a reason for hiding this comment

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

I'm very excited about how this is implemented, just wonder if we should have more clearly defined notions of how we'd abort a botched validation. Throwing a RuntimeException works, but it's not the most elegant thing we could do :)

zavod/zavod/cli.py Outdated Show resolved Hide resolved
zavod/zavod/validators/__init__.py Show resolved Hide resolved
zavod/zavod/validators/__init__.py Outdated Show resolved Hide resolved
zavod/zavod/validators/assertions.py Outdated Show resolved Hide resolved
Copy link
Member

@pudo pudo left a comment

Choose a reason for hiding this comment

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

Looks good to me, unless you want to do the Statistics fork now?

One thought: do we want to validate collections, too? Or just sources? Just in terms if how actionable the warnings are - it's all in the sources, no?

@jbothma
Copy link
Contributor Author

jbothma commented May 20, 2024

oh yes definitely makes sense not to run this on collections, so we can keep publishing even when one source is misbehaving. I fix.

@jbothma jbothma merged commit 2421725 into main May 20, 2024
12 checks passed
@jbothma jbothma deleted the zavod-verify branch May 20, 2024 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants