ferruzzi commented on code in PR #66702:
URL: https://github.com/apache/airflow/pull/66702#discussion_r3250467457


##########
task-sdk/src/airflow/sdk/execution_time/callback_supervisor.py:
##########
@@ -110,7 +117,23 @@ def execute_callback(
         # Import the callback callable
         # Expected format: "module.path.to.function_or_class"
         module_path, function_name = callback_path.rsplit(".", 1)
-        module = import_module(module_path)
+        # If the callback is defined within the Dag module, the module path is 
modified during DAG serialization.
+        # Attempt to import it using the path of the Dag file.
+        if UNUSUAL_MODULE_PREFIX in module_path:

Review Comment:
   Non-blocking:  Maybe slightly more accurate to use `startswith()` here 
instead of `in` but that's maybe being pedantic



##########
task-sdk/src/airflow/sdk/execution_time/callback_supervisor.py:
##########


Review Comment:
   Non-blocking nit:  You are casting bundle_path to a string here, then 
passing it to execute_callback.  execute_callback has this type hinted as a 
PathLike and then casts it to a Path.  Likely may as well cast it to a Path 
here and skip the steps, but it works either way.



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