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

Feat!: add RuntimeStage.TESTING #2557

Merged
merged 3 commits into from
May 2, 2024
Merged

Conversation

georgesittas
Copy link
Contributor

@georgesittas georgesittas commented May 2, 2024

Prior to this change, there was no straightforward way to detect when a model was being evaluated in the context of a unit test. This PR makes it possible by augmenting the RuntimeStage enum with a TESTING value.

The primary reason for adding this is so that users can alter the behavior of certain macros that they don't want to run during unit test execution, eg. because they have side effects that they want to trigger only for actual DAG evaluations.

The runtime_stage value is currently set to LOADING (default) during a unit test run. This means that setting it to the new TESTING value will effectively change the behavior of macros and models whose logic depends on whether the runtime_stage value is LOADING, but only in the context of unit tests.

I think this should generally be ok, but I've marked the PR as breaking just to be safe.

@georgesittas georgesittas requested a review from a team May 2, 2024 23:14
@georgesittas georgesittas enabled auto-merge (squash) May 2, 2024 23:30
@georgesittas georgesittas merged commit adcd016 into main May 2, 2024
14 checks passed
@georgesittas georgesittas deleted the jo/testing_runtime_stage branch May 2, 2024 23:36
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