amordoch commented on issue #56364:
URL: https://github.com/apache/airflow/issues/56364#issuecomment-3419071105
> > airflow.models.Connection.get_connection_from_secrets instead of
airflow.sdk.Connection.get doesn't seem to work.
>
> Correct. It will not work, you need to change it.
This works, but not sure if it the "recommended" solution:
```python
@task.virtualenv(...)
def my_venv_task(host, login, password, schema):
...
@dag(...)
def my_dag():
my_venv_task("{{ conn.conn_id.host }}", "{{ conn.conn_id.login }}" , "{{
conn.conn_id.password }}")
my_dag()
```
Using templating the password doesn't show up in the Airflow UI. But I'm not
sure if it would be exposed elsewhere.
--
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]