o-nikolas commented on code in PR #75997:
URL: https://github.com/apache/airflow/pull/75997#discussion_r4426297830
##########
providers/amazon/src/airflow/providers/amazon/aws/hooks/duckdb.py:
##########
@@ -196,6 +200,25 @@ def get_s3_endpoint_url(self) -> str | None:
return explicit
return self.connection_extra.get("endpoint_url") or
self.aws_hook.conn_config.endpoint_url
+ def get_conn(self) -> DuckDBPyConnection:
+ """Return a DuckDB connection, and log the AWS identity once to help
debug S3 ``HTTP 403`` errors."""
+ conn = super().get_conn()
+ if self._aws_identity_looked_up:
+ return conn
+ self._aws_identity_looked_up = True
+ try:
+ if self.credential_strategy != "none" and not
self.get_s3_endpoint_url():
Review Comment:
Fair point. It now only skips when the endpoint host isn't under
`amazonaws.com` or `amazonaws.com.cn` (same suffixes the Redshift SQL hook
checks), so VPC endpoints get the lookup and things like MinIO or LocalStack
still skip it.
--
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]