airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [airflow] mik-laj commented on a change in pull request #5951: [AIRFLOW-5347] Add system tests for GoogleCloudStorage
Date Sun, 01 Sep 2019 08:59:03 GMT
mik-laj commented on a change in pull request #5951: [AIRFLOW-5347] Add system tests for GoogleCloudStorage
URL: https://github.com/apache/airflow/pull/5951#discussion_r319750163
 
 

 ##########
 File path: airflow/contrib/example_dags/example_gcs.py
 ##########
 @@ -0,0 +1,80 @@
+# -*- coding: utf-8 -*-
+#
+# 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 Airflow DAG for Google Cloud Storage operators.
+"""
+
+import os
+import airflow
+from airflow import models
+from airflow.operators.bash_operator import BashOperator
+from airflow.contrib.operators.gcs_operator import (
+    GoogleCloudStorageCreateBucketOperator,
+)
+from airflow.contrib.operators.gcs_list_operator import GoogleCloudStorageListOperator
+from airflow.contrib.operators.gcs_download_operator import (
+    GoogleCloudStorageDownloadOperator,
+)
+from airflow.contrib.operators.gcs_delete_operator import (
+    GoogleCloudStorageDeleteOperator,
+)
+from airflow.operators.local_to_gcs import FileToGoogleCloudStorageOperator
+
+default_args = {"start_date": airflow.utils.dates.days_ago(1)}
+
+BUCKET = os.environ.get("GCP_GCS_BUCKET", "test-gcs-example-bucket")
+PROJECT_ID = os.environ.get("GCP_PROJECT_ID", "an-id")
 
 Review comment:
   ```suggestion
   PROJECT_ID = os.environ.get("GCP_PROJECT_ID", "example-project")
   ```

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


With regards,
Apache Git Services

Mime
View raw message