Skip to content

Add redis_conn_id to RedisPublishOperator template_fields - #72883

Merged
vincbeck merged 2 commits into
apache:mainfrom
keemgdeok:add-redis-conn-id-template-field
Sep 10, 2026
Merged

vincbeck merged 2 commits into
apache:mainfrom
keemgdeok:add-redis-conn-id-template-field

Conversation

@keemgdeok

@keemgdeok keemgdeok commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

RedisPublishOperator currently does not include redis_conn_id in
template_fields, so Jinja templates used for Redis connection IDs are not
rendered.

This PR adds redis_conn_id to RedisPublishOperator.template_fields and marks
it as templated in the operator documentation.

related: #35259


Was generative AI tooling used to co-author this PR?
  • Yes — Codex (GPT-6 and GPT-5)

Generated-by: Codex (GPT-6 and GPT-5) following the guidelines


Drafted-by: Codex (GPT-6 and GPT-5) (no human review before posting)

@boring-cyborg

boring-cyborg Bot commented Sep 10, 2026

Copy link
Copy Markdown

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our prek-hooks will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example Dag that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: [email protected]
    Slack: https://s.apache.org/airflow-slack

@keemgdeok
keemgdeok force-pushed the add-redis-conn-id-template-field branch from 3351a73 to 15eb0af Compare September 10, 2026 13:29
@vincbeck
vincbeck merged commit b4744b1 into apache:main Sep 10, 2026
79 checks passed
vincbeck pushed a commit that referenced this pull request Sep 14, 2026
…elds (#73018)

Both sensors take `redis_conn_id` and use it to build the hook, but neither lists
it in `template_fields`, so a Jinja expression passed as the connection id is
never rendered and reaches `RedisHook` verbatim:

    sensor = RedisKeySensor(key="k", redis_conn_id="redis_{{ ds }}", ...)
    sensor.render_template_fields({"ds": "2017-01-01"})
    sensor.redis_conn_id   # 'redis_{{ ds }}' before this change

`RedisPublishOperator` got the same fix in #72883. These two sensors are the only
other classes in the provider that declare `template_fields`, so this completes
the redis slice of #35259.

No test, following the review on #72883 where the equivalent test was removed
before merge.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants