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

   List of bug fixes and improvements which could affect users.
   
   ---
   
   `config` - 
[botocore.config.Config](https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html)
 after this PR will follow this precedence rules:
      1. `config` argument in hooks methods `get_client_type` and 
`get_resource_type` - Operators/Sensors in providers packages doesn't use this 
methods.
      2. `config` argument in hook initialisation - Operators/Sensors in 
providers packages do not use this argument in hook initialisation right now.
      3. Construct from `config_kwargs` in Connection if this key exists and 
not empty
   
   Since 1.0.0 version of amazon-provider use this rules
      1. `config` argument which set in methods `get_client_type` and 
`get_resource_type`
      2. If `config_kwargs` key exists in Connection then construct Config and 
overwrite `config` Hook attribute 
      3. If `config_kwargs` key not exists in Connection then use argument hook 
`config` argument
   
   In additional I personally think that `config` too broad name and better 
rename in next PR to `botocore_config` and deprecate `config`. Some Operators 
use their own `config`: 
   * 
[airflow.providers.amazon.aws.operators.glue_crawler.GlueCrawlerOperator](https://github.com/apache/airflow/blob/9bc0d880789ae6cccad61c8f3f899bda38688c30/airflow/providers/amazon/aws/operators/glue_crawler.py#L39)
   * 
[airflow.providers.amazon.aws.operators.sagemaker.SageMakerBaseOperator](https://github.com/apache/airflow/blob/9bc0d880789ae6cccad61c8f3f899bda38688c30/airflow/providers/amazon/aws/operators/sagemaker.py#L39)
   
   ---
   
   Fallback to boto3 default Credential strategy only if provided `aws_conn_id` 
not exists and inform the user. Personally I think that in some point of the 
future if provided `aws_conn_id` not exists, than better just raise an error, 
rather than fallback to default boto3 strategy. If user want do not want use 
connection Hook already support `aws_conn_id=None` and it is documented feature.
   
   Right now Hook catch too broad `AirflowException`, it could be a reason why 
some methods in Session Factory raises something like `RuntimeError`. 
`AirflowException` raises in:
      1. If user set not supported auth web identity method. Now only `google` 
supported. So i think it is legit to stop execution on this point.
      2. In legacy configurations files, this function migrated from S3Hook to 
AwsHook in Airflow 1.9 and never been documented.
   


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