potiuk commented on pull request #17576:
URL: https://github.com/apache/airflow/pull/17576#issuecomment-986363233


   Another possibly interesting use case for pre_execute: 
   
   https://apache-airflow.slack.com/archives/CCVDRN0F9/p1638740065139100
   
   
   Basically adding a "session" attribute that would authorize the call with 
PythonOperators - defined at a DAG level. Pretty useful IMHO: 
   
   ```
   def authorize(self):
         CREDENTIALS, _= 
google.auth.default(scopes=['https://www.googleapis.com/auth/cloud-platform'])
         self.session = AuthorizedSession(CREDENTIALS)
   ```


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