Skip to content

feat: add .preOps() and .postOps() support to Assertion action#2169

Closed
rafal-hawrylak wants to merge 1 commit into
mainfrom
pre_and_post_ops_in_assertions
Closed

feat: add .preOps() and .postOps() support to Assertion action#2169
rafal-hawrylak wants to merge 1 commit into
mainfrom
pre_and_post_ops_in_assertions

Conversation

@rafal-hawrylak
Copy link
Copy Markdown
Collaborator

This update brings the Assertion action on par with Table and View by introducing support for pre-operations and post-operations.

  • Updated dataform.proto (via core.proto and configs.proto) to include pre_ops/post_ops for Assertion and pre_operations/ post_operations for AssertionConfig.
  • Enhanced core/actions/assertion.ts with contextablePreOps and contextablePostOps arrays.
  • Exposed .preOps() and .postOps() methods on both Assertion builder and AssertionContext.
  • Added test coverage in core/main_test.ts to ensure operations are compiled correctly for assertions.

This update brings the Assertion action on par with Table and View by introducing support for pre-operations and post-operations.

- Updated `dataform.proto` (via `core.proto` and `configs.proto`) to include `pre_ops`/`post_ops` for `Assertion` and `pre_operations`/ `post_operations` for `AssertionConfig`.
- Enhanced `core/actions/assertion.ts` with `contextablePreOps` and `contextablePostOps` arrays.
- Exposed `.preOps()` and `.postOps()` methods on both `Assertion` builder and `AssertionContext`.
- Added test coverage in `core/main_test.ts` to ensure operations are compiled correctly for assertions.
@rafal-hawrylak rafal-hawrylak requested a review from a team as a code owner May 21, 2026 09:31
@rafal-hawrylak rafal-hawrylak requested review from andrzej-grudzien, apilaskowski, fafsdafsafs and ikholopov-omni and removed request for a team May 21, 2026 09:31
@kolina
Copy link
Copy Markdown
Contributor

kolina commented May 21, 2026

Assertions work in a way that query fails in case of a failed assertion condition. So not sure how post_ops will work in these cases.

@rafal-hawrylak
Copy link
Copy Markdown
Collaborator Author

Assertions work in a way that query fails in case of a failed assertion condition. So not sure how post_ops will work in these cases.

Right, that is not the thing we need.

@rafal-hawrylak
Copy link
Copy Markdown
Collaborator Author

Not needed

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.

2 participants