uranusjr commented on a change in pull request #20096:
URL: https://github.com/apache/airflow/pull/20096#discussion_r764287477



##########
File path: airflow/settings.py
##########
@@ -80,7 +80,7 @@
 DAGS_FOLDER: str = os.path.expanduser(conf.get('core', 'DAGS_FOLDER'))
 
 engine: Optional[Engine] = None
-Session: Callable[..., SASession]
+Session: SASession

Review comment:
       I guess w need my new fancy toy then!
   
   ```python
   class SessionMaker(Protocol):
       """Fake the type returned by sessionmaker for typg hints.
   
       Add more things to this class as we need them.
       """
   
       bind: Engine
   
       def __call__(self, **kwargs: Any) -> SASession:
           ...
   
       def remove(self) -> None:
           ...
   
   
   Session: SessionMaker
   ```

##########
File path: airflow/settings.py
##########
@@ -80,7 +80,7 @@
 DAGS_FOLDER: str = os.path.expanduser(conf.get('core', 'DAGS_FOLDER'))
 
 engine: Optional[Engine] = None
-Session: Callable[..., SASession]
+Session: SASession

Review comment:
       I guess we need my new fancy toy then!
   
   ```python
   class SessionMaker(Protocol):
       """Fake the type returned by sessionmaker for typg hints.
   
       Add more things to this class as we need them.
       """
   
       bind: Engine
   
       def __call__(self, **kwargs: Any) -> SASession:
           ...
   
       def remove(self) -> None:
           ...
   
   
   Session: SessionMaker
   ```




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