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

Document standalone audits #3670

Open
MikeWallis42 opened this issue Jan 21, 2025 · 1 comment
Open

Document standalone audits #3670

MikeWallis42 opened this issue Jan 21, 2025 · 1 comment
Labels
Documentation Improvements or additions to documentation

Comments

@MikeWallis42
Copy link
Contributor

As part of this issue I raised #3665 I discovered this functionality within sqlmesh isn't covered in the documentation.

@MikeWallis42
Copy link
Contributor Author

So far I plan to add this to docs/concepts/audits.md but could someone perhaps clarify for me if they are run as part of sqlmesh run/plan? Or are they only run with sqlmesh audit?
Also how are they scheduled? Do they end up with a default cron of @daily as it's not configurable?

Standalone Audits

It is also possible to configure audits to be standalone, these audits are not run after any model specifically.

AUDIT (
  name assert_item_price_is_not_null,
  dialect spark,
  standalone TRUE,
  depends_on (
    sushi.items
  )
);
SELECT * from sushi.items
WHERE
  ds BETWEEN @start_ds AND @end_ds
  AND price IS NULL;

Standalone audits cannot be blocking, only non-blocking as sqlmesh will not know which model should be blocked.

@georgesittas georgesittas added the Documentation Improvements or additions to documentation label Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants