[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
This commit is contained in:
Igors Vaitkus 2017-11-23 08:50:01 +01:00 коммит произвёл Fokko Driesprong
Родитель 2d5408935f
Коммит cbd6e70411
2 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

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

Просмотреть файл

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