Yeah, this PR only remove it from accessing from task context dict i.e. if
you try to do: BashOperator(bash_command="{{ conf.get('webserver',
'base_url') }}" -- for example

On Tue, 10 Dec 2024 at 23:27, Constance Martineau
<consta...@astronomer.io.invalid> wrote:

> Will it still be possible to import and use configuration directly? For
> example:
>
> ```
> from airflow.configuration import conf
> from airflow.providers.cncf.kubernetes.operators.kubernetes_pod import
> KubernetesPodOperator
>
>
> namespace = conf.get("kubernetes", "NAMESPACE")
>
> KubernetesPodOperator(
>     namespace=namespace,
>     image="<your-docker-image>",
>     cmds=["<commands-for-image>"],
>     arguments=["<arguments-for-image>"],
>     labels={"<pod-label>": "<label-name>"},
>     name="<pod-name>",
>     task_id="<task-name>",
>     get_logs=True,
>     in_cluster=True,
> )
> ```
>
> On Tue, Dec 10, 2024 at 12:52 PM Kaxil Naik <kaxiln...@gmail.com> wrote:
>
> > Hey team,
> >
> > I have a PR (https://github.com/apache/airflow/pull/44820) to remove
> conf
> > object from the Task context dictionary.
> >
> > This was initially added (in 2015) in response to
> > https://github.com/apache/airflow/issues/168. However, we now have
> > `ti.log_url` that is used for that; example usages:
> >
> >
> >
> https://github.com/apache/airflow/blob/dcd41f60f1c9b5583b49bfb49b6d85c640a2892c/airflow/models/taskinstance.py#L1362
> >
> >
> >
> https://github.com/apache/airflow/blob/dcd41f60f1c9b5583b49bfb49b6d85c640a2892c/providers/src/airflow/providers/smtp/notifications/templates/email.html#L28
> >
> >
> >
> https://github.com/apache/airflow/blob/dcd41f60f1c9b5583b49bfb49b6d85c640a2892c/docs/apache-airflow/howto/email-config.rst?plain=1#L76
> >
> > So, to simplify what we need to pass from the API server to the Task SDK
> > (for AF 3.0), I want to simplify and remove things that aren't needed. In
> > this case, this is good so we don't pass/expose secrets unnecessarily via
> > `conf` object in the execution environment.
> >
> > To that end, I am calling for a LAZY CONSENSUS to remove it. If no one
> > objects, the vote will pass three days from now, at 6:30 pm UTC, 13 Dec
> > 2024.
> >
> > Regards,
> > Kaxil
> >
>

Reply via email to