xBis7 commented on code in PR #56187:
URL: https://github.com/apache/airflow/pull/56187#discussion_r2587744574
##########
task-sdk/src/airflow/sdk/observability/metrics/datadog_logger.py:
##########
@@ -0,0 +1,53 @@
+# Licensed to the Apache Software Foundation (ASF) under one
Review Comment:
@jscheffl We discussed this offline. `datadog_logger` and the others, they
all need access to an initialized conf object which isn't available in
`_shared` without adding a circular import to either `airflow-core` or
`task-sdk` who are both initialing it.
The solution was to remove the code that needed the config and create these
files under `airflow-core` with factory methods that will initialize the config
and then pass the values as parameters to the code under `_shared`. The
`task-sdk` also needed to do this but with different imports.
* `airflow-core`
*
https://github.com/xBis7/airflow/blob/0d74d25c67d795b1ddb901d93ddce5614a1dadb2/airflow-core/src/airflow/observability/metrics/datadog_logger.py
```python
from airflow._shared.observability.metrics import datadog_logger
from airflow.configuration import conf
```
* `task-sdk`
*
https://github.com/xBis7/airflow/blob/0d74d25c67d795b1ddb901d93ddce5614a1dadb2/task-sdk/src/airflow/sdk/observability/metrics/datadog_logger.py
```python
from airflow.sdk._shared.observability.metrics import datadog_logger
from airflow.sdk.configuration import conf
```
If you see, everything is the same except for the imports. We agreed to
leave the duplicate code and try to make it as readable as possible using
`keyword-only` parameters.
--
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]