Re: [PR] feat: Added files to introduce exasol connection and do some chores [airflow]
jieyao-MilestoneHub commented on code in PR #48120: URL: https://github.com/apache/airflow/pull/48120#discussion_r2040557201 ## 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: Oh, I see now! I was mixing up the example and the test earlier. Thanks for being patient with me as I’m still learning. I’ll fix the tests first and then tackle the other issues! -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] feat: Added files to introduce exasol connection and do some chores [airflow]
jieyao-MilestoneHub commented on code in PR #48120: URL: https://github.com/apache/airflow/pull/48120#discussion_r2032270557 ## 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: @vincbeck Sure, I'll fix the tests as well! By the way, since the PR hasn't been merged yet, I don't know the final documentation URL. May I ask how this is usually handled in these cases? -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] feat: Added files to introduce exasol connection and do some chores [airflow]
vincbeck commented on code in PR #48120: URL: https://github.com/apache/airflow/pull/48120#discussion_r2033107268 ## 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: Let's do it step by step, first can you fix the tests please? Then I'll help you to figure out the doc URL. The reason why I want to fix the tests first is, there is a breeze command to build the doc `breeze build-docs`, then from that you can preview the doc and thus, having the URL. But it seems the doc fails to build (among other tests). So let's fix that first :) -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] feat: Added files to introduce exasol connection and do some chores [airflow]
vincbeck commented on code in PR #48120: URL: https://github.com/apache/airflow/pull/48120#discussion_r2031194412 ## 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: Sure, sounds good to me. Can you fix the tests please? -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] feat: Added files to introduce exasol connection and do some chores [airflow]
jieyao-MilestoneHub commented on code in PR #48120: URL: https://github.com/apache/airflow/pull/48120#discussion_r2030337970 ## 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, sounds good, thanks for the discussion! I'll leave it as is, with the comment added to make it clearer. Let me know if there's anything else you'd like me to adjust! -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] feat: Added files to introduce exasol connection and do some chores [airflow]
o-nikolas commented on code in PR #48120: URL: https://github.com/apache/airflow/pull/48120#discussion_r2014573626 ## 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: Yeah, that might be the only one. It's not currently being run in our system test infra, so I didn't spot it! Any who, it is very rare (I guess we only have one instance), I still prefer we don't. But we likely won't run this test either way, so I'm okay to disagree and commit to leaving it as it is now (with a comment of course). -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] feat: Added files to introduce exasol connection and do some chores [airflow]
vincbeck commented on code in PR #48120: URL: https://github.com/apache/airflow/pull/48120#discussion_r2014139709 ## 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: Oh I was looking at this one: https://github.com/apache/airflow/blob/main/providers/amazon/tests/system/amazon/aws/example_google_api_sheets_to_s3.py. But I might got unlucky and picked the only one that does not handle the connection -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] feat: Added files to introduce exasol connection and do some chores [airflow]
o-nikolas commented on code in PR #48120: URL: https://github.com/apache/airflow/pull/48120#discussion_r2013003623 ## 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: > In the amazon provider package there are system tests that integrate with Google as well and we assume the user has credentials to interact with Google. @vincbeck We just have one google related test right? The Youtube one, and there we do not assume the user has created a connection, we create one explicitly as part of the test: https://github.com/apache/airflow/blob/main/providers/amazon/tests/system/amazon/aws/example_google_api_youtube_to_s3.py#L81-L97 We do this in other tests that require special connections too (like redshift). As far as I know we do not currently have an example of just expecting a non-aws connection to exist, do you know of one? -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] feat: Added files to introduce exasol connection and do some chores [airflow]
jieyao-MilestoneHub commented on code in PR #48120: URL: https://github.com/apache/airflow/pull/48120#discussion_r2012389025 ## 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: Got it! I will restore to original state -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] feat: Added files to introduce exasol connection and do some chores [airflow]
jieyao-MilestoneHub commented on code in PR #48120: URL: https://github.com/apache/airflow/pull/48120#discussion_r2012340340 ## 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: Got it! I will modify it next update. -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] feat: Added files to introduce exasol connection and do some chores [airflow]
vincbeck commented on code in PR #48120: URL: https://github.com/apache/airflow/pull/48120#discussion_r2012213275 ## 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: One nit. I would remove "It checks that both the Exasol (exasol_default) and S3 (aws_default) connections are properly configured.". It says the opposite of the note, so to avoid confusion I would remove 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] feat: Added files to introduce exasol connection and do some chores [airflow]
jieyao-MilestoneHub commented on code in PR #48120: URL: https://github.com/apache/airflow/pull/48120#discussion_r2012206742 ## 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") Review Comment: Got it! I will remove it next update. -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] feat: Added files to introduce exasol connection and do some chores [airflow]
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: 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: # ``` -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] feat: Added files to introduce exasol connection and do some chores [airflow]
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: # ``` -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] feat: Added files to introduce exasol connection and do some chores [airflow]
vincbeck commented on code in PR #48120: URL: https://github.com/apache/airflow/pull/48120#discussion_r2012167491 ## 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: Sorry if I misunderstood but no, please leave it at its original state. You do not need to modify this file -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] feat: Added files to introduce exasol connection and do some chores [airflow]
vincbeck commented on code in PR #48120: URL: https://github.com/apache/airflow/pull/48120#discussion_r2012171389 ## 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: In the amazon provider package there are system tests that integrate with Google as well and we assume the user has credentials to interact with Google. So I guess it is fine doing the same? But I agree with you, a comment does not hurt and could avoid hours of debugging if a user tries to run this system test without Exasol credentials -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] feat: Added files to introduce exasol connection and do some chores [airflow]
jieyao-MilestoneHub commented on code in PR #48120: URL: https://github.com/apache/airflow/pull/48120#discussion_r2012126582 ## 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: Previously, @vincbeck suggested removing the return value, and since I noticed some files had it while others didn’t, I removed it without being fully certain of the reason. If it's confirmed that the value is used via XCom, I’ll definitely keep it. That said, I’m curious—are there cases where it's used in XCom but the operator doesn't return anything? For example, salesforce_to_s3.py and glacier_to_gcs.py return values, while ftp_to_s3.py and dynamodb_to_s3.py don’t. I’d appreciate any guidance or examples you might have! -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] feat: Added files to introduce exasol connection and do some chores [airflow]
o-nikolas commented on code in PR #48120: URL: https://github.com/apache/airflow/pull/48120#discussion_r2010580704 ## 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: Fair enough, I think the AWS credentials make sense because these are AWS system tests. So it is safe to assume you at least need credentials setup for an AWS account otherwise every single test will fail. I also don't know of another test that we have that works like this (silently assuming you setup credentials/connection), so this would be kind of setting a precedent. I'm okay to start moving this way if others also like it, but it's certainly less explicit and could leave a lot of people scratching their heads. If we want to keep it like this maybe we at least put a comment here explaining that this task will not work as provided and then link to the new (and very nice! :smile:) documentation on how to setup the Exasol connection? -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] feat: Added files to introduce exasol connection and do some chores [airflow]
vincbeck commented on code in PR #48120: URL: https://github.com/apache/airflow/pull/48120#discussion_r2010564922 ## 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: I can see both sides to be honest. For all AWS operators we also assume the user has valid AWS credentials. Same for Google etc. I am not sure this is wrong to assume the user needs valid Exasol credentials -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] feat: Added files to introduce exasol connection and do some chores [airflow]
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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
Re: [PR] feat: Added files to introduce exasol connection and do some chores [airflow]
vincbeck commented on code in PR #48120: URL: https://github.com/apache/airflow/pull/48120#discussion_r2010157451 ## 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") Review Comment: Please keep the original state -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org