You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "1fanwang (via GitHub)" <gi...@apache.org> on 2026/07/23 21:09:07 UTC
[PR] Strip GlueDataQualityOperator ruleset after rendering [airflow]
1fanwang opened a new pull request, #70331:
URL: https://github.com/apache/airflow/pull/70331
`ruleset` is a template field, so it is rendered after `__init__` runs. The constructor did `self.ruleset = ruleset.strip()`, which strips the un-rendered value. A templated `ruleset` that renders with surrounding whitespace is therefore never stripped, and `validate_inputs()` rejects it because the rendered value no longer ends with `]`:
```
AttributeError: RuleSet must starts with Rules = [ and ends with ]
```
Store `ruleset` verbatim in the constructor and strip the rendered value at the start of `execute()`, before validation.
related: #70296
<details><summary>Testing Done</summary>
Operator-level repro (real Dag, real render, real `execute` with a mocked Glue conn). Before the fix, a templated ruleset rendering to `' Rules = [...] '` reaches `validate_inputs()` unstripped and raises:
```
AttributeError: RuleSet must starts with Rules = [ and ends with ]
```
After the fix, `execute()` strips first and the API receives the clean `'Rules = [...]'`. The new `test_execute_strips_rendered_ruleset` drives that render→execute path; it fails on the pre-fix source and passes after. `TestGlueDataQualityOperator`: 11 passed.
</details>
---
##### Was generative AI tooling used to co-author this PR?
- [ ] Yes (please specify the tool below)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Strip GlueDataQualityOperator ruleset after rendering [airflow]
Posted by "1fanwang (via GitHub)" <gi...@apache.org>.
1fanwang commented on code in PR #70331:
URL: https://github.com/apache/airflow/pull/70331#discussion_r3647221263
##########
providers/amazon/src/airflow/providers/amazon/aws/operators/glue.py:
##########
@@ -449,6 +449,8 @@ def validate_inputs(self) -> None:
raise AttributeError("Target table must have DatabaseName and TableName")
def execute(self, context: Context):
+ # ruleset is a template field; strip the rendered value here, not in __init__.
Review Comment:
Thanks, will do @shahar1
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Strip GlueDataQualityOperator ruleset after rendering [airflow]
Posted by "shahar1 (via GitHub)" <gi...@apache.org>.
shahar1 merged PR #70331:
URL: https://github.com/apache/airflow/pull/70331
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Strip GlueDataQualityOperator ruleset after rendering [airflow]
Posted by "shahar1 (via GitHub)" <gi...@apache.org>.
shahar1 commented on code in PR #70331:
URL: https://github.com/apache/airflow/pull/70331#discussion_r3643768515
##########
providers/amazon/src/airflow/providers/amazon/aws/operators/glue.py:
##########
@@ -449,6 +449,8 @@ def validate_inputs(self) -> None:
raise AttributeError("Target table must have DatabaseName and TableName")
def execute(self, context: Context):
+ # ruleset is a template field; strip the rendered value here, not in __init__.
Review Comment:
@1fanwang for next times - please ask your LLM to avoid adding such commentary :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org