Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions airflow/secrets/local_filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ def _parse_secret_file(file_path: str) -> Dict[str, Any]:
ext = file_path.rsplit(".", 2)[-1].lower()

if ext not in FILE_PARSERS:
raise AirflowException("Unsupported file format. The file must have the extension .env or .json")
raise AirflowException(
"Unsupported file format. The file must have the extension .env or .json or .yaml"
)

secrets, parse_errors = FILE_PARSERS[ext](file_path)

Expand Down Expand Up @@ -223,7 +225,7 @@ def load_variables(file_path: str) -> Dict[str, str]:
"""
Load variables from a text file.

Both ``JSON`` and ``.env`` files are supported.
``JSON``, `YAML` and ``.env`` files are supported.

:param file_path: The location of the file that will be processed.
:type file_path: str
Expand Down Expand Up @@ -254,7 +256,7 @@ def load_connections_dict(file_path: str) -> Dict[str, Any]:
"""
Load connection from text file.

Both ``JSON`` and ``.env`` files are supported.
``JSON``, `YAML` and ``.env`` files are supported.

:return: A dictionary where the key contains a connection ID and the value contains a list of connections.
:rtype: Dict[str, airflow.models.connection.Connection]
Expand Down Expand Up @@ -283,7 +285,7 @@ class LocalFilesystemBackend(BaseSecretsBackend, LoggingMixin):
"""
Retrieves Connection objects and Variables from local files

Both ``JSON`` and ``.env`` files are supported.
``JSON``, `YAML` and ``.env`` files are supported.

:param variables_file_path: File location with variables data.
:type variables_file_path: str
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ The keys ``extra`` and ``extra_dejson`` are mutually exclusive.

The JSON file must contain an object where the key contains the connection ID and the value contains
the definition of one connection. The connection can be defined as a URI (string) or JSON object.
For a guide about defining a connection as a URI, see:: :ref:`generating_connection_uri`.
For a guide about defining a connection as a URI, see :ref:`generating_connection_uri`.
For a description of the connection object parameters see :class:`~airflow.models.connection.Connection`.
The following is a sample JSON file.

Expand Down