jstern commented on a change in pull request #7133: [AIRFLOW-6535] add 
exception to fail without retry
URL: https://github.com/apache/airflow/pull/7133#discussion_r389372194
 
 

 ##########
 File path: docs/conf.py
 ##########
 @@ -207,9 +207,12 @@
 ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
 
 # Generate top-level
+
+allowed_top_level = ("exceptions.py",)
 
 Review comment:
   @ashb @potiuk @mik-laj - any thoughts about whether it's ok to keep this 
change to include the exceptions module in the docs?
   
   ---
   
   On a related note, after updating this pr from master, I'm getting a new 
docs build failure:
   
   ```
   
/opt/airflow/docs/_api/airflow/providers/amazon/aws/hooks/datasync/index.rst:66:
 WARNING: more than one target found for cross-reference 'AirflowException': 
airflow.exceptions.AirflowException, 
airflow.providers.yandex.hooks.AirflowException
   
/opt/airflow/docs/_api/airflow/providers/amazon/aws/operators/datasync/index.rst:167:
 WARNING: more than one target found for cross-reference 'AirflowException': 
airflow.exceptions.AirflowException, 
airflow.providers.yandex.hooks.AirflowException
   
/opt/airflow/docs/_api/airflow/providers/amazon/aws/operators/datasync/index.rst:167:
 WARNING: more than one target found for cross-reference 'AirflowException': 
airflow.exceptions.AirflowException, 
airflow.providers.yandex.hooks.AirflowException
   
/opt/airflow/docs/_api/airflow/providers/amazon/aws/operators/datasync/index.rst:167:
 WARNING: more than one target found for cross-reference 'AirflowException': 
airflow.exceptions.AirflowException, 
airflow.providers.yandex.hooks.AirflowException
   
/opt/airflow/docs/_api/airflow/providers/amazon/aws/operators/datasync/index.rst:167:
 WARNING: more than one target found for cross-reference 'AirflowException': 
airflow.exceptions.AirflowException, 
airflow.providers.yandex.hooks.AirflowException
   ```
   
   I can make this go away by removing my change that allows 
`airflow.exceptions` api docs to be built, but this does not seem like a 
satisfactory course of action, because the 
`airflow.providers.yandex.hooks.AirflowException` will remain in the docs and 
it shouldn't. It's there because somehow these lines in 
`airflow/providers/yandex/hooks/__init__.py`:
   
   ```
   from airflow.exceptions import AirflowException
   from airflow.hooks.base_hook import BaseHook
   ```
   
   are causing autoapi to include `AirflowException` and `BaseHook` in the docs 
for `airflow.providers.yandex.hooks` as if those classes were defined in that 
module.
   
   <img width="719" alt="Screen Shot 2020-02-27 at 4 25 31 PM" 
src="https://user-images.githubusercontent.com/617540/75493344-46b1d680-597f-11ea-9e2c-2b8d30d3c302.png";>
   
   In other words, autoapi is generating this in 
`docs/_api/airflow/providers/yandex/hooks/index.rst`:
   
   ```
   Package Contents
   ----------------
   
   .. py:exception:: AirflowException
   
      Bases: :class:`Exception`
   
      Base class for all Airflow's errors.
      Each custom exception should be derived from this class
   
      .. attribute:: status_code
         :annotation: = 500
   
   .. py:class:: BaseHook
   ```
   
   I don't know if this is a bug in autoapi or in how the airflow project 
configures it, and I don't know why the warnings are only about 
AirflowException and not BaseHook...
   

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