o-nikolas commented on code in PR #48120:
URL: https://github.com/apache/airflow/pull/48120#discussion_r2010544097
##########
providers/amazon/src/airflow/providers/amazon/aws/transfers/exasol_to_s3.py:
##########
@@ -108,5 +108,4 @@ def execute(self, context: Context):
gzip=self.gzip,
acl_policy=self.acl_policy,
)
- self.log.info("Data uploaded")
- return self.key
Review Comment:
Why are we deleting this? This is a breaking change for anyone reading the
results of this Operator from xcom
##########
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:
This test assumes you have an Exasol DB setup to communicate with and
transfer from. That should probably be provided by the task context builder so
that others can supply their own.
--
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]