potiuk opened a new pull request, #72714:
URL: https://github.com/apache/airflow/pull/72714
The Teradata compute-cluster operators build DDL by interpolating names into
SQL text. Object names cannot be passed as bind parameters, so whatever reaches
them has to be constrained where it is declared.
This example declared every value as a free-text `Param` — no `enum`, no
`pattern`, no validation — and templated them straight into the operators.
Params are settable by whoever triggers the Dag, which is a lower-trust role
than the Dag author, so as written the example teaches a shape where a
triggering user hands SQL fragments to a task running under someone else's
Teradata credentials. Anyone who copies this example inherits that.
### Constrained where they are declared
- `compute_group_name`, `compute_profile_name`, `compute_map` — unquoted
Teradata object-name pattern (`^[A-Za-z][A-Za-z0-9_]{0,127}$`).
- `query_strategy` — `enum` of the two values the operator accepts.
- `timeout` — lower bound.
### No longer Params
- `teradata_conn_id` selects *which credentials the task runs under*. That
is not trigger-time input; it is now a module constant.
- `compute_attribute` is a free-form option string with no safe identifier
shape, so it is a constant too.
The principle the example should be showing: only expose as a `Param` what
you can validate.
### Drive-by
`delete_compute_group` on the decommission task was `bool("{{
params.delete_compute_group }}")`. That evaluates a non-empty string at parse
time, so it was **always `True`** regardless of input — and the Param it
referenced was never declared in the first place. It is now a real boolean
Param defaulting to `False`, rendered natively (the Dag already sets
`render_template_as_native_obj=True`).
Example Dag only; no provider code changes.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_015DKYM5PoVgKC5JqxLso8rn
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]