dstandish commented on a change in pull request #14869:
URL: https://github.com/apache/airflow/pull/14869#discussion_r597965321
##########
File path: airflow/providers/mysql/hooks/mysql.py
##########
@@ -52,7 +52,10 @@ def __init__(self, *args, **kwargs) -> None:
def set_autocommit(self, conn: Connection, autocommit: bool) -> None: #
noqa: D403
Review comment:
btw i explored this idea...
this seems to at least run (and it accomlishes the goal of providing correct
type annotation without importing...
not sure how mypy will feel about it but you could try it
and not sure if it is exactly what ash is suggesting.
```python
TYPING = False
if TYPING:
from MySQLdb.connections import Connection as MySQLdbConnection
from mysql.connector.abstracts import MySQLConnectionAbstract
...
def set_autocommit(
self, conn: Union['MySQLdbConnection', 'MySQLConnectionAbstract'],
autocommit: bool
) -> None:
```
--
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]