Repository: incubator-airflow Updated Branches: refs/heads/master 79e7c9071 -> 4cf2fba19
[AIRFLOW-2205] Remove unsupported args from JdbcHook doc JdbcHook's docstring has unsupported arguments and unimplemented feature description. This PR fixes them and adds JdbcHook to the API reference. Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/81f8abaa Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/81f8abaa Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/81f8abaa Branch: refs/heads/master Commit: 81f8abaab75b614b57c9f8c5dee5955475a02006 Parents: 79e7c90 Author: Kengo Seki <sek...@apache.org> Authored: Mon Mar 12 23:38:59 2018 -0400 Committer: Kengo Seki <sek...@apache.org> Committed: Mon Mar 12 23:38:59 2018 -0400 ---------------------------------------------------------------------- airflow/hooks/jdbc_hook.py | 16 ++-------------- docs/code.rst | 1 + 2 files changed, 3 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/81f8abaa/airflow/hooks/jdbc_hook.py ---------------------------------------------------------------------- diff --git a/airflow/hooks/jdbc_hook.py b/airflow/hooks/jdbc_hook.py index dcc6cd2..5996bf8 100644 --- a/airflow/hooks/jdbc_hook.py +++ b/airflow/hooks/jdbc_hook.py @@ -23,21 +23,9 @@ class JdbcHook(DbApiHook): """ General hook for jdbc db access. - If a connection id is specified, host, port, schema, username and password will be taken from the predefined connection. + JDBC URL, username and password will be taken from the predefined connection. + Note that the whole JDBC URL must be specified in the "host" field in the DB. Raises an airflow error if the given connection id doesn't exist. - Otherwise host, port, schema, username and password can be specified on the fly. - - :param jdbc_url: jdbc connection url - :type jdbc_url: string - :param jdbc_driver_name: jdbc driver name - :type jdbc_driver_name: string - :param jdbc_driver_loc: path to jdbc driver - :type jdbc_driver_loc: string - :param conn_id: reference to a predefined database - :type conn_id: string - :param sql: the sql code to be executed - :type sql: string or string pointing to a template file. File must have - a '.sql' extensions. """ conn_name_attr = 'jdbc_conn_id' http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/81f8abaa/docs/code.rst ---------------------------------------------------------------------- diff --git a/docs/code.rst b/docs/code.rst index 738e023..2233ced 100644 --- a/docs/code.rst +++ b/docs/code.rst @@ -311,6 +311,7 @@ interface when possible and acting as building blocks for operators. HiveServer2Hook .. autoclass:: airflow.hooks.http_hook.HttpHook .. autoclass:: airflow.hooks.druid_hook.DruidHook +.. autoclass:: airflow.hooks.jdbc_hook.JdbcHook .. autoclass:: airflow.hooks.mssql_hook.MsSqlHook .. autoclass:: airflow.hooks.mysql_hook.MySqlHook .. autoclass:: airflow.hooks.postgres_hook.PostgresHook