You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by fo...@apache.org on 2017/11/23 07:50:07 UTC

incubator-airflow git commit: [AIRFLOW-1841] change False to None in operator and hook

Repository: incubator-airflow
Updated Branches:
  refs/heads/master 2d5408935 -> cbd6e7041


[AIRFLOW-1841] change False to None in operator and hook

Documentation stated it's String type but in code
it was union of String and Bool.
Changed to to pure string by substituting False to
None since in operator and hook
code checks only for presence of value in
variable.
Make it more predictable by using simpler String
type.

Closes #2807 from litdeviant/gcs-operator-hook


Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/cbd6e704
Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/cbd6e704
Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/cbd6e704

Branch: refs/heads/master
Commit: cbd6e70411b276d4ad6bb471b3760a3f7925a548
Parents: 2d54089
Author: Igors Vaitkus <li...@protonmail.com>
Authored: Thu Nov 23 08:50:01 2017 +0100
Committer: Fokko Driesprong <fo...@godatadriven.com>
Committed: Thu Nov 23 08:50:01 2017 +0100

----------------------------------------------------------------------
 airflow/contrib/hooks/gcs_hook.py                  | 2 +-
 airflow/contrib/operators/gcs_download_operator.py | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/cbd6e704/airflow/contrib/hooks/gcs_hook.py
----------------------------------------------------------------------
diff --git a/airflow/contrib/hooks/gcs_hook.py b/airflow/contrib/hooks/gcs_hook.py
index 24c247e..546e028 100644
--- a/airflow/contrib/hooks/gcs_hook.py
+++ b/airflow/contrib/hooks/gcs_hook.py
@@ -85,7 +85,7 @@ class GoogleCloudStorageHook(GoogleCloudBaseHook):
 
 
     # pylint:disable=redefined-builtin
-    def download(self, bucket, object, filename=False):
+    def download(self, bucket, object, filename=None):
         """
         Get a file from Google Cloud Storage.
 

http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/cbd6e704/airflow/contrib/operators/gcs_download_operator.py
----------------------------------------------------------------------
diff --git a/airflow/contrib/operators/gcs_download_operator.py b/airflow/contrib/operators/gcs_download_operator.py
index 6f47833..e02656c 100644
--- a/airflow/contrib/operators/gcs_download_operator.py
+++ b/airflow/contrib/operators/gcs_download_operator.py
@@ -30,12 +30,12 @@ class GoogleCloudStorageDownloadOperator(BaseOperator):
     :type object: string
     :param filename: The file path on the local file system (where the
         operator is being executed) that the file should be downloaded to.
-        If false, the downloaded data will not be stored on the local file
+        If no filename passed, the downloaded data will not be stored on the local file
         system.
     :type filename: string
     :param store_to_xcom_key: If this param is set, the operator will push
         the contents of the downloaded file to XCom with the key set in this
-        parameter. If false, the downloaded data will not be pushed to XCom.
+        parameter. If not set, the downloaded data will not be pushed to XCom.
     :type store_to_xcom_key: string
     :param google_cloud_storage_conn_id: The connection ID to use when
         connecting to Google cloud storage.
@@ -51,8 +51,8 @@ class GoogleCloudStorageDownloadOperator(BaseOperator):
     def __init__(self,
                  bucket,
                  object,
-                 filename=False,
-                 store_to_xcom_key=False,
+                 filename=None,
+                 store_to_xcom_key=None,
                  google_cloud_storage_conn_id='google_cloud_storage_default',
                  delegate_to=None,
                  *args,