Skip to content

Commit e172bd0

Browse files
authored
Update docstrings to adhere to sphinx standards (#14918)
1 parent fc32d36 commit e172bd0

19 files changed

Lines changed: 54 additions & 69 deletions

airflow/providers/amazon/aws/transfers/dynamodb_to_s3.py

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -61,34 +61,40 @@ class DynamoDBToS3Operator(BaseOperator):
6161
To parallelize the replication, users can create multiple tasks of DynamoDBToS3Operator.
6262
For instance to replicate with parallelism of 2, create two tasks like:
6363
64-
.. code-block::
65-
66-
op1 = DynamoDBToS3Operator(
67-
task_id='replicator-1',
68-
dynamodb_table_name='hello',
69-
dynamodb_scan_kwargs={
70-
'TotalSegments': 2,
71-
'Segment': 0,
72-
},
73-
...
74-
)
75-
76-
op2 = DynamoDBToS3Operator(
77-
task_id='replicator-2',
78-
dynamodb_table_name='hello',
79-
dynamodb_scan_kwargs={
80-
'TotalSegments': 2,
81-
'Segment': 1,
82-
},
83-
...
84-
)
64+
.. code-block:: python
65+
66+
op1 = DynamoDBToS3Operator(
67+
task_id='replicator-1',
68+
dynamodb_table_name='hello',
69+
dynamodb_scan_kwargs={
70+
'TotalSegments': 2,
71+
'Segment': 0,
72+
},
73+
...
74+
)
75+
76+
op2 = DynamoDBToS3Operator(
77+
task_id='replicator-2',
78+
dynamodb_table_name='hello',
79+
dynamodb_scan_kwargs={
80+
'TotalSegments': 2,
81+
'Segment': 1,
82+
},
83+
...
84+
)
8585
8686
:param dynamodb_table_name: Dynamodb table to replicate data from
87+
:type dynamodb_table_name: str
8788
:param s3_bucket_name: S3 bucket to replicate data to
89+
:type s3_bucket_name: str
8890
:param file_size: Flush file to s3 if file size >= file_size
91+
:type file_size: int
8992
:param dynamodb_scan_kwargs: kwargs pass to <https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/dynamodb.html#DynamoDB.Table.scan> # noqa: E501 pylint: disable=line-too-long
93+
:type dynamodb_scan_kwargs: Optional[Dict[str, Any]]
9094
:param s3_key_prefix: Prefix of s3 object key
95+
:type s3_key_prefix: Optional[str]
9196
:param process_func: How we transforms a dynamodb item to bytes. By default we dump the json
97+
:type process_func: Callable[[Dict[str, Any]], bytes]
9298
"""
9399

94100
@apply_defaults

airflow/providers/amazon/aws/transfers/glacier_to_gcs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class GlacierToGCSOperator(BaseOperator):
6363
If set as a sequence, the identities from the list must grant
6464
Service Account Token Creator IAM role to the directly preceding identity, with first
6565
account from the list granting this role to the originating account (templated).
66-
:type impersonation_chain: Union[str, Sequence[str]]
66+
:type google_impersonation_chain: Union[str, Sequence[str]]
6767
"""
6868

6969
template_fields = ("vault_name", "bucket_name", "object_name")

airflow/providers/amazon/aws/transfers/s3_to_ftp.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ class S3ToFTPOperator(BaseOperator):
3434
:param ftp_path: The ftp remote path. This is the specified file path for
3535
uploading file to the FTP server.
3636
:type ftp_path: str
37-
:param s3_conn_id: The s3 connection id. The name or identifier for
38-
establishing a connection to S3.
39-
:type s3_conn_id: str
4037
:param s3_bucket: The targeted s3 bucket. This is the S3 bucket from
4138
where the file is downloaded.
4239
:type s3_bucket: str

airflow/providers/google/cloud/operators/bigquery.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,10 @@ class BigQueryIntervalCheckOperator(_BigQueryDbHookMixin, SQLIntervalCheckOperat
283283
:param days_back: number of days between ds and the ds we want to check
284284
against. Defaults to 7 days
285285
:type days_back: int
286-
:param metrics_threshold: a dictionary of ratios indexed by metrics, for
286+
:param metrics_thresholds: a dictionary of ratios indexed by metrics, for
287287
example 'COUNT(*)': 1.5 would require a 50 percent or less difference
288288
between the current day, and the prior days_back.
289-
:type metrics_threshold: dict
289+
:type metrics_thresholds: dict
290290
:param use_legacy_sql: Whether to use legacy SQL (true)
291291
or standard SQL (false).
292292
:type use_legacy_sql: bool

airflow/providers/google/cloud/operators/compute.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ class ComputeEngineStartInstanceOperator(ComputeEngineBaseOperator):
8989
:param api_version: Optional, API version used (for example v1 - or beta). Defaults
9090
to v1.
9191
:type api_version: str
92-
:param validate_body: Optional, If set to False, body validation is not performed.
93-
Defaults to False.
9492
:param impersonation_chain: Optional service account to impersonate using short-term
9593
credentials, or chained list of accounts required to get the access_token
9694
of the last account in the list, which will be impersonated in the request.
@@ -166,8 +164,6 @@ class ComputeEngineStopInstanceOperator(ComputeEngineBaseOperator):
166164
:param api_version: Optional, API version used (for example v1 - or beta). Defaults
167165
to v1.
168166
:type api_version: str
169-
:param validate_body: Optional, If set to False, body validation is not performed.
170-
Defaults to False.
171167
:param impersonation_chain: Optional service account to impersonate using short-term
172168
credentials, or chained list of accounts required to get the access_token
173169
of the last account in the list, which will be impersonated in the request.
@@ -553,9 +549,6 @@ class ComputeEngineInstanceGroupUpdateManagerTemplateOperator(ComputeEngineBaseO
553549
:param api_version: Optional, API version used (for example v1 - or beta). Defaults
554550
to v1.
555551
:type api_version: str
556-
:param validate_body: Optional, If set to False, body validation is not performed.
557-
Defaults to False.
558-
:type validate_body: bool
559552
:param impersonation_chain: Optional service account to impersonate using short-term
560553
credentials, or chained list of accounts required to get the access_token
561554
of the last account in the list, which will be impersonated in the request.

airflow/providers/google/cloud/operators/datacatalog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1413,7 +1413,7 @@ class CloudDataCatalogListTagsOperator(BaseOperator):
14131413
:type location: str
14141414
:param entry_group: Required. The entry group of the tags to get.
14151415
:type entry_group: str
1416-
:param entry_group: Required. The entry of the tags to get.
1416+
:param entry: Required. The entry of the tags to get.
14171417
:type entry: str
14181418
:param page_size: The maximum number of resources contained in the underlying API response. If page
14191419
streaming is performed per- resource, this parameter does not affect the return value. If page

airflow/providers/google/cloud/operators/dataflow.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,7 @@ class DataflowTemplatedJobStartOperator(BaseOperator):
492492
:type template: str
493493
:param job_name: The 'jobName' to use when executing the DataFlow template
494494
(templated).
495+
:type job_name: Optional[str]
495496
:param options: Map of job runtime environment options.
496497
It will update environment argument if passed.
497498
@@ -529,7 +530,7 @@ class DataflowTemplatedJobStartOperator(BaseOperator):
529530
Service Account Token Creator IAM role to the directly preceding identity, with first
530531
account from the list granting this role to the originating account (templated).
531532
:type impersonation_chain: Union[str, Sequence[str]]
532-
:type environment: Optional, Map of job runtime environment options.
533+
:param environment: Optional, Map of job runtime environment options.
533534
534535
.. seealso::
535536
For more information on possible configurations, look at the API documentation
@@ -849,7 +850,7 @@ class DataflowStartSqlJobOperator(BaseOperator):
849850
<gcloud beta dataflow sql query>`__
850851
command reference
851852
852-
:param options: dict
853+
:type options: dict
853854
:param location: The location of the Dataflow job (for example europe-west1)
854855
:type location: str
855856
:param project_id: The ID of the GCP project that owns the job.

airflow/providers/google/cloud/operators/dataprep.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,11 @@ class DataprepRunJobGroupOperator(BaseOperator):
110110
For more information on how to use this operator, take a look at the guide:
111111
:ref:`howto/operator:DataprepRunJobGroupOperator`
112112
113-
:param recipe_id: The identifier for the recipe you would like to run.
114-
:type recipe_id: int
113+
:param dataprep_conn_id: The Dataprep connection ID
114+
:type dataprep_conn_id: str
115+
:param body_request: Passed as the body_request to GoogleDataprepHook's run_job_group,
116+
where it's the identifier for the recipe to run
117+
:type body_request: dict
115118
"""
116119

117120
template_fields = ("body_request",)

airflow/providers/google/cloud/operators/dataproc.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1630,9 +1630,6 @@ class DataprocInstantiateWorkflowTemplateOperator(BaseOperator):
16301630
``Job`` created and stored in the backend is returned.
16311631
It is recommended to always set this value to a UUID.
16321632
:type request_id: str
1633-
:param parameters: Optional. Map from parameter names to values that should be used for those
1634-
parameters. Values may not exceed 100 characters.
1635-
:type parameters: Dict[str, str]
16361633
:param retry: A retry object used to retry requests. If ``None`` is specified, requests will not be
16371634
retried.
16381635
:type retry: google.api_core.retry.Retry
@@ -1733,9 +1730,6 @@ class DataprocInstantiateInlineWorkflowTemplateOperator(BaseOperator):
17331730
``Job`` created and stored in the backend is returned.
17341731
It is recommended to always set this value to a UUID.
17351732
:type request_id: str
1736-
:param parameters: Optional. Map from parameter names to values that should be used for those
1737-
parameters. Values may not exceed 100 characters.
1738-
:type parameters: Dict[str, str]
17391733
:param retry: A retry object used to retry requests. If ``None`` is specified, requests will not be
17401734
retried.
17411735
:type retry: google.api_core.retry.Retry

airflow/providers/google/cloud/operators/life_sciences.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class LifeSciencesRunPipelineOperator(BaseOperator):
3939
:type location: str
4040
:param project_id: ID of the Google Cloud project if None then
4141
default project_id is used.
42-
:param project_id: str
42+
:type project_id: str
4343
:param gcp_conn_id: The connection ID to use to connect to Google Cloud.
4444
:type gcp_conn_id: str
4545
:param api_version: API version used (for example v2beta).

0 commit comments

Comments
 (0)