You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/03/09 14:44:23 UTC

[GitHub] [airflow] nvembar opened a new issue #14682: The S3ToGCSOperator fails on templated `dest_gcs` URL

nvembar opened a new issue #14682:
URL: https://github.com/apache/airflow/issues/14682


   <!--
   
   Welcome to Apache Airflow!  For a smooth issue process, try to answer the following questions.
   Don't worry if they're not all applicable; just try to include what you can :-)
   
   If you need to include code snippets or logs, please put them in fenced code
   blocks.  If they're super-long, please use the details tag like
   <details><summary>super-long log</summary> lots of stuff </details>
   
   Please delete these comment blocks before submitting the issue.
   
   -->
   
   <!--
   
   IMPORTANT!!!
   
   PLEASE CHECK "SIMILAR TO X EXISTING ISSUES" OPTION IF VISIBLE
   NEXT TO "SUBMIT NEW ISSUE" BUTTON!!!
   
   PLEASE CHECK IF THIS ISSUE HAS BEEN REPORTED PREVIOUSLY USING SEARCH!!!
   
   Please complete the next sections or the issue will be closed.
   These questions are the first thing we need to know to understand the context.
   
   -->
   
   **Apache Airflow version**:
   
   
   **Kubernetes version (if you are using kubernetes)** (use `kubectl version`):
   
   **Environment**:
   
   - **Cloud provider or hardware configuration**:
   - **OS** (e.g. from /etc/os-release):
   - **Kernel** (e.g. `uname -a`):
   - **Install tools**: Docker
   
   **What happened**:
   
   When passing a templatized `dest_gcs` argument to the `S3ToGCSOperator` operator, the DAG fails to import because the constructor attempts to test the validity of the URL before the template has been populated in `execute`.
   
   The error is:
   
   ```
   Broken DAG: [/opt/airflow/dags/bad_gs_dag.py] Traceback (most recent call last):
     File "/home/airflow/.local/lib/python3.8/site-packages/airflow/providers/google/cloud/hooks/gcs.py", line 1051, in gcs_object_is_directory
       _, blob = _parse_gcs_url(bucket)
     File "/home/airflow/.local/lib/python3.8/site-packages/airflow/providers/google/cloud/hooks/gcs.py", line 1063, in _parse_gcs_url
       raise AirflowException('Please provide a bucket name')
   airflow.exceptions.AirflowException: Please provide a bucket name
   ```
   
   **What you expected to happen**:
   
   The DAG should successfully parse when using a templatized `dest_gcs` value.
   
   **How to reproduce it**:
   
   Instantiating a `S3ToGCSOperator` task with `dest_gcs="{{ var.gcs_url }}"` fails. 
   
   <details>
   
   ```python
   from airflow.decorators import dag
   from airflow.utils.dates import days_ago
   from airflow.providers.google.cloud.transfers.s3_to_gcs import S3ToGCSOperator
   
   
   @dag(
       schedule_interval=None,
       description="Demo S3-to-GS Bug",
       catchup=False,
       start_date=days_ago(1),
   )
   def demo_bug():
   
       S3ToGCSOperator(
           task_id="transfer_task",
           bucket="example_bucket",
           prefix="fake/prefix",
           dest_gcs="{{ var.gcs_url }}",
       )
   
   
   demo_dag = demo_bug()
   ```
   </details>
   
   
   **Anything else we need to know**:
   
   Should be fixable by moving the code that evaluates whether the URL is a folder to `execute()`.
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] TobKed commented on issue #14682: The S3ToGCSOperator fails on templated `dest_gcs` URL

Posted by GitBox <gi...@apache.org>.
TobKed commented on issue #14682:
URL: https://github.com/apache/airflow/issues/14682#issuecomment-813072942


   It may be the same case for `AzureFileShareToGCSOperator`


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] eladkal closed issue #14682: The S3ToGCSOperator fails on templated `dest_gcs` URL

Posted by GitBox <gi...@apache.org>.
eladkal closed issue #14682:
URL: https://github.com/apache/airflow/issues/14682


   


-- 
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-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] boring-cyborg[bot] commented on issue #14682: The S3ToGCSOperator fails on templated `dest_gcs` URL

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #14682:
URL: https://github.com/apache/airflow/issues/14682#issuecomment-793989193


   Thanks for opening your first issue here! Be sure to follow the issue template!
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org