Re: [PR] Implement get_config in LocalFilesystemBackend [airflow]
potiuk merged PR #59062: URL: https://github.com/apache/airflow/pull/59062 -- 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]
Re: [PR] Implement get_config in LocalFilesystemBackend [airflow]
jscheffl commented on code in PR #59062:
URL: https://github.com/apache/airflow/pull/59062#discussion_r2596435081
##
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:
Ah, okay, did not see this, then it is OK like it is.
--
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]
Re: [PR] Implement get_config in LocalFilesystemBackend [airflow]
ecodina commented on code in PR #59062:
URL: https://github.com/apache/airflow/pull/59062#discussion_r2596195334
##
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:
I implemented the feature by copying exactly what was already available for
connections and variables. So maybe if we add it here, we should also add it
there. Since I'm not an expert, let's see what de CODEOWNERS say!
--
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]
Re: [PR] Implement get_config in LocalFilesystemBackend [airflow]
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]
[PR] Implement get_config in LocalFilesystemBackend [airflow]
ecodina opened a new pull request, #59062:
URL: https://github.com/apache/airflow/pull/59062
As discussed in Slack, this PR adds the missing `get_config` method to
`LocalFilesystemBackend` in order to obtain the `_secret` options from a local
file.
---
**^ Add meaningful description above**
Read the **[Pull Request
Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)**
for more information.
In case of fundamental code changes, an Airflow Improvement Proposal
([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals))
is needed.
In case of a new dependency, check compliance with the [ASF 3rd Party
License Policy](https://www.apache.org/legal/resolved.html#category-x).
In case of backwards incompatible changes please leave a note in a
newsfragment file, named `{pr_number}.significant.rst` or
`{issue_number}.significant.rst`, in
[airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments).
--
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]
