moomindani commented on issue #64195:
URL: https://github.com/apache/airflow/issues/64195#issuecomment-4139568685
**Tested `amazon: 9.24.0rc1`** — Add bucket_namespace support to
S3CreateBucketOperator (#63622)
I am the original author of #63622.
**Environment:** Airflow 3.2.0dev · Python 3.11 · macOS (RC tag
`providers-amazon/9.24.0rc1`)
**Code-level check:**
```python
import inspect
from airflow.providers.amazon.aws.hooks.s3 import S3Hook
from airflow.providers.amazon.aws.operators.s3 import S3CreateBucketOperator
assert 'bucket_namespace' in
inspect.signature(S3Hook.create_bucket).parameters # ✅
assert 'bucket_namespace' in
inspect.signature(S3CreateBucketOperator.__init__).parameters # ✅
assert 'bucket_namespace' in S3CreateBucketOperator.template_fields # ✅
assert 'BucketNamespace' in inspect.getsource(S3Hook.create_bucket) # ✅
```
**End-to-end DAG test** (real S3 via `airflow dags test`):
```python
create_bucket = S3CreateBucketOperator(
task_id="create_bucket",
bucket_name="airflow-dag-ns-test-<ACCOUNT_ID>-us-east-1-an",
region_name="us-east-1",
bucket_namespace="account-regional",
aws_conn_id=None,
)
delete_bucket = S3DeleteBucketOperator(
task_id="delete_bucket",
bucket_name="airflow-dag-ns-test-<ACCOUNT_ID>-us-east-1-an",
force_delete=False,
aws_conn_id=None,
)
create_bucket >> delete_bucket
```
```
Created bucket with name: airflow-dag-ns-test-<ACCOUNT_ID>-us-east-1-an
Deleted bucket with name: airflow-dag-ns-test-<ACCOUNT_ID>-us-east-1-an
DagRun Finished: state=success
```
Bucket created in account-regional namespace and cleaned up successfully.
Requires `botocore>=1.42.0`.
Fix confirmed end-to-end. ✅ LGTM for release.
--
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]