jieyao-MilestoneHub commented on code in PR #48120:
URL: https://github.com/apache/airflow/pull/48120#discussion_r2012201239


##########
providers/amazon/tests/system/amazon/aws/example_exasol_to_s3.py:
##########
@@ -0,0 +1,93 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""
+Example DAG to test Exasol connection and S3 upload in Apache Airflow.
+
+This DAG uses the ExasolToS3Operator to execute a simple SQL query on Exasol 
and
+upload the result file to S3. It verifies that both the Exasol connection 
(`exasol_default`)
+and S3 credential settings (`aws_default`) are working correctly.
+"""
+from __future__ import annotations
+
+from datetime import datetime
+
+from airflow.models.baseoperator import chain
+from airflow import DAG
+from airflow.providers.amazon.aws.operators.s3 import S3CreateBucketOperator, 
S3DeleteBucketOperator
+from airflow.providers.amazon.aws.transfers.exasol_to_s3 import 
ExasolToS3Operator
+from airflow.utils.trigger_rule import TriggerRule
+from system.amazon.aws.utils import SystemTestContextBuilder
+
+sys_test_context_task = SystemTestContextBuilder().build()
+
+DAG_ID = "example_exasol_to_s3"
+
+with DAG(
+    dag_id=DAG_ID,
+    start_date=datetime(2025, 3, 11),
+    schedule="@once",
+    catchup=False,
+    tags=["exasol", "s3", "test"],
+) as dag:
+
+    test_context = sys_test_context_task()
+    env_id = test_context["ENV_ID"]
+    s3_bucket_name = f"{env_id}-bucket"
+    s3_key = f"{env_id}/files/exasol-output.csv"
+
+    create_s3_bucket = S3CreateBucketOperator(
+        task_id="create_s3_bucket",
+        bucket_name=s3_bucket_name,
+    )
+
+    # [START howto_transfer_exasol_to_s3]
+    exasol_to_s3 = ExasolToS3Operator(

Review Comment:
   Hi @o-nikolas @vincbeck, would it be better if I added the following comment 
to `example_exasol_to_s3.py`?
   
   ```python
   # Example DAG to test Exasol connection and S3 upload in Apache Airflow.
   # This DAG uses ExasolToS3Operator to run a simple SQL query on Exasol and 
upload the result to S3.
   # It checks that both the Exasol (exasol_default) and S3 (aws_default) 
connections are properly configured.
   #
   # Note:
   # This test assumes that exasol_default and aws_default are already set up.
   # If not, the task will fail at runtime. Please refer to the docs for setup:
   # <intro-url>
   
   ```



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