jscheffl commented on code in PR #59062:
URL: https://github.com/apache/airflow/pull/59062#discussion_r2595220368
##########
airflow-core/src/airflow/secrets/local_filesystem.py:
##########
@@ -278,6 +278,26 @@ def load_connections_dict(file_path: str) -> dict[str,
Any]:
return connection_by_conn_id
+def load_configs_dict(file_path: str) -> dict[str, str]:
+ """
+ Load configs from a text file.
+
+ ``JSON``, `YAML` and ``.env`` files are supported.
+
+ :param file_path: The location of the file that will be processed.
+ :return: A dictionary where the key contains a config name and the value
contains the config value.
+ """
+ log.debug("Loading configs from a text file")
Review Comment:
nit: logging can be including the filename
```suggestion
log.debug("Loading configs from text file %s", file_path)
```
##########
airflow-core/src/airflow/secrets/local_filesystem.py:
##########
@@ -310,10 +336,21 @@ def _local_connections(self) -> dict[str, Connection]:
return {}
return load_connections_dict(self.connections_file)
+ @property
Review Comment:
As every call might re-load the file, does it maybe make sense making this a
`@cached_property`?
--
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]