You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2019/11/18 08:54:45 UTC
[GitHub] [airflow] potiuk commented on issue #6597: [AIRFLOW-6005] Remove
airflow airflow exception imports. Depends on [AIRFLOW-6004]
potiuk commented on issue #6597: [AIRFLOW-6005] Remove airflow airflow exception imports. Depends on [AIRFLOW-6004]
URL: https://github.com/apache/airflow/pull/6597#issuecomment-554916834
I think I nicely solved the problem of old imports. I figured out a nice way how to throw a deprecation warning in case someone import "from airflow impot AirflowException". It will still work, but during tests/execution it will log a deprecation warning and also you will see this deprecation warning in IDE:
<img width="940" alt="Screenshot 2019-11-18 at 02 38 00" src="https://user-images.githubusercontent.com/595491/69037689-99770c00-09e8-11ea-99eb-0b61da54d6f6.png">
This is a I think a very straightforward way to avoid potential cyclic imports like the ones described in #6596 and opens up the possibility of removing the class from 'airflow' package in the future.
I have one problem though @mik-laj maybe you can help solving it. I added a new "deprecations" package where i will put all the "deprecated" classes. I had to remove it in `autoapi_ignore` because otherwise there were two candidates for AirflowException class in autoapi generation. Now I have another warning - when I generate doc I have the "missing module" error:
```
[AutoAPI] Mapping Data
WARNING: Cannot resolve import of unknown module airflow.deprecations in airflow
[AutoAPI] Rendering Data
```
I tried to add `airflow.deprecations` to 'autodoc_mock_imports' but it did not help. Can you please help with solving this?
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services