bryanyang0528 edited a comment on issue #5067: [AIRFLOW-4265] Lineage backend 
did not work normally
URL: https://github.com/apache/airflow/pull/5067#issuecomment-481083240
 
 
   import_string will fail if backend = `airflow.lineage.backend.atlas`
   
   ```
   >>> from airflow.utils.module_loading import import_string
   /airflow/airflow/configuration.py:557: DeprecationWarning: Specifying 
airflow_home in the config file is deprecated. As you have left it at the 
default value you should remove the setting from your airflow.cfg and suffer no 
change in behaviour.
     category=DeprecationWarning,
   >>> backend = import_string('airflow.lineage.backend.atlas')
   Traceback (most recent call last):
     File "/airflow/airflow/utils/module_loading.py", line 36, in import_string
       return getattr(module, class_name)
   AttributeError: module 'airflow.lineage.backend' has no attribute 'atlas'
   
   During handling of the above exception, another exception occurred:
   
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
     File "/airflow/airflow/utils/module_loading.py", line 39, in import_string
       module_path, class_name)
   ImportError: Module "airflow.lineage.backend" does not define a "atlas" 
attribute/class
   >>>
   ```
   
   if backend = `airflow.lineage.backend.atlas.AtlasBackend`, it passed 
import_string, but backend is a class, can not call send_message directly.
   ```
   >>> backend = import_string('airflow.lineage.backend.atlas.AtlasBackend')
   >>> backend
   <class 'airflow.lineage.backend.atlas.AtlasBackend'>
   >>> backend.send_lineage(operator='', inlets='', outlets='', context='')
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
   TypeError: send_lineage() missing 1 required positional argument: 'self'
   >>>
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to