-
Notifications
You must be signed in to change notification settings - Fork 188
Add --disable-assertions option to skip all assertions during compilation and execution #2024
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
base: main
Are you sure you want to change the base?
Add --disable-assertions option to skip all assertions during compilation and execution #2024
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
…tion and execution
09047c6
to
b9ff7c3
Compare
…nstead of excluding them
/gcbrun |
/gcbrun |
/gcbrun |
{ | ||
statement: | ||
"create or replace table `dataform-open-source.dataform.example` as \n\nselect 1 as testValue2", | ||
`create or replace table \`${DEFAULT_DATABASE}.dataform.example\` as \n\nselect 1 as testValue2`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kolina
Apologies for the oversight. I’ve fixed it.
fix linter error for SQL injection
Fixes: #1984
Solution
This PR introduces a new
--disable-assertions
command-line flag that allows users to completely disable all assertions during compilation and execution. This includes both manual assertions (defined withtype: "assertion"
) and built-in inline assertions (uniqueKey
,nonNull
, androwConditions
).Key Implementation Details:
CLI Flag: Added
--disable-assertions
option to bothcompile
andrun
commands with the description: "Disables all assertions including built-in assertions (uniqueKey, nonNull, rowConditions) and manual assertions (type: assertion)."Core Integration: The flag is passed through the compilation pipeline:
ProjectConfigOptions.disableAssertions
→ProjectConfig.disableAssertions
→Session.projectConfig.disableAssertions
Assertion Disabling Logic: When disableAssertions is true, all assertions (both manual and inline) are automatically marked as
disabled: true
during their construction phase.Test
Verify that
bazel test //core/...
passesEnsure
./scripts/lint
passesTest the complete workflow by running both
./scripts/run compile --disable-assertions
and./scripts/run run --disable-assertions --dry-run
on a personal project, confirming that:type: "assertion"
) are properly disableduniqueKey
,nonNull
,rowConditions
) are properly disabled