How Do I properly Encode `extra` parameters while using `airflow connections add`

1.7k Views Asked by At

Problem Statement

When editing the UI I can add modify the extra field to contain {"no_host_key_check": true} enter image description here

But when I attempt to add this connection from the CLI with this command which follows the connections documentation format

airflow connections add local_sftp --conn-uri "sftp://test_user:test_pass@local_spark_sftp_server_1:22/schema?extra='{\"no_host_key_check\": true}"

The connection is added as {"extra": "'{\"no_host_key_check\": true}"} enter image description here

How do I need to modify my airflow connections add command to properly format this connection configuration?

1

There are 1 best solutions below

0
On

This is fundamentally a misunderstanding that all schema parameters for the airflow connections add command are extra parameters by default

airflow connections add local_sftp --conn-uri "sftp://test_user:test_pass@local_spark_sftp_server_1:22/schema?no_host_key_check=true"

Correctly sets the desired parameter.