-
Notifications
You must be signed in to change notification settings - Fork 14.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AIRFLOW-3174] Refine Docstring for SQL Operators #4023
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4023 +/- ##
=======================================
Coverage 75.77% 75.77%
=======================================
Files 199 199
Lines 15946 15946
=======================================
Hits 12083 12083
Misses 3863 3863
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @XD-DENG for picking this up. Also got some additional comments
airflow/operators/jdbc_operator.py
Outdated
@@ -34,6 +34,8 @@ class JdbcOperator(BaseOperator): | |||
:type sql: Can receive a str representing a sql statement, | |||
a list of str (sql statements), or reference to a template file. | |||
Template reference are recognized by str ending in '.sql' | |||
:param parameters: (optional) the parameters to render the SQL query with. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
autocommit
is also missing here :)
airflow/operators/mssql_operator.py
Outdated
@@ -31,6 +31,8 @@ class MsSqlOperator(BaseOperator): | |||
:param sql: the sql code to be executed | |||
:type sql: str or string pointing to a template file with .sql | |||
extension. (templated) | |||
:param parameters: (optional) the parameters to render the SQL query with. | |||
:type parameters: mapping or iterable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you fix the order? :) The sql
one comes before mssql_conn_id
, but in the docstring it is the other way around. Also autocommit is missing here
.
airflow/operators/mysql_operator.py
Outdated
@@ -32,6 +32,8 @@ class MySqlOperator(BaseOperator): | |||
:type sql: Can receive a str representing a sql statement, | |||
a list of str (sql statements), or reference to a template file. | |||
Template reference are recognized by str ending in '.sql' | |||
:param parameters: (optional) the parameters to render the SQL query with. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you fix the order? :) The sql
one comes before mssql_conn_id
, but in the docstring it is the other way around. Also autocommit is missing here
.
airflow/operators/oracle_operator.py
Outdated
@@ -32,6 +32,8 @@ class OracleOperator(BaseOperator): | |||
:type sql: Can receive a str representing a sql statement, | |||
a list of str (sql statements), or reference to a template file. | |||
Template reference are recognized by str ending in '.sql' | |||
:param parameters: (optional) the parameters to render the SQL query with. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you fix the order? :) The sql
one comes before mssql_conn_id
, but in the docstring it is the other way around. Also autocommit is missing here
.
@@ -31,6 +31,8 @@ class PostgresOperator(BaseOperator): | |||
:type sql: Can receive a str representing a sql statement, | |||
a list of str (sql statements), or reference to a template file. | |||
Template reference are recognized by str ending in '.sql' | |||
:param parameters: (optional) the parameters to render the SQL query with. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you fix the order? :) The sql
one comes before mssql_conn_id
, but in the docstring it is the other way around. Also autocommit is missing here
.
airflow/operators/sqlite_operator.py
Outdated
@@ -31,6 +31,8 @@ class SqliteOperator(BaseOperator): | |||
:param sql: the sql code to be executed. (templated) | |||
:type sql: str or string pointing to a template file. File must have | |||
a '.sql' extensions. | |||
:param parameters: (optional) the parameters to render the SQL query with. | |||
:type parameters: mapping or iterable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you fix the order? :) The sql
one comes before mssql_conn_id
, but in the docstring it is the other way around.
JIRA
https://issues.apache.org/jira/browse/AIRFLOW-3174
Description
These SQL operators (based on
DbApiHook
) receivesql
andparameters
(optional) as arguments. Butparameters
were not documented.The contents I added is based on the docstring in https://github.com/apache/incubator-airflow/blob/master/airflow/hooks/dbapi_hook.py#L88