Skip to content

Commit

Permalink
Add correct signatures for operators in google provider package (#10144)
Browse files Browse the repository at this point in the history
  • Loading branch information
ephraimbuddy authored Aug 4, 2020
1 parent 73a08ed commit 1437cb7
Show file tree
Hide file tree
Showing 42 changed files with 381 additions and 357 deletions.
2 changes: 1 addition & 1 deletion airflow/providers/google/ads/operators/ads.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class GoogleAdsListAccountsOperator(BaseOperator):

@apply_defaults
def __init__(
self,
self, *,
bucket: str,
object_name: str,
gcp_conn_id: str = "google_cloud_default",
Expand Down
26 changes: 13 additions & 13 deletions airflow/providers/google/cloud/operators/automl.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class AutoMLTrainModelOperator(BaseOperator):

@apply_defaults
def __init__(
self,
self, *,
model: dict,
location: str,
project_id: Optional[str] = None,
Expand Down Expand Up @@ -138,7 +138,7 @@ class AutoMLPredictOperator(BaseOperator):

@apply_defaults
def __init__(
self,
self, *,
model_id: str,
location: str,
payload: dict,
Expand Down Expand Up @@ -230,7 +230,7 @@ class AutoMLBatchPredictOperator(BaseOperator):

@apply_defaults
def __init__( # pylint: disable=too-many-arguments
self,
self, *,
model_id: str,
input_config: dict,
output_config: dict,
Expand Down Expand Up @@ -309,7 +309,7 @@ class AutoMLCreateDatasetOperator(BaseOperator):

@apply_defaults
def __init__(
self,
self, *,
dataset: dict,
location: str,
project_id: Optional[str] = None,
Expand Down Expand Up @@ -384,7 +384,7 @@ class AutoMLImportDataOperator(BaseOperator):

@apply_defaults
def __init__(
self,
self, *,
dataset_id: str,
location: str,
input_config: dict,
Expand Down Expand Up @@ -474,7 +474,7 @@ class AutoMLTablesListColumnSpecsOperator(BaseOperator):

@apply_defaults
def __init__( # pylint: disable=too-many-arguments
self,
self, *,
dataset_id: str,
table_spec_id: str,
location: str,
Expand Down Expand Up @@ -556,7 +556,7 @@ class AutoMLTablesUpdateDatasetOperator(BaseOperator):

@apply_defaults
def __init__(
self,
self, *,
dataset: dict,
location: str,
update_mask: Optional[dict] = None,
Expand Down Expand Up @@ -623,7 +623,7 @@ class AutoMLGetModelOperator(BaseOperator):

@apply_defaults
def __init__(
self,
self, *,
model_id: str,
location: str,
project_id: Optional[str] = None,
Expand Down Expand Up @@ -689,7 +689,7 @@ class AutoMLDeleteModelOperator(BaseOperator):

@apply_defaults
def __init__(
self,
self, *,
model_id: str,
location: str,
project_id: Optional[str] = None,
Expand Down Expand Up @@ -765,7 +765,7 @@ class AutoMLDeployModelOperator(BaseOperator):

@apply_defaults
def __init__(
self,
self, *,
model_id: str,
location: str,
project_id: Optional[str] = None,
Expand Down Expand Up @@ -844,7 +844,7 @@ class AutoMLTablesListTableSpecsOperator(BaseOperator):

@apply_defaults
def __init__(
self,
self, *,
dataset_id: str,
location: str,
page_size: Optional[int] = None,
Expand Down Expand Up @@ -915,7 +915,7 @@ class AutoMLListDatasetOperator(BaseOperator):

@apply_defaults
def __init__(
self,
self, *,
location: str,
project_id: Optional[str] = None,
metadata: Optional[MetaData] = None,
Expand Down Expand Up @@ -985,7 +985,7 @@ class AutoMLDeleteDatasetOperator(BaseOperator):

@apply_defaults
def __init__(
self,
self, *,
dataset_id: Union[str, List[str]],
location: str,
project_id: Optional[str] = None,
Expand Down
27 changes: 15 additions & 12 deletions airflow/providers/google/cloud/operators/bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class BigQueryCheckOperator(CheckOperator):

@apply_defaults
def __init__(
self,
self, *,
sql: str,
gcp_conn_id: str = 'google_cloud_default',
bigquery_conn_id: Optional[str] = None,
Expand Down Expand Up @@ -196,7 +196,7 @@ class BigQueryValueCheckOperator(ValueCheckOperator):

@apply_defaults
def __init__(
self,
self, *,
sql: str,
pass_value: Any,
tolerance: Any = None,
Expand Down Expand Up @@ -270,7 +270,7 @@ class BigQueryIntervalCheckOperator(IntervalCheckOperator):

@apply_defaults
def __init__(
self,
self, *,
table: str,
metrics_thresholds: dict,
date_filter_column: str = 'ds',
Expand Down Expand Up @@ -364,7 +364,7 @@ class BigQueryGetDataOperator(BaseOperator):

@apply_defaults
def __init__(
self,
self, *,
dataset_id: str,
table_id: str,
max_results: int = 100,
Expand Down Expand Up @@ -528,6 +528,7 @@ def operator_extra_links(self):
# pylint: disable=too-many-arguments, too-many-locals
@apply_defaults
def __init__(self,
*,
sql: Union[str, Iterable],
destination_dataset_table: Optional[str] = None,
write_disposition: Optional[str] = 'WRITE_EMPTY',
Expand Down Expand Up @@ -783,7 +784,7 @@ class BigQueryCreateEmptyTableOperator(BaseOperator):
# pylint: disable=too-many-arguments
@apply_defaults
def __init__(
self,
self, *,
dataset_id: str,
table_id: str,
table_resource: Optional[Dict[str, Any]] = None,
Expand Down Expand Up @@ -962,7 +963,7 @@ class BigQueryCreateExternalTableOperator(BaseOperator):
# pylint: disable=too-many-arguments,too-many-locals
@apply_defaults
def __init__(
self,
self, *,
bucket: str,
source_objects: List,
destination_project_dataset_table: str,
Expand Down Expand Up @@ -1130,7 +1131,7 @@ class BigQueryDeleteDatasetOperator(BaseOperator):

@apply_defaults
def __init__(
self,
self, *,
dataset_id: str,
project_id: Optional[str] = None,
delete_contents: bool = False,
Expand Down Expand Up @@ -1210,6 +1211,7 @@ class BigQueryCreateEmptyDatasetOperator(BaseOperator):

@apply_defaults
def __init__(self,
*,
dataset_id: Optional[str] = None,
project_id: Optional[str] = None,
dataset_reference: Optional[Dict] = None,
Expand Down Expand Up @@ -1279,6 +1281,7 @@ class BigQueryGetDatasetOperator(BaseOperator):

@apply_defaults
def __init__(self,
*,
dataset_id: str,
project_id: Optional[str] = None,
gcp_conn_id: str = 'google_cloud_default',
Expand Down Expand Up @@ -1329,7 +1332,7 @@ class BigQueryGetDatasetTablesOperator(BaseOperator):

@apply_defaults
def __init__(
self,
self, *,
dataset_id: str,
project_id: Optional[str] = None,
max_results: Optional[int] = None,
Expand Down Expand Up @@ -1386,7 +1389,7 @@ class BigQueryPatchDatasetOperator(BaseOperator):

@apply_defaults
def __init__(
self,
self, *,
dataset_id: str,
dataset_resource: dict,
project_id: Optional[str] = None,
Expand Down Expand Up @@ -1453,7 +1456,7 @@ class BigQueryUpdateDatasetOperator(BaseOperator):

@apply_defaults
def __init__(
self,
self, *,
dataset_resource: dict,
fields: Optional[List[str]] = None,
dataset_id: Optional[str] = None,
Expand Down Expand Up @@ -1518,7 +1521,7 @@ class BigQueryDeleteTableOperator(BaseOperator):

@apply_defaults
def __init__(
self,
self, *,
deletion_dataset_table: str,
gcp_conn_id: str = 'google_cloud_default',
bigquery_conn_id: Optional[str] = None,
Expand Down Expand Up @@ -1589,7 +1592,7 @@ class BigQueryUpsertTableOperator(BaseOperator):

@apply_defaults
def __init__(
self,
self, *,
dataset_id: str,
table_resource: dict,
project_id: Optional[str] = None,
Expand Down
6 changes: 3 additions & 3 deletions airflow/providers/google/cloud/operators/bigquery_dts.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class BigQueryCreateDataTransferOperator(BaseOperator):

@apply_defaults
def __init__(
self,
self, *,
transfer_config: dict,
project_id: Optional[str] = None,
authorization_code: Optional[str] = None,
Expand Down Expand Up @@ -132,7 +132,7 @@ class BigQueryDeleteDataTransferConfigOperator(BaseOperator):

@apply_defaults
def __init__(
self,
self, *,
transfer_config_id: str,
project_id: Optional[str] = None,
retry: Retry = None,
Expand Down Expand Up @@ -208,7 +208,7 @@ class BigQueryDataTransferServiceStartTransferRunsOperator(BaseOperator):

@apply_defaults
def __init__(
self,
self, *,
transfer_config_id: str,
project_id: Optional[str] = None,
requested_time_range: Optional[dict] = None,
Expand Down
10 changes: 5 additions & 5 deletions airflow/providers/google/cloud/operators/bigtable.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class BigtableCreateInstanceOperator(BaseOperator, BigtableValidationMixin):
template_fields: Iterable[str] = ['project_id', 'instance_id', 'main_cluster_id', 'main_cluster_zone']

@apply_defaults
def __init__(self, # pylint: disable=too-many-arguments
def __init__(self, *, # pylint: disable=too-many-arguments
instance_id: str,
main_cluster_id: str,
main_cluster_zone: str,
Expand Down Expand Up @@ -181,7 +181,7 @@ class BigtableDeleteInstanceOperator(BaseOperator, BigtableValidationMixin):
template_fields = ['project_id', 'instance_id'] # type: Iterable[str]

@apply_defaults
def __init__(self,
def __init__(self, *,
instance_id: str,
project_id: Optional[str] = None,
gcp_conn_id: str = 'google_cloud_default',
Expand Down Expand Up @@ -241,7 +241,7 @@ class BigtableCreateTableOperator(BaseOperator, BigtableValidationMixin):
template_fields = ['project_id', 'instance_id', 'table_id'] # type: Iterable[str]

@apply_defaults
def __init__(self,
def __init__(self, *,
instance_id: str,
table_id: str,
project_id: Optional[str] = None,
Expand Down Expand Up @@ -331,7 +331,7 @@ class BigtableDeleteTableOperator(BaseOperator, BigtableValidationMixin):
template_fields = ['project_id', 'instance_id', 'table_id'] # type: Iterable[str]

@apply_defaults
def __init__(self,
def __init__(self, *,
instance_id: str,
table_id: str,
project_id: Optional[str] = None,
Expand Down Expand Up @@ -396,7 +396,7 @@ class BigtableUpdateClusterOperator(BaseOperator, BigtableValidationMixin):
template_fields = ['project_id', 'instance_id', 'cluster_id', 'nodes'] # type: Iterable[str]

@apply_defaults
def __init__(self,
def __init__(self, *,
instance_id: str,
cluster_id: str,
nodes: int,
Expand Down
2 changes: 1 addition & 1 deletion airflow/providers/google/cloud/operators/cloud_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class CloudBuildCreateBuildOperator(BaseOperator):
template_ext = ['.yml', '.yaml', '.json']

@apply_defaults
def __init__(self,
def __init__(self, *,
body: Union[dict, str],
project_id: Optional[str] = None,
gcp_conn_id: str = "google_cloud_default",
Expand Down
Loading

0 comments on commit 1437cb7

Please sign in to comment.
  翻译: