Fix templated validation in Azure operators - #70322
Open
Revanth14 wants to merge 2 commits into
Open
Conversation
Revanth14
requested review from
amoghrajesh,
ashb,
bugraoz93,
gopidesupavan,
jason810496,
jscheffl and
potiuk
as code owners
July 23, 2026 19:12
Contributor
Author
|
@shahar1 This is for Azure Operators |
shahar1
requested changes
Jul 24, 2026
shahar1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for your contribution!
Please add gen-AI disclosure section to the PR body.
Also, a minor comment.
| assert sensor.azure_conn_id == CONN_ID | ||
|
|
||
| def test_init_invalid_target_state(self): | ||
| def test_invalid_templated_target_state_is_validated_after_rendering(self): |
Contributor
There was a problem hiding this comment.
Only the rejection path is tested; the behaviour the PR restores (valid templated value surviving to execution) is untested.
shahar1
reviewed
Jul 27, 2026
Comment on lines
70
to
-76
| super().__init__(**kwargs) | ||
| if sql_params is None: | ||
| sql_params = {} | ||
| self.filename = filename | ||
| self.oracle_conn_id = oracle_conn_id | ||
| self.sql = sql | ||
| self.sql_params = sql_params |
Contributor
There was a problem hiding this comment.
Please restore the changes here (see #70505 for details)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves template-field-dependent logic out of
__init__for three Microsoft Azure provider classes, so it runs against Jinja-rendered values rather than the raw{{ ... }}templates that__init__sees before rendering:AzureVirtualMachineStateSensornow validates the renderedtarget_stateduring execution.GCSToAzureBlobStorageOperatornow checks renderedmatch_globcompatibility during execution.OracleToAzureDataLakeOperatornow uses a value-preserving default assignment forsql_params.As a result, validation for the sensor and the GCS-to-WASB operator now surfaces at task-execution time rather than at DAG-parse time an intentional consequence of not touching template fields before they are rendered.
The corresponding entries were removed from
validate_operators_init_exemptions.txt.Regression tests render actual Jinja expressions before execution.
Related: #70296
Testing
console uv run --project providers/microsoft/azure pytest \ providers/microsoft/azure/tests/unit/microsoft/azure/sensors/test_compute.py \ providers/microsoft/azure/tests/unit/microsoft/azure/transfers/test_gcs_to_wasb.py \ providers/microsoft/azure/tests/unit/microsoft/azure/transfers/test_oracle_to_azure_data_lake.py \ -xvs