Skip to content

Commit a7ca1b3

Browse files
authored
Fix Sphinx Issues with Docstrings (#14968)
This PR fix some typos and issues were the doctrings do not adhere to sphinx standards in the following modules: - AWSDataSyncOperator - S3KeySizeSensor - DatadogHook - DatadogSensor - ComputeEngineSSHHook - CloudDataCatalogLookupEntryOperator - GoogleDisplayVideo360UploadLineItemsOperator - GoogleDisplayVideo360CreateSDFDownloadTaskOperator - GoogleDisplayVideo360SDFtoGCSOperator - AzureBatchOperator - AzureCosmosDocumentSensor - SingularityOperator - SlackAPIOperator - DataprocCreateMapReduceJobOperator - DataprocCreateSparkJobOperator - DataprocCreatePysparkJobOperator
1 parent 0e43b60 commit a7ca1b3

File tree

12 files changed

+76
-74
lines changed

12 files changed

+76
-74
lines changed

β€Žairflow/providers/amazon/aws/operators/datasync.py

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,48 +42,61 @@ class AWSDataSyncOperator(BaseOperator):
4242
environment. The default behavior is to create a new Task if there are 0, or
4343
execute the Task if there was 1 Task, or fail if there were many Tasks.
4444
45-
:param str aws_conn_id: AWS connection to use.
46-
:param int wait_interval_seconds: Time to wait between two
45+
:param aws_conn_id: AWS connection to use.
46+
:type aws_conn_id: str
47+
:param wait_interval_seconds: Time to wait between two
4748
consecutive calls to check TaskExecution status.
48-
:param str task_arn: AWS DataSync TaskArn to use. If None, then this operator will
49+
:type wait_interval_seconds: int
50+
:param task_arn: AWS DataSync TaskArn to use. If None, then this operator will
4951
attempt to either search for an existing Task or attempt to create a new Task.
50-
:param str source_location_uri: Source location URI to search for. All DataSync
52+
:type task_arn: str
53+
:param source_location_uri: Source location URI to search for. All DataSync
5154
Tasks with a LocationArn with this URI will be considered.
5255
Example: ``smb://server/subdir``
53-
:param str destination_location_uri: Destination location URI to search for.
56+
:type source_location_uri: str
57+
:param destination_location_uri: Destination location URI to search for.
5458
All DataSync Tasks with a LocationArn with this URI will be considered.
5559
Example: ``s3://airflow_bucket/stuff``
56-
:param bool allow_random_task_choice: If multiple Tasks match, one must be chosen to
60+
:type destination_location_uri: str
61+
:param allow_random_task_choice: If multiple Tasks match, one must be chosen to
5762
execute. If allow_random_task_choice is True then a random one is chosen.
58-
:param bool allow_random_location_choice: If multiple Locations match, one must be chosen
63+
:type allow_random_task_choice: bool
64+
:param allow_random_location_choice: If multiple Locations match, one must be chosen
5965
when creating a task. If allow_random_location_choice is True then a random one is chosen.
60-
:param dict create_task_kwargs: If no suitable TaskArn is identified,
66+
:type allow_random_location_choice: bool
67+
:param create_task_kwargs: If no suitable TaskArn is identified,
6168
it will be created if ``create_task_kwargs`` is defined.
6269
``create_task_kwargs`` is then used internally like this:
6370
``boto3.create_task(**create_task_kwargs)``
6471
Example: ``{'Name': 'xyz', 'Options': ..., 'Excludes': ..., 'Tags': ...}``
65-
:param dict create_source_location_kwargs: If no suitable LocationArn is found,
72+
:type create_task_kwargs: dict
73+
:param create_source_location_kwargs: If no suitable LocationArn is found,
6674
a Location will be created if ``create_source_location_kwargs`` is defined.
6775
``create_source_location_kwargs`` is then used internally like this:
6876
``boto3.create_location_xyz(**create_source_location_kwargs)``
6977
The xyz is determined from the prefix of source_location_uri, eg ``smb:/...`` or ``s3:/...``
7078
Example: ``{'Subdirectory': ..., 'ServerHostname': ..., ...}``
71-
:param dict create_destination_location_kwargs: If no suitable LocationArn is found,
79+
:type create_source_location_kwargs: dict
80+
:param create_destination_location_kwargs: If no suitable LocationArn is found,
7281
a Location will be created if ``create_destination_location_kwargs`` is defined.
7382
``create_destination_location_kwargs`` is used internally like this:
7483
``boto3.create_location_xyz(**create_destination_location_kwargs)``
7584
The xyz is determined from the prefix of destination_location_uri, eg ``smb:/...` or ``s3:/...``
7685
Example: ``{'S3BucketArn': ..., 'S3Config': {'BucketAccessRoleArn': ...}, ...}``
77-
:param dict update_task_kwargs: If a suitable TaskArn is found or created,
86+
:type create_destination_location_kwargs: dict
87+
:param update_task_kwargs: If a suitable TaskArn is found or created,
7888
it will be updated if ``update_task_kwargs`` is defined.
7989
``update_task_kwargs`` is used internally like this:
8090
``boto3.update_task(TaskArn=task_arn, **update_task_kwargs)``
8191
Example: ``{'Name': 'xyz', 'Options': ..., 'Excludes': ...}``
82-
:param dict task_execution_kwargs: Additional kwargs passed directly when starting the
92+
:type update_task_kwargs: dict
93+
:param task_execution_kwargs: Additional kwargs passed directly when starting the
8394
Task execution, used internally like this:
8495
``boto3.start_task_execution(TaskArn=task_arn, **task_execution_kwargs)``
85-
:param bool delete_task_after_execution: If True then the TaskArn which was executed
96+
:type task_execution_kwargs: dict
97+
:param delete_task_after_execution: If True then the TaskArn which was executed
8698
will be deleted from AWS DataSync on successful completion.
99+
:type delete_task_after_execution: bool
87100
:raises AirflowException: If ``task_arn`` was not specified, or if
88101
either ``source_location_uri`` or ``destination_location_uri`` were
89102
not specified.

β€Žairflow/providers/amazon/aws/sensors/s3_key.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ class S3KeySizeSensor(S3KeySensor):
148148
149149
def check_fn(self, data: List) -> bool:
150150
return any(f.get('Size', 0) > 1048576 for f in data if isinstance(f, dict))
151+
:type check_fn: Optional[Callable[..., bool]]
151152
"""
152153

153154
@apply_defaults

β€Žairflow/providers/datadog/hooks/datadog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class DatadogHook(BaseHook, LoggingMixin):
3636
Airflow runs.
3737
3838
:param datadog_conn_id: The connection to datadog, containing metadata for api keys.
39-
:param datadog_conn_id: str
39+
:type datadog_conn_id: str
4040
"""
4141

4242
def __init__(self, datadog_conn_id: str = 'datadog_default') -> None:

β€Žairflow/providers/datadog/sensors/datadog.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,23 @@ class DatadogSensor(BaseSensorOperator):
3434
Airflow runs.
3535
3636
:param datadog_conn_id: The connection to datadog, containing metadata for api keys.
37-
:param datadog_conn_id: str
37+
:type datadog_conn_id: str
38+
:param from_seconds_ago: POSIX timestamp start (default 3600).
39+
:type from_seconds_ago: int
40+
:param up_to_seconds_from_now: POSIX timestamp end (default 0).
41+
:type up_to_seconds_from_now: int
42+
:param priority: Priority of your events, either low or normal.
43+
:type priority: Optional[str]
44+
:param sources: A comma separated list indicating what tags, if any,
45+
should be used to filter the list of monitors by scope
46+
:type sources: Optional[str]
47+
:param tags: Get datadog events from specific sources.
48+
:type tags: Optional[List[str]]
49+
:param response_check: A check against the β€˜requests’ response object. The callable takes
50+
the response object as the first positional argument and optionally any number of
51+
keyword arguments available in the context dictionary. It should return True for
52+
β€˜pass’ and False otherwise.
53+
:param response_check: Optional[Callable[[Dict[str, Any]], bool]]
3854
"""
3955

4056
ui_color = '#66c3dd'

β€Žairflow/providers/google/cloud/hooks/compute_ssh.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ class ComputeEngineSSHHook(SSHHook):
8383
:type use_internal_ip: bool
8484
:param use_oslogin: Whether to manage keys using OsLogin API. If false,
8585
keys are managed using instance metadata
86+
:type use_oslogin: bool
8687
:param expire_time: The maximum amount of time in seconds before the private key expires
8788
:type expire_time: int
8889
:param gcp_conn_id: The connection id to use when fetching connection information

β€Žairflow/providers/google/marketing_platform/operators/display_video.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ class GoogleDisplayVideo360UploadLineItemsOperator(BaseOperator):
505505
:param filename: The filename to fetch.
506506
:type filename: str,
507507
:param dry_run: Upload status without actually persisting the line items.
508-
:type filename: str,
508+
:type dry_run: str,
509509
"""
510510

511511
template_fields = (
@@ -572,7 +572,7 @@ class GoogleDisplayVideo360CreateSDFDownloadTaskOperator(BaseOperator):
572572
Check also the official API docs:
573573
`https://developers.google.com/display-video/api/reference/rest`
574574
575-
:param version: The SDF version of the downloaded file..
575+
:param version: The SDF version of the downloaded file.
576576
:type version: str
577577
:param partner_id: The ID of the partner to download SDF for.
578578
:type partner_id: str
@@ -650,7 +650,7 @@ class GoogleDisplayVideo360SDFtoGCSOperator(BaseOperator):
650650
Check also the official API docs:
651651
`https://developers.google.com/display-video/api/reference/rest`
652652
653-
:param version: The SDF version of the downloaded file..
653+
:param version: The SDF version of the downloaded file.
654654
:type version: str
655655
:param partner_id: The ID of the partner to download SDF for.
656656
:type partner_id: str

β€Žairflow/providers/microsoft/azure/operators/azure_batch.py

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -33,129 +33,94 @@ class AzureBatchOperator(BaseOperator):
3333
3434
:param batch_pool_id: A string that uniquely identifies the Pool within the Account.
3535
:type batch_pool_id: str
36-
3736
:param batch_pool_vm_size: The size of virtual machines in the Pool
3837
:type batch_pool_vm_size: str
39-
4038
:param batch_job_id: A string that uniquely identifies the Job within the Account.
4139
:type batch_job_id: str
42-
4340
:param batch_task_command_line: The command line of the Task
44-
:type batch_command_line: str
45-
41+
:type batch_task_command_line: str
4642
:param batch_task_id: A string that uniquely identifies the task within the Job.
4743
:type batch_task_id: str
48-
4944
:param batch_pool_display_name: The display name for the Pool.
5045
The display name need not be unique
5146
:type batch_pool_display_name: Optional[str]
52-
5347
:param batch_job_display_name: The display name for the Job.
5448
The display name need not be unique
5549
:type batch_job_display_name: Optional[str]
56-
5750
:param batch_job_manager_task: Details of a Job Manager Task to be launched when the Job is started.
58-
:type job_manager_task: Optional[batch_models.JobManagerTask]
59-
51+
:type batch_job_manager_task: Optional[batch_models.JobManagerTask]
6052
:param batch_job_preparation_task: The Job Preparation Task. If set, the Batch service will
6153
run the Job Preparation Task on a Node before starting any Tasks of that
6254
Job on that Compute Node. Required if batch_job_release_task is set.
6355
:type batch_job_preparation_task: Optional[batch_models.JobPreparationTask]
64-
6556
:param batch_job_release_task: The Job Release Task. Use to undo changes to Compute Nodes
6657
made by the Job Preparation Task
6758
:type batch_job_release_task: Optional[batch_models.JobReleaseTask]
68-
6959
:param batch_task_display_name: The display name for the task.
7060
The display name need not be unique
7161
:type batch_task_display_name: Optional[str]
72-
7362
:param batch_task_container_settings: The settings for the container under which the Task runs
7463
:type batch_task_container_settings: Optional[batch_models.TaskContainerSettings]
75-
7664
:param batch_start_task: A Task specified to run on each Compute Node as it joins the Pool.
7765
The Task runs when the Compute Node is added to the Pool or
7866
when the Compute Node is restarted.
7967
:type batch_start_task: Optional[batch_models.StartTask]
80-
8168
:param batch_max_retries: The number of times to retry this batch operation before it's
8269
considered a failed operation. Default is 3
8370
:type batch_max_retries: int
84-
8571
:param batch_task_resource_files: A list of files that the Batch service will
8672
download to the Compute Node before running the command line.
8773
:type batch_task_resource_files: Optional[List[batch_models.ResourceFile]]
88-
8974
:param batch_task_output_files: A list of files that the Batch service will upload
9075
from the Compute Node after running the command line.
9176
:type batch_task_output_files: Optional[List[batch_models.OutputFile]]
92-
9377
:param batch_task_user_identity: The user identity under which the Task runs.
9478
If omitted, the Task runs as a non-administrative user unique to the Task.
9579
:type batch_task_user_identity: Optional[batch_models.UserIdentity]
96-
9780
:param target_low_priority_nodes: The desired number of low-priority Compute Nodes in the Pool.
9881
This property must not be specified if enable_auto_scale is set to true.
9982
:type target_low_priority_nodes: Optional[int]
100-
10183
:param target_dedicated_nodes: The desired number of dedicated Compute Nodes in the Pool.
10284
This property must not be specified if enable_auto_scale is set to true.
10385
:type target_dedicated_nodes: Optional[int]
104-
10586
:param enable_auto_scale: Whether the Pool size should automatically adjust over time. Default is false
10687
:type enable_auto_scale: bool
107-
10888
:param auto_scale_formula: A formula for the desired number of Compute Nodes in the Pool.
10989
This property must not be specified if enableAutoScale is set to false.
11090
It is required if enableAutoScale is set to true.
11191
:type auto_scale_formula: Optional[str]
112-
11392
:param azure_batch_conn_id: The connection id of Azure batch service
11493
:type azure_batch_conn_id: str
115-
11694
:param use_latest_verified_vm_image_and_sku: Whether to use the latest verified virtual
11795
machine image and sku in the batch account. Default is false.
11896
:type use_latest_verified_vm_image_and_sku: bool
119-
12097
:param vm_publisher: The publisher of the Azure Virtual Machines Marketplace Image.
12198
For example, Canonical or MicrosoftWindowsServer. Required if
12299
use_latest_image_and_sku is set to True
123100
:type vm_publisher: Optional[str]
124-
125101
:param vm_offer: The offer type of the Azure Virtual Machines Marketplace Image.
126102
For example, UbuntuServer or WindowsServer. Required if
127103
use_latest_image_and_sku is set to True
128104
:type vm_offer: Optional[str]
129-
130105
:param sku_starts_with: The starting string of the Virtual Machine SKU. Required if
131106
use_latest_image_and_sku is set to True
132107
:type sku_starts_with: Optional[str]
133-
134108
:param vm_sku: The name of the virtual machine sku to use
135109
:type vm_sku: Optional[str]
136-
137110
:param vm_version: The version of the virtual machine
138111
:param vm_version: Optional[str]
139-
140112
:param vm_node_agent_sku_id: The node agent sku id of the virtual machine
141113
:type vm_node_agent_sku_id: Optional[str]
142-
143114
:param os_family: The Azure Guest OS family to be installed on the virtual machines in the Pool.
144115
:type os_family: Optional[str]
145-
146116
:param os_version: The OS family version
147117
:type os_version: Optional[str]
148-
149118
:param timeout: The amount of time to wait for the job to complete in minutes. Default is 25
150119
:type timeout: int
151-
152120
:param should_delete_job: Whether to delete job after execution. Default is False
153121
:type should_delete_job: bool
154-
155122
:param should_delete_pool: Whether to delete pool after execution of jobs. Default is False
156123
:type should_delete_pool: bool
157-
158-
159124
"""
160125

161126
template_fields = (

β€Žairflow/providers/microsoft/azure/sensors/azure_cosmos.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,21 @@ class AzureCosmosDocumentSensor(BaseSensorOperator):
2626
Checks for the existence of a document which
2727
matches the given query in CosmosDB. Example:
2828
29-
>>> azure_cosmos_sensor = AzureCosmosDocumentSensor(database_name="somedatabase_name",
30-
... collection_name="somecollection_name",
31-
... document_id="unique-doc-id",
32-
... azure_cosmos_conn_id="azure_cosmos_default",
33-
... task_id="azure_cosmos_sensor")
29+
.. code-block::
30+
31+
azure_cosmos_sensor = AzureCosmosDocumentSensor(
32+
database_name="somedatabase_name",
33+
collection_name="somecollection_name",
34+
document_id="unique-doc-id",
35+
azure_cosmos_conn_id="azure_cosmos_default",
36+
task_id="azure_cosmos_sensor")
3437
3538
:param database_name: Target CosmosDB database_name.
3639
:type database_name: str
3740
:param collection_name: Target CosmosDB collection_name.
3841
:type collection_name: str
3942
:param document_id: The ID of the target document.
40-
:type query: str
43+
:type document_id: str
4144
:param azure_cosmos_conn_id: Reference to the Azure CosmosDB connection.
4245
:type azure_cosmos_conn_id: str
4346
"""

β€Žairflow/providers/singularity/operators/singularity.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ class SingularityOperator(BaseOperator):
3939
4040
:param image: Singularity image or URI from which to create the container.
4141
:type image: str
42-
:param auto_remove: Delete the container when the process exits
43-
The default is False.
42+
:param auto_remove: Delete the container when the process exits.
43+
The default is False.
4444
:type auto_remove: bool
4545
:param command: Command to be run in the container. (templated)
4646
:type command: str or list
47-
:param start_command: start command to pass to the container instance
48-
:type start_command: string or list
47+
:param start_command: Start command to pass to the container instance.
48+
:type start_command: str or list
4949
:param environment: Environment variables to set in the container. (templated)
5050
:type environment: dict
5151
:param working_dir: Set a working directory for the instance.
@@ -54,10 +54,11 @@ class SingularityOperator(BaseOperator):
5454
:type force_pull: bool
5555
:param volumes: List of volumes to mount into the container, e.g.
5656
``['/host/path:/container/path', '/host/path2:/container/path2']``.
57-
:param options: other flags (list) to provide to the instance start
57+
:type volumes: Optional[List[str]]
58+
:param options: Other flags (list) to provide to the instance start.
5859
:type options: list
5960
:param working_dir: Working directory to
60-
set on the container (equivalent to the -w switch the docker client)
61+
set on the container (equivalent to the -w switch the docker client).
6162
:type working_dir: str
6263
"""
6364

β€Žairflow/providers/slack/operators/slack.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class SlackAPIOperator(BaseOperator):
2828
"""
2929
Base Slack Operator
3030
The SlackAPIPostOperator is derived from this operator.
31-
In the future additional Slack API Operators will be derived from this class as well
31+
In the future additional Slack API Operators will be derived from this class as well.
3232
Only one of `slack_conn_id` and `token` is required.
3333
3434
:param slack_conn_id: Slack connection ID which its password is Slack API token. Optional
@@ -40,7 +40,7 @@ class SlackAPIOperator(BaseOperator):
4040
:param api_params: API Method call parameters (https://api.slack.com/methods). Optional
4141
:type api_params: dict
4242
:param client_args: Slack Hook parameters. Optional. Check airflow.providers.slack.hooks.SlackHook
43-
:type api_params: dict
43+
:type client_args: dict
4444
"""
4545

4646
@apply_defaults

0 commit comments

Comments
 (0)