jroachgolf84 opened a new issue, #49893:
URL: https://github.com/apache/airflow/issues/49893

   ### What do you see as an issue?
   
   When a user is leveraging our Operator docs (such as for the `BashOperator`: 
https://airflow.apache.org/docs/apache-airflow-providers-standard/stable/operators/bash.html),
 each code snippet "stands alone" in the sense that there are no `import` 
statements as part of the code block. In fact, there is no reference to where 
this Operator can be imported from. This is due to using something like the 
following in our documentation.
   
   ```
     .. exampleinclude:: 
/../../../airflow-core/src/airflow/example_dags/example_bash_operator.py
         :language: python
         :dedent: 4
         :start-after: [START howto_operator_bash]
         :end-before: [END howto_operator_bash]
   ```
   
   ### Solving the problem
   
   I think there are a couple of ways that we could solve this problem. 
However, I believe that it warrants more discussion, as this would be something 
that needs to be solved across almost every provider. I think the easiest would 
be including a snippet at the top of each page that includes where the 
Operator/Hook/Sensors etc. can be imported from, rather than redundantly adding 
an `import` statement to each code snippet.
   
   
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


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