jason810496 commented on code in PR #54555:
URL: https://github.com/apache/airflow/pull/54555#discussion_r2280731617


##########
airflow-core/src/airflow/logging_config.py:
##########
@@ -24,7 +24,7 @@
 
 from airflow.configuration import conf
 from airflow.exceptions import AirflowConfigException
-from airflow.utils.module_loading import import_string
+from airflow.utils.module_loading import import_module, import_string

Review Comment:
   It would be better to import the `import_module` from `importlib`, as we 
should import the function from where it is originally defined.



##########
airflow-core/tests/unit/core/test_logging_config.py:
##########
@@ -96,6 +96,77 @@
 # Other settings here
 """
 
+SETTINGS_FILE_SIMPLE_MODULE = """
+LOGGING_CONFIG = {
+    'version': 1,
+    'disable_existing_loggers': False,
+    'formatters': {
+        'airflow.task': {
+            'format': '[%(asctime)s] {%(filename)s:%(lineno)d} %(levelname)s - 
%(message)s'
+        },
+    },
+    'handlers': {
+        'console': {
+            'class': 'logging.StreamHandler',
+            'formatter': 'airflow.task',
+            'stream': 'ext://sys.stdout'
+        },
+        'task': {
+            'class': 'logging.StreamHandler',
+            'formatter': 'airflow.task',
+            'stream': 'ext://sys.stdout'
+        },
+    },
+    'loggers': {
+        'airflow.task': {
+            'handlers': ['task'],
+            'level': 'INFO',
+            'propagate': False,
+        },
+    }
+}
+
+# Test remote logging variables
+REMOTE_TASK_LOG = None
+DEFAULT_REMOTE_CONN_ID = "test_conn_id"
+"""
+
+SETTINGS_FILE_NESTED_MODULE = SETTINGS_FILE_SIMPLE_MODULE.replace(
+    'DEFAULT_REMOTE_CONN_ID = "test_conn_id"', 'DEFAULT_REMOTE_CONN_ID = 
"nested_conn_id"'
+)
+
+SETTINGS_FILE_NO_REMOTE_VARS = """

Review Comment:
   Sorry, I didn't notice that we could also copy from 
`SETTINGS_FILE_SIMPLE_MODULE` variable for `SETTINGS_FILE_NO_REMOTE_VARS` and 
replace the last few lines.



-- 
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]

Reply via email to