# Version: Airflow: apache-airflow-backport-providers-google==2020.11.13

## Problem 
The operator gcs to bigquery fails because it calls the method download with positional parameters in the wrong order. 
It calls in this way `gcs_hook.download(self.bucket, self.schema_object)`. See more in the [line](https://github.com/apache/airflow/blob/master/airflow/providers/google/cloud/transfers/gcs_to_bigquery.py#L267)

The signature for the download is `gcs_hook.download(self, object_name, bucket_name)`. See more in the [line ](https://github.com/apache/airflow/blob/master/airflow/providers/google/cloud/hooks/gcs.py#L259-L261)

## Solution

1.  Change the [gcs_to_bigquery](https://github.com/apache/airflow/blob/master/airflow/providers/google/cloud/transfers/gcs_to_bigquery.py#L267) operator so it  calls the method download with the keyword parameters rather than positional.
2. Change the [gcs_to_bigquery](https://github.com/apache/airflow/blob/master/airflow/providers/google/cloud/transfers/gcs_to_bigquery.py#L267) operator so it calls the method download with the right order of the parameters. 
3. Change the signature of download method in the [gcs_hook](https://github.com/apache/airflow/blob/master/airflow/providers/google/cloud/hooks/gcs.py#L353-L361)  to be `def download(self, bucket_name, object_name, filename)` rather than `def dowload(self, object_name, bucket_name, filename)` 

I would prefer the option 3 because the method upload start with bucket_name see [line]( https://github.com/apache/airflow/blob/master/airflow/providers/google/cloud/hooks/gcs.py#L353-L361) and it makes sense to follow the same convention. Also most of the method in the gcs hook start with bucket name. 

Also in Airflow 1.10.12 the method download starts with bucket_name and it would make sense not to change the order of the parameters (even if it change the name of the parameters). See [here](https://airflow.apache.org/docs/stable/_api/airflow/contrib/hooks/gcs_hook/index.html#airflow.contrib.hooks.gcs_hook.GoogleCloudStorageHook.download)

## Issues Related
This issue is related with https://github.com/apache/airflow/issues/12335. It was closed but it was not fixed. I left a comments but there was not reply.
airflow/providers/google/cloud/transfers/gcs_to_bigquery.py
a BigQuery external table. Default Value is False.
    :type external_table: bool
    :param time_partitioning: configure optional time partitioning fields i.e.
        partition by field, type and  expiration as per API specifications.
        Note that 'field' is not available in concurrency with
        dataset.table$partition.
    :type time_partitioning: dict
    :param cluster_fields: Request that the result of this load be stored sorted
        by one or more columns. BigQuery supports clustering for both partitioned and
        non-partitioned tables. The order of columns given determines the sort order.
        Not applicable for external tables.
    :type cluster_fields: list[str]
    :param autodetect: [Optional] Indicates if we should automatically infer the
        options and schema for CSV and JSON sources. (Default: ``True``).
        Parameter must be setted to True if 'schema_fields' and 'schema_object' are undefined.
        It is suggested to set to True if table are create outside of Airflow.
    :type autodetect: bool
    :param encryption_configuration: [Optional] Custom encryption configuration (e.g., Cloud KMS keys).
        **Example**: ::
            encryption_configuration = {
                "kmsKeyName": "projects/testp/locations/us/keyRings/test-kr/cryptoKeys/test-key"
            }
    :type encryption_configuration: dict
    :param location: [Optional] The geographic location of the job. Required except for US and EU.
        See details at https://cloud.google.com/bigquery/docs/locations#specifying_your_location
    :type location: str
    :param impersonation_chain: Optional service account to impersonate using short-term
        credentials, or chained list of accounts required to get the access_token
        of the last account in the list, which will be impersonated in the request.
        If set as a string, the account must grant the originating account