You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ep...@apache.org on 2023/10/30 11:26:36 UTC
(airflow) 41/46: Added example for defaults in conn.extras (#35165)
This is an automated email from the ASF dual-hosted git repository.
ephraimanierobi pushed a commit to branch v2-7-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit c7c0df835e97535b474755df377b985d8482d2cb
Author: Vedran Kolka <30...@users.noreply.github.com>
AuthorDate: Sun Oct 29 08:00:08 2023 +0100
Added example for defaults in conn.extras (#35165)
Added example for providing a default value when reading extras from connections using extra_dejson.get
(cherry picked from commit 7c80b2b6fbe8391857a81ea03ae24a0f37f8cb7c)
---
docs/apache-airflow/templates-ref.rst | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/apache-airflow/templates-ref.rst b/docs/apache-airflow/templates-ref.rst
index 763d3550fd..215e35f589 100644
--- a/docs/apache-airflow/templates-ref.rst
+++ b/docs/apache-airflow/templates-ref.rst
@@ -136,6 +136,7 @@ Just like with ``var`` it's possible to fetch a connection by string (e.g. ``{{
Additionally, the ``extras`` field of a connection can be fetched as a Python Dictionary with the ``extra_dejson`` field, e.g.
``conn.my_aws_conn_id.extra_dejson.region_name`` would fetch ``region_name`` out of ``extras``.
+This way, defaults in ``extras`` can be provided as well (e.g. ``{{ conn.my_aws_conn_id.extra_dejson.get('region_name', 'Europe (Frankfurt)') }}``).
Filters
-------