Vamsi-klu commented on code in PR #73083:
URL: https://github.com/apache/airflow/pull/73083#discussion_r4002487886
##########
airflow-core/src/airflow/secrets/local_filesystem.py:
##########
@@ -198,6 +198,13 @@ def _create_connection(conn_id: str, value: Any):
from airflow.models.connection import Connection
if isinstance(value, str):
+ # A URI can never start with "{" (RFC 3986: the scheme begins with a
letter), and a ``.env``
+ # value is the string one would put in ``AIRFLOW_CONN_*`` -- so JSON
deserializes as it does there.
+ if value.lstrip().startswith("{"):
Review Comment:
This reimplements the { test instead of calling
BaseSecretsBackend._deserialize_connection_value. The helper does value.strip()
then value[0] == "{"; this lstrip()s only for the check, then passes the
original string.
Also not dotenv: quoted CONN_ID='{"conn_type":...}' still fails the { test
and still corrupts. Export does not quote, so the reported path is fine.
Hand-written .env files that quote JSON still die the old way.
--
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]