You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by bo...@apache.org on 2017/11/02 11:51:11 UTC
incubator-airflow git commit: [AIRFLOW-1675] Fix docstrings for API
docs
Repository: incubator-airflow
Updated Branches:
refs/heads/master 0ba6ab6e5 -> a5f51cc4a
[AIRFLOW-1675] Fix docstrings for API docs
Some docstrings were missing spaces, causing them
to render strangely
in documentation. This corrects the issue by
adding in the spaces.
Closes #2667 from cjonesy/master
Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/a5f51cc4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/a5f51cc4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/a5f51cc4
Branch: refs/heads/master
Commit: a5f51cc4a8dd87284d114ebab15401b2988d6599
Parents: 0ba6ab6
Author: Charlie Jones <cj...@gmail.com>
Authored: Thu Nov 2 12:51:06 2017 +0100
Committer: Bolke de Bruin <bo...@xs4all.nl>
Committed: Thu Nov 2 12:51:06 2017 +0100
----------------------------------------------------------------------
airflow/contrib/hooks/bigquery_hook.py | 3 +++
airflow/contrib/operators/spark_sql_operator.py | 1 +
airflow/contrib/operators/spark_submit_operator.py | 1 +
airflow/executors/base_executor.py | 1 +
airflow/hooks/oracle_hook.py | 1 +
airflow/models.py | 11 +++++++++++
airflow/operators/generic_transfer.py | 2 +-
7 files changed, 19 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/a5f51cc4/airflow/contrib/hooks/bigquery_hook.py
----------------------------------------------------------------------
diff --git a/airflow/contrib/hooks/bigquery_hook.py b/airflow/contrib/hooks/bigquery_hook.py
index 2cfef57..3f9e8af 100644
--- a/airflow/contrib/hooks/bigquery_hook.py
+++ b/airflow/contrib/hooks/bigquery_hook.py
@@ -681,6 +681,7 @@ class BigQueryBaseCursor(LoggingMixin):
Delete an existing table from the dataset;
If the table does not exist, return an error unless ignore_if_missing
is set to True.
+
:param deletion_dataset_table: A dotted
(<project>.|<project>:)<dataset>.<table> that indicates which table
will be deleted.
@@ -720,6 +721,7 @@ class BigQueryBaseCursor(LoggingMixin):
If the table already exists, update the existing table.
Since BigQuery does not natively allow table upserts, this is not an
atomic operation.
+
:param dataset_id: the dataset to upsert the table into.
:type dataset_id: str
:param table_resource: a table resource. see
@@ -774,6 +776,7 @@ class BigQueryBaseCursor(LoggingMixin):
Grant authorized view access of a dataset to a view table.
If this view has already been granted access to the dataset, do nothing.
This method is not atomic. Running it may clobber a simultaneous update.
+
:param source_dataset: the source dataset
:type source_dataset: str
:param view_dataset: the dataset that the view is in
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/a5f51cc4/airflow/contrib/operators/spark_sql_operator.py
----------------------------------------------------------------------
diff --git a/airflow/contrib/operators/spark_sql_operator.py b/airflow/contrib/operators/spark_sql_operator.py
index f6cba59..41511db 100644
--- a/airflow/contrib/operators/spark_sql_operator.py
+++ b/airflow/contrib/operators/spark_sql_operator.py
@@ -20,6 +20,7 @@ from airflow.contrib.hooks.spark_sql_hook import SparkSqlHook
class SparkSqlOperator(BaseOperator):
"""
Execute Spark SQL query
+
:param sql: The SQL query to execute
:type sql: str
:param conf: arbitrary Spark configuration property
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/a5f51cc4/airflow/contrib/operators/spark_submit_operator.py
----------------------------------------------------------------------
diff --git a/airflow/contrib/operators/spark_submit_operator.py b/airflow/contrib/operators/spark_submit_operator.py
index a7c9990..d5eaf27 100644
--- a/airflow/contrib/operators/spark_submit_operator.py
+++ b/airflow/contrib/operators/spark_submit_operator.py
@@ -23,6 +23,7 @@ class SparkSubmitOperator(BaseOperator):
This hook is a wrapper around the spark-submit binary to kick off a spark-submit job.
It requires that the "spark-submit" binary is in the PATH or the spark-home is set
in the extra on the connection.
+
:param application: The application that submitted as a job, either jar or py file.
:type application: str
:param conf: Arbitrary Spark configuration properties
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/a5f51cc4/airflow/executors/base_executor.py
----------------------------------------------------------------------
diff --git a/airflow/executors/base_executor.py b/airflow/executors/base_executor.py
index d96c10f..d3d0675 100644
--- a/airflow/executors/base_executor.py
+++ b/airflow/executors/base_executor.py
@@ -78,6 +78,7 @@ class BaseExecutor(LoggingMixin):
def has_task(self, task_instance):
"""
Checks if a task is either queued or running in this executor
+
:param task_instance: TaskInstance
:return: True if the task is known to this executor
"""
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/a5f51cc4/airflow/hooks/oracle_hook.py
----------------------------------------------------------------------
diff --git a/airflow/hooks/oracle_hook.py b/airflow/hooks/oracle_hook.py
index 71c67e0..9fbabf3 100644
--- a/airflow/hooks/oracle_hook.py
+++ b/airflow/hooks/oracle_hook.py
@@ -35,6 +35,7 @@ class OracleHook(DbApiHook):
Optional parameters for using a custom DSN connection (instead of using a server alias from tnsnames.ora)
The dsn (data source name) is the TNS entry (from the Oracle names server or tnsnames.ora file)
or is a string like the one returned from makedsn().
+
:param dsn: the host address for the Oracle server
:param service_name: the db_unique_name of the database that you are connecting to (CONNECT_DATA part of TNS)
You can set these parameters in the extra fields of your connection
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/a5f51cc4/airflow/models.py
----------------------------------------------------------------------
diff --git a/airflow/models.py b/airflow/models.py
index 821796c..3bdd68f 100755
--- a/airflow/models.py
+++ b/airflow/models.py
@@ -93,6 +93,7 @@ def get_fernet():
This function could fail either because Cryptography is not installed
or because the Fernet key is invalid.
+
:return: Fernet object
:raises: AirflowException if there's a problem trying to load Fernet
"""
@@ -1915,6 +1916,7 @@ class SkipMixin(LoggingMixin):
def skip(self, dag_run, execution_date, tasks):
"""
Sets tasks instances to skipped from the same dag run.
+
:param dag_run: the DagRun for which to set the tasks to skipped
:param execution_date: execution_date
:param tasks: tasks to skip (not task_ids)
@@ -2985,6 +2987,7 @@ class DAG(BaseDag, LoggingMixin):
"""
Returns a list of dates between the interval received as parameter using this
dag's schedule interval. Returned dates can be used for execution dates.
+
:param start_date: the start date of the interval
:type start_date: datetime
:param end_date: the end date of the interval, defaults to datetime.utcnow()
@@ -3153,6 +3156,7 @@ class DAG(BaseDag, LoggingMixin):
def get_active_runs(self, session=None):
"""
Returns a list of dag run execution dates currently running
+
:param session:
:return: List of execution dates
"""
@@ -3168,6 +3172,7 @@ class DAG(BaseDag, LoggingMixin):
def get_num_active_runs(self, external_trigger=None, session=None):
"""
Returns the number of active "running" dag runs
+
:param external_trigger: True for externally triggered active dag runs
:type external_trigger: bool
:param session:
@@ -3645,6 +3650,7 @@ class DAG(BaseDag, LoggingMixin):
delay_on_limit_secs=1.0):
"""
Runs the DAG.
+
:param start_date: the start date of the range to run
:type start_date: datetime
:param end_date: the end date of the range to run
@@ -4057,6 +4063,7 @@ class XCom(Base, LoggingMixin):
TODO: "pickling" has been deprecated and JSON is preferred. "pickling" will be
removed in Airflow 2.0. :param enable_pickling: If pickling is not enabled, the
XCOM value will be parsed as JSON instead.
+
:return: None
"""
session.expunge_all()
@@ -4110,6 +4117,7 @@ class XCom(Base, LoggingMixin):
"""
Retrieve an XCom value, optionally meeting certain criteria.
TODO: "pickling" has been deprecated and JSON is preferred. "pickling" will be removed in Airflow 2.0.
+
:param enable_pickling: If pickling is not enabled, the XCOM value will be parsed to JSON instead.
:return: XCom value
"""
@@ -4412,6 +4420,7 @@ class DagRun(Base, LoggingMixin):
session=None):
"""
Returns a set of dag runs for the given search criteria.
+
:param dag_id: the dag_id to find dag runs for
:type dag_id: integer, list
:param run_id: defines the the run id for this dag run
@@ -4485,6 +4494,7 @@ class DagRun(Base, LoggingMixin):
def get_task_instance(self, task_id, session=None):
"""
Returns the task instance specified by task_id for this dag run
+
:param task_id: the task id
"""
@@ -4535,6 +4545,7 @@ class DagRun(Base, LoggingMixin):
"""
Determines the overall state of the DagRun based on the state
of its TaskInstances.
+
:return: State
"""
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/a5f51cc4/airflow/operators/generic_transfer.py
----------------------------------------------------------------------
diff --git a/airflow/operators/generic_transfer.py b/airflow/operators/generic_transfer.py
index c8a2a58..545e722 100644
--- a/airflow/operators/generic_transfer.py
+++ b/airflow/operators/generic_transfer.py
@@ -23,7 +23,7 @@ class GenericTransfer(BaseOperator):
needs to expose a `get_records` method, and the destination a
`insert_rows` method.
- This is mean to be used on small-ish datasets that fit in memory.
+ This is meant to be used on small-ish datasets that fit in memory.
:param sql: SQL query to execute against the source database
:type sql: str