ferruzzi commented on code in PR #32760:
URL: https://github.com/apache/airflow/pull/32760#discussion_r1277755555
##########
tests/system/providers/amazon/aws/example_gcs_to_s3.py:
##########
@@ -38,18 +50,40 @@
) as dag:
test_context = sys_test_context_task()
env_id = test_context["ENV_ID"]
+ gcp_user_project = test_context[GCP_PROJECT_ID]
s3_bucket = f"{env_id}-gcs-to-s3-bucket"
s3_key = f"{env_id}-gcs-to-s3-key"
create_s3_bucket = S3CreateBucketOperator(task_id="create_s3_bucket",
bucket_name=s3_bucket)
+ gcs_bucket = f"{env_id}-gcs-to-s3-bucket"
+ gcs_key = f"{env_id}-gcs-to-s3-key"
+
+ create_gcs_bucket = GCSCreateBucketOperator(
+ task_id="create_gcs_bucket",
+ bucket_name=gcs_bucket,
+ resource={"billing": {"requesterPays": True}},
+ project_id=gcp_user_project,
+ )
+
+ @task
+ def upload_gcs_file(bucket_name: str, object_name: str, user_project: str):
+ hook = GCSHook()
+ with hook.provide_file_and_upload(
+ bucket_name=bucket_name,
+ object_name=object_name,
+ user_project=user_project,
+ ) as temp_file:
+ temp_file.write(b"test")
+
# [START howto_transfer_gcs_to_s3]
gcs_to_s3 = GCSToS3Operator(
task_id="gcs_to_s3",
- bucket=s3_bucket,
- dest_s3_key=s3_key,
+ bucket=gcs_bucket,
Review Comment:
Oh yeah, I definitely didn't mean to add to the scope of this one. If you
want to take it in another PR, that's great. Ping me in it and I'll review it
for you as well.
The AWS team runs "all" of the system tests regularly with [a
dashboard](https://aws-mwaa.github.io/open-source/system-tests/dashboard.html)
and fixes any regressions, but doesn't run any of the ones that require outside
services (like maintaining GCS or MongoDB accounts) or that would have been
caught long ago. [Speaking for myself here and not on behalf of anyone else]
It would be neat to see if the Google team and the AWS team could work
something out to get that combination of tests running somehow.
--
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]