amoghrajesh commented on code in PR #66859:
URL: https://github.com/apache/airflow/pull/66859#discussion_r3265050162


##########
task-sdk/src/airflow/sdk/configuration.py:
##########
@@ -210,6 +211,21 @@ def remove_all_read_configurations(self):
             self.remove_section(section)
 
 
+def get_state_backend():
+    """
+    Get the state backend if configured via ``[workers] state_backend``.
+
+    Returns the instantiated backend, or ``None`` if not configured.
+    """
+    # Lazy import to trigger __getattr__ and lazy initialization
+    from airflow.sdk.configuration import conf
+
+    class_name = conf.get("workers", "state_backend", fallback="")
+    if not class_name:
+        return None
+    return import_string(class_name)()

Review Comment:
   Yeah I wrapped it around and raising a ValueError now.



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