Taragolis commented on PR #24306:
URL: https://github.com/apache/airflow/pull/24306#issuecomment-1150085106

   > Yes, we can also set it here. but that too will be breaking change for 
someone not passing aws_conn_id in this operator param and have created a 
connection with the name aws_default
   
   Quite a lot of operators and sensors in amazon-provider uses different 
annotations and default value for `aws_conn_id`
   
   - `aws_conn_id: str = 'aws_default'`
   - `aws_conn_id: Optional[str] = 'aws_default'`
   - `aws_conn_id: Optional[str] = None`
   
   Due to the fact all of them (or most) uses hooks based on `AwsBaseHook` so 
provide `None` is fine but in case it all workers use the same credentials
   
   You could use `aws_conn_id: Optional[str] = 'aws_default'` and it won't 
break anything
   
   
   > if aws_conn_id does not exist raise an error like earlier
   if emr_conn_id contain auth param like aws_access_key_id etc raise error 
like earlier
   if emr_conn_id does not exist then make config as empty dict that way 
emr_conn_id will not be mandatory
   
   My suggestion still the same
   1. Make it allow provide `None` for `emr_conn_id`
   2. Do not touch  anything related to `aws_conn_id`
   3. Check type of `emr_conn_id` if it `not None`
     - Connection not `emr` - raise an error
     - Connection not exists - raise an error which is default for 
BaseHook.get_connection
   4. User provide in connection wrong arguments? boto3 will raise an error


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