adh-wonolo opened a new pull request, #32101:
URL: https://github.com/apache/airflow/pull/32101

   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of an existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   Backfill Job Runner pulls in the class name of your executor but doesn't 
pull in the full path so if you aren't using a default core executor you get an 
error like:
   
   ```
     File 
"/Users/adh/.pyenv/versions/3.10.7/envs/airflow310/lib/python3.10/site-packages/airflow/utils/module_loading.py",
 line 32, in import_string                                                      
                                                        module_path, class_name 
= dotted_path.rsplit(".", 1)
   ValueError: not enough values to unpack (expected 2, got 1)
   
   During handling of the above exception, another exception occurred:
   
   Traceback (most recent call last):
     File 
"/Users/adh/.pyenv/versions/3.10.7/envs/airflow310/lib/python3.10/site-packages/airflow/executors/executor_loader.py",
 line 106, in load_executor                                                     
                                                   executor_cls, import_source 
= cls.import_executor_cls(executor_name)
     File 
"/Users/adh/.pyenv/versions/3.10.7/envs/airflow310/lib/python3.10/site-packages/airflow/executors/executor_loader.py",
 line 148, in import_executor_cls                                               
                                                   return 
_import_and_validate(executor_name), ConnectorSource.CUSTOM_PATH
     File 
"/Users/adh/.pyenv/versions/3.10.7/envs/airflow310/lib/python3.10/site-packages/airflow/executors/executor_loader.py",
 line 129, in _import_and_validate                                              
                                                   executor = 
import_string(path)
     File 
"/Users/adh/.pyenv/versions/3.10.7/envs/airflow310/lib/python3.10/site-packages/airflow/utils/module_loading.py",
 line 34, in import_string                                                      
                                                        raise 
ImportError(f"{dotted_path} doesn't look like a module path")
   ImportError: CustomExecutor doesn't look like a module path
   ```
   
   This can be fixed either by just passing in the actual class to 
`executor_class` or passing in 
`#f"{self.job.executor.__class__.__module__}.{self.job.executor_class}"` to 
`ExecutorLoader.import_executor_cls` or setting `self.job.executor_class` to be 
`#f"{self.job.executor.__class__.__module__}.{self.job.executor.__class__.__name}"`
   
   I'm not sure which of these three is the best solution, though in my quick 
read through the code it seems like this isn't really called elsewhere besides 
in this specific file.
   
   I ran the core tests and they all passed.
   
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request 
Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.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 
[newsfragments](https://github.com/apache/airflow/tree/main/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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to