Skip to content

Commit

Permalink
Fix references in docs (#8984)
Browse files Browse the repository at this point in the history
  • Loading branch information
mik-laj committed May 23, 2020
1 parent f946f96 commit 1d36b03
Show file tree
Hide file tree
Showing 66 changed files with 164 additions and 152 deletions.
8 changes: 4 additions & 4 deletions airflow/hooks/dbapi_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def get_pandas_df(self, sql, parameters=None):
sql statements to execute
:type sql: str or list
:param parameters: The parameters to render the SQL query with.
:type parameters: mapping or iterable
:type parameters: dict or iterable
"""
import pandas.io.sql as psql

Expand All @@ -130,7 +130,7 @@ def get_records(self, sql, parameters=None):
sql statements to execute
:type sql: str or list
:param parameters: The parameters to render the SQL query with.
:type parameters: mapping or iterable
:type parameters: dict or iterable
"""
with closing(self.get_conn()) as conn:
with closing(conn.cursor()) as cur:
Expand All @@ -148,7 +148,7 @@ def get_first(self, sql, parameters=None):
sql statements to execute
:type sql: str or list
:param parameters: The parameters to render the SQL query with.
:type parameters: mapping or iterable
:type parameters: dict or iterable
"""
with closing(self.get_conn()) as conn:
with closing(conn.cursor()) as cur:
Expand All @@ -171,7 +171,7 @@ def run(self, sql, autocommit=False, parameters=None):
before executing the query.
:type autocommit: bool
:param parameters: The parameters to render the SQL query with.
:type parameters: mapping or iterable
:type parameters: dict or iterable
"""
if isinstance(sql, str):
sql = [sql]
Expand Down
4 changes: 2 additions & 2 deletions airflow/macros/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ def datetime_diff_for_humans(dt, since=None):
one and now.
:param dt: The datetime to display the diff for
:type dt: datetime
:type dt: datetime.datetime
:param since: When to display the date from. If ``None`` then the diff is
between ``dt`` and now.
:type since: None or datetime
:type since: None or datetime.datetime
:rtype: str
"""
import pendulum
Expand Down
2 changes: 1 addition & 1 deletion airflow/macros/hive.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def max_partition(
e.g. {'key1': 'value1', 'key2': 'value2'}.
Only partitions matching all partition_key:partition_value
pairs will be considered as candidates of max partition.
:type filter_map: map
:type filter_map: dict
:param field: the field to get the max value from. If there's only
one partition field, this will be inferred
:type field: str
Expand Down
2 changes: 1 addition & 1 deletion airflow/models/dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -1385,7 +1385,7 @@ def run(
:param local: True to run the tasks using the LocalExecutor
:type local: bool
:param executor: The executor instance to run the tasks
:type executor: airflow.executor.BaseExecutor
:type executor: airflow.executor.base_executor.BaseExecutor
:param donot_pickle: True to avoid pickling DAG object and send to workers
:type donot_pickle: bool
:param ignore_task_deps: True to skip upstream tasks
Expand Down
2 changes: 1 addition & 1 deletion airflow/operators/bash.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class BashOperator(BaseOperator):
:param bash_command: The command, set of commands or reference to a
bash script (must be '.sh') to be executed. (templated)
:type bash_command: str
:param env: If env is not None, it must be a mapping that defines the
:param env: If env is not None, it must be a dict that defines the
environment variables for the new process; these are used instead
of inheriting the current process environment, which is the default
behavior. (templated)
Expand Down
2 changes: 1 addition & 1 deletion airflow/providers/amazon/aws/hooks/datasync.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def get_task_arns_for_location_arns(
:param list source_location_arns: List of source LocationArns.
:param list destination_location_arns: List of destination LocationArns.
:return: list
:rtype: List of TaskArns.
:rtype: list(TaskArns)
:raises AirflowBadRequest: if ``source_location_arns`` or ``destination_location_arns`` are empty.
"""
if not source_location_arns:
Expand Down
4 changes: 2 additions & 2 deletions airflow/providers/amazon/aws/hooks/sagemaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,10 @@ def check_tuning_config(self, tuning_config):
def get_log_conn(self):
"""
This method is deprecated.
Please use :py:meth:`airflow.contrib.hooks.AwsLogsHook.get_conn` instead.
Please use :py:meth:`airflow.providers.amazon.aws.hooks.logs.AwsLogsHook.get_conn` instead.
"""
warnings.warn("Method `get_log_conn` has been deprecated. "
"Please use `airflow.contrib.hooks.AwsLogsHook.get_conn` instead.",
"Please use `airflow.providers.amazon.aws.hooks.logs.AwsLogsHook.get_conn` instead.",
category=DeprecationWarning,
stacklevel=2)

Expand Down
4 changes: 2 additions & 2 deletions airflow/providers/amazon/aws/hooks/sqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ def create_queue(self, queue_name, attributes=None):
:param queue_name: name of the queue.
:type queue_name: str
:param attributes: additional attributes for the queue (default: None)
For details of the attributes parameter see :py:meth:`botocore.client.SQS.create_queue`
For details of the attributes parameter see :py:meth:`SQS.create_queue`
:type attributes: dict
:return: dict with the information about the queue
For details of the returned value see :py:meth:`botocore.client.SQS.create_queue`
For details of the returned value see :py:meth:`SQS.create_queue`
:rtype: dict
"""
return self.get_conn().create_queue(QueueName=queue_name, Attributes=attributes or {})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class KubernetesPodOperator(BaseOperator): # pylint: disable=too-many-instance-
.. note::
If you use `Google Kubernetes Engine <https://cloud.google.com/kubernetes-engine/>`__, use
:class:`~airflow.providers.google.cloud.operators.kubernetes_engine.GKEPodOperator`, which
:class:`~airflow.providers.google.cloud.operators.kubernetes_engine.GKEStartPodOperator`, which
simplifies the authorization process.
:param namespace: the namespace to run within kubernetes.
Expand Down
8 changes: 4 additions & 4 deletions airflow/providers/exasol/hooks/exasol.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def get_pandas_df(self, sql, parameters=None):
sql statements to execute
:type sql: str or list
:param parameters: The parameters to render the SQL query with.
:type parameters: mapping or iterable
:type parameters: dict or iterable
"""
with closing(self.get_conn()) as conn:
conn.export_to_pandas(sql, query_params=parameters)
Expand All @@ -79,7 +79,7 @@ def get_records(self, sql, parameters=None):
sql statements to execute
:type sql: str or list
:param parameters: The parameters to render the SQL query with.
:type parameters: mapping or iterable
:type parameters: dict or iterable
"""
with closing(self.get_conn()) as conn:
with closing(conn.execute(sql, parameters)) as cur:
Expand All @@ -93,7 +93,7 @@ def get_first(self, sql, parameters=None):
sql statements to execute
:type sql: str or list
:param parameters: The parameters to render the SQL query with.
:type parameters: mapping or iterable
:type parameters: dict or iterable
"""
with closing(self.get_conn()) as conn:
with closing(conn.execute(sql, parameters)) as cur:
Expand All @@ -112,7 +112,7 @@ def run(self, sql, autocommit=False, parameters=None):
before executing the query.
:type autocommit: bool
:param parameters: The parameters to render the SQL query with.
:type parameters: mapping or iterable
:type parameters: dict or iterable
"""
if isinstance(sql, basestring):
sql = [sql]
Expand Down
2 changes: 1 addition & 1 deletion airflow/providers/exasol/operators/exasol.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ExasolOperator(BaseOperator):
(default value: False)
:type autocommit: bool
:param parameters: (optional) the parameters to render the SQL query with.
:type parameters: mapping
:type parameters: dict
:param schema: (optional) name of the schema which overwrite defined one in connection
:type schema: string
"""
Expand Down
10 changes: 5 additions & 5 deletions airflow/providers/google/cloud/hooks/natural_language.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def analyze_entities(
:param document: Input document.
If a dict is provided, it must be of the same form as the protobuf message Document
:type document: dict or class google.cloud.language_v1.types.Document
:type document: dict or google.cloud.language_v1.types.Document
:param encoding_type: The encoding type used by the API to calculate offsets.
:type encoding_type: google.cloud.language_v1.enums.EncodingType
:param retry: A retry object used to retry requests. If None is specified, requests will not be
Expand Down Expand Up @@ -110,7 +110,7 @@ def analyze_entity_sentiment(
:param document: Input document.
If a dict is provided, it must be of the same form as the protobuf message Document
:type document: dict or class google.cloud.language_v1.types.Document
:type document: dict or google.cloud.language_v1.types.Document
:param encoding_type: The encoding type used by the API to calculate offsets.
:type encoding_type: google.cloud.language_v1.enums.EncodingType
:param retry: A retry object used to retry requests. If None is specified, requests will not be
Expand Down Expand Up @@ -143,7 +143,7 @@ def analyze_sentiment(
:param document: Input document.
If a dict is provided, it must be of the same form as the protobuf message Document
:type document: dict or class google.cloud.language_v1.types.Document
:type document: dict or google.cloud.language_v1.types.Document
:param encoding_type: The encoding type used by the API to calculate offsets.
:type encoding_type: google.cloud.language_v1.enums.EncodingType
:param retry: A retry object used to retry requests. If None is specified, requests will not be
Expand Down Expand Up @@ -177,7 +177,7 @@ def analyze_syntax(
:param document: Input document.
If a dict is provided, it must be of the same form as the protobuf message Document
:type document: dict or class google.cloud.language_v1.types.Document#
:type document: dict or google.cloud.language_v1.types.Document
:param encoding_type: The encoding type used by the API to calculate offsets.
:type encoding_type: google.cloud.language_v1.enums.EncodingType
:param retry: A retry object used to retry requests. If None is specified, requests will not be
Expand Down Expand Up @@ -252,7 +252,7 @@ def classify_text(
:param document: Input document.
If a dict is provided, it must be of the same form as the protobuf message Document
:type document: dict or class google.cloud.language_v1.types.Document
:type document: dict or google.cloud.language_v1.types.Document
:param retry: A retry object used to retry requests. If None is specified, requests will not be
retried.
:type retry: google.api_core.retry.Retry
Expand Down
8 changes: 4 additions & 4 deletions airflow/providers/google/cloud/hooks/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def create_queue(
:param task_queue: The task queue to create.
Queue's name cannot be the same as an existing queue.
If a dict is provided, it must be of the same form as the protobuf message Queue.
:type task_queue: dict or class google.cloud.tasks_v2.types.Queue
:type task_queue: dict or google.cloud.tasks_v2.types.Queue
:param project_id: (Optional) The ID of the GCP project that owns the Cloud Tasks.
If set to None or missing, the default project_id from the GCP connection is used.
:type project_id: str
Expand Down Expand Up @@ -140,7 +140,7 @@ def update_queue(
:param task_queue: The task queue to update.
This method creates the queue if it does not exist and updates the queue if
it does exist. The queue's name must be specified.
:type task_queue: dict or class google.cloud.tasks_v2.types.Queue
:type task_queue: dict or google.cloud.tasks_v2.types.Queue
:param project_id: (Optional) The ID of the GCP project that owns the Cloud Tasks.
If set to None or missing, the default project_id from the GCP connection is used.
:type project_id: str
Expand All @@ -153,7 +153,7 @@ def update_queue(
:param update_mask: A mast used to specify which fields of the queue are being updated.
If empty, then all fields will be updated.
If a dict is provided, it must be of the same form as the protobuf message.
:type update_mask: dict or class google.cloud.tasks_v2.types.FieldMask
:type update_mask: dict or google.cloud.tasks_v2.types.FieldMask
:param retry: (Optional) A retry object used to retry requests.
If None is specified, requests will not be retried.
:type retry: google.api_core.retry.Retry
Expand Down Expand Up @@ -449,7 +449,7 @@ def create_task(
:type queue_name: str
:param task: The task to add.
If a dict is provided, it must be of the same form as the protobuf message Task.
:type task: dict or class google.cloud.tasks_v2.types.Task
:type task: dict or google.cloud.tasks_v2.types.Task
:param project_id: (Optional) The ID of the GCP project that owns the Cloud Tasks.
If set to None or missing, the default project_id from the GCP connection is used.
:type project_id: str
Expand Down
32 changes: 16 additions & 16 deletions airflow/providers/google/cloud/hooks/vision.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def create_product_set(
) -> str:
"""
For the documentation see:
:class:`~airflow.contrib.operators.gcp_vision_operator.CloudVisionProductSetCreateOperator`
:class:`~airflow.providers.google.cloud.operators.vision.CloudVisionCreateProductSetOperator`
"""
client = self.get_conn()
parent = ProductSearchClient.location_path(project_id, location)
Expand Down Expand Up @@ -209,7 +209,7 @@ def get_product_set(
) -> Dict:
"""
For the documentation see:
:class:`~airflow.contrib.operators.gcp_vision_operator.CloudVisionProductSetGetOperator`
:class:`~airflow.providers.google.cloud.operators.vision.CloudVisionGetProductSetOperator`
"""
client = self.get_conn()
name = ProductSearchClient.product_set_path(project_id, location, product_set_id)
Expand All @@ -233,7 +233,7 @@ def update_product_set(
) -> Dict:
"""
For the documentation see:
:class:`~airflow.contrib.operators.gcp_vision_operator.CloudVisionProductSetUpdateOperator`
:class:`~airflow.providers.google.cloud.operators.vision.CloudVisionUpdateProductSetOperator`
"""
client = self.get_conn()
product_set = self.product_set_name_determiner.get_entity_with_name(
Expand All @@ -259,7 +259,7 @@ def delete_product_set(
):
"""
For the documentation see:
:class:`~airflow.contrib.operators.gcp_vision_operator.CloudVisionProductSetDeleteOperator`
:class:`~airflow.providers.google.cloud.operators.vision.CloudVisionDeleteProductSetOperator`
"""
client = self.get_conn()
name = ProductSearchClient.product_set_path(project_id, location, product_set_id)
Expand All @@ -280,7 +280,7 @@ def create_product(
):
"""
For the documentation see:
:class:`~airflow.contrib.operators.gcp_vision_operator.CloudVisionProductCreateOperator`
:class:`~airflow.providers.google.cloud.operators.vision.CloudVisionCreateProductOperator`
"""
client = self.get_conn()
parent = ProductSearchClient.location_path(project_id, location)
Expand Down Expand Up @@ -315,7 +315,7 @@ def get_product(
):
"""
For the documentation see:
:class:`~airflow.contrib.operators.gcp_vision_operator.CloudVisionProductGetOperator`
:class:`~airflow.providers.google.cloud.operators.vision.CloudVisionGetProductOperator`
"""
client = self.get_conn()
name = ProductSearchClient.product_path(project_id, location, product_id)
Expand All @@ -339,7 +339,7 @@ def update_product(
):
"""
For the documentation see:
:class:`~airflow.contrib.operators.gcp_vision_operator.CloudVisionProductUpdateOperator`
:class:`~airflow.providers.google.cloud.operators.vision.CloudVisionUpdateProductOperator`
"""
client = self.get_conn()
product = self.product_name_determiner.get_entity_with_name(product, product_id, location, project_id)
Expand All @@ -363,7 +363,7 @@ def delete_product(
):
"""
For the documentation see:
:class:`~airflow.contrib.operators.gcp_vision_operator.CloudVisionProductDeleteOperator`
:class:`~airflow.providers.google.cloud.operators.vision.CloudVisionDeleteProductOperator`
"""
client = self.get_conn()
name = ProductSearchClient.product_path(project_id, location, product_id)
Expand Down Expand Up @@ -453,7 +453,7 @@ def add_product_to_product_set(
) -> None:
"""
For the documentation see:
:py:class:`~airflow.contrib.operators.gcp_vision_operator.CloudVisionAddProductToProductSetOperator`
:py:class:`~airflow.providers.google.cloud.operators.vision.CloudVisionAddProductToProductSetOperator`
"""
client = self.get_conn()

Expand Down Expand Up @@ -481,7 +481,7 @@ def remove_product_from_product_set(
) -> None:
"""
For the documentation see:
:py:class:`~airflow.contrib.operators.gcp_vision_operator.CloudVisionRemoveProductFromProductSetOperator` # pylint: disable=line-too-long # noqa
:py:class:`~airflow.providers.google.cloud.operators.vision.CloudVisionRemoveProductFromProductSetOperator` # pylint: disable=line-too-long # noqa
"""
client = self.get_conn()

Expand All @@ -504,7 +504,7 @@ def annotate_image(
) -> Dict:
"""
For the documentation see:
:py:class:`~airflow.contrib.operators.gcp_vision_image_annotator_operator.CloudVisionAnnotateImage`
:py:class:`~airflow.providers.google.cloud.operators.vision.CloudVisionImageAnnotateOperator`
"""
client = self.annotator_client

Expand All @@ -526,7 +526,7 @@ def batch_annotate_images(
) -> Dict:
"""
For the documentation see:
:py:class:`~airflow.contrib.operators.gcp_vision_image_annotator_operator.CloudVisionAnnotateImage`
:py:class:`~airflow.providers.google.cloud.operators.vision.CloudVisionImageAnnotateOperator`
"""
client = self.annotator_client

Expand All @@ -551,7 +551,7 @@ def text_detection(
) -> Dict:
"""
For the documentation see:
:py:class:`~airflow.contrib.operators.gcp_vision_operator.CloudVisionDetectTextOperator`
:py:class:`~airflow.providers.google.cloud.operators.vision.CloudVisionDetectTextOperator`
"""
client = self.annotator_client

Expand Down Expand Up @@ -581,7 +581,7 @@ def document_text_detection(
) -> Dict:
"""
For the documentation see:
:py:class:`~airflow.contrib.operators.gcp_vision_operator.CloudVisionDetectDocumentTextOperator`
:py:class:`~airflow.providers.google.cloud.operators.vision.CloudVisionTextDetectOperator`
"""
client = self.annotator_client

Expand Down Expand Up @@ -611,7 +611,7 @@ def label_detection(
) -> Dict:
"""
For the documentation see:
:py:class:`~airflow.contrib.operators.gcp_vision_operator.CloudVisionDetectImageLabelsOperator`
:py:class:`~airflow.providers.google.cloud.operators.vision.CloudVisionDetectImageLabelsOperator`
"""
client = self.annotator_client

Expand Down Expand Up @@ -641,7 +641,7 @@ def safe_search_detection(
) -> Dict:
"""
For the documentation see:
:py:class:`~airflow.contrib.operators.gcp_vision_operator.CloudVisionDetectImageSafeSearchOperator`
:py:class:`~airflow.providers.google.cloud.operators.vision.CloudVisionDetectImageSafeSearchOperator`
"""
client = self.annotator_client

Expand Down
2 changes: 1 addition & 1 deletion airflow/providers/google/cloud/operators/automl.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ def __init__(
model_id: str,
location: str,
project_id: Optional[str] = None,
image_detection_metadata: Optional[Optional[Optional[dict]]] = None,
image_detection_metadata: Optional[dict] = None,
metadata: Optional[Sequence[Tuple[str, str]]] = None,
timeout: Optional[float] = None,
retry: Optional[Retry] = None,
Expand Down

0 comments on commit 1d36b03

Please sign in to comment.