github-actions[bot] opened a new pull request, #75121: URL: https://github.com/apache/airflow/pull/75121
* Pass runtime values to example Dag shell commands through env Several example Dags built their shell command text out of values that are only known at run time: another task's output, or a Dag param rendered through Jinja. Users copy example Dags into real deployments, so the pattern they show is the pattern that ships. Keep the command text constant and hand the value to the command through ``env`` instead, so the shell never parses it as part of the command. Add a ``check-example-dag-shell-commands`` prek hook that flags a ``bash_command`` (or a ``@task.bash`` return value) built with an f-string, ``str.format``, ``%`` or ``+`` from a runtime value, or with a Jinja expression rendering ``xcom_pull``, ``params`` or ``dag_run.conf`` into the command text. Generated-by: Claude Opus 5 * Pass file_count to the bash decorator example as a string The decorator example hands the describe_dag_folder XComs straight to env, and a value that json.loads turned into an int makes the subprocess fail before the command runs. The BashOperator example is unaffected because its Jinja templates always render to strings. Generated-by: Claude Opus 5 * Align the example Dag shell-command hook with the other prek scripts Python 3.10 support is gone and the other prek scripts pin 3.11, so the 3.10 pin made prek provision an extra interpreter just for this hook. The prose also follows the project's "Dag" spelling. (cherry picked from commit 486f8368e2119c20a34943f59f80eefaf7bd1b33) Co-authored-by: Jarek Potiuk <[email protected]> Generated-by: Claude Opus 5 -- 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]
