coopergillan opened a new pull request #10083: URL: https://github.com/apache/airflow/pull/10083
Add type annotations to `AthenaSensor` and `AWSAthenaOperator`. Of note on `AWSAthenaOperator` in particular, I removed `hook` as an attribute, which was always defaulting to `None`. I tried to keep it , but continually ran into errors like this: >airflow/providers/amazon/aws/operators/athena.py:122: error: Item "None" of "Optional[AWSAthenaHook]" has no attribute "stop_query" > response = self.hook.stop_query(self.query_execution_id) Any ideas on how to add typing when an attribute starts as `None` and gets set later? Or is the point of these errors that that is not necessary? I also intentionally put this into two commits since the `AWSAthenaHook` changes were a little more straightforward. I could pull the operator ones out if need be. <!-- 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 existing issue, reference it using one of the following: **partially** closes: #9008 related: #ISSUE How to write a good git commit message: http://chris.beams.io/posts/git-commit/ --> --- **^ Add meaningful description above** Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines)** for more information. In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+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 [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.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. For queries about this service, please contact Infrastructure at: [email protected]
