airflow.providers.odbc.hooks.odbc
¶
This module contains ODBC hook.
Module Contents¶
-
class
airflow.providers.odbc.hooks.odbc.
OdbcHook
(*args, database: Optional[str] = None, driver: Optional[str] = None, dsn: Optional[str] = None, connect_kwargs: Optional[dict] = None, sqlalchemy_scheme: Optional[str] = None, **kwargs)[source]¶ Bases:
airflow.hooks.dbapi.DbApiHook
Interact with odbc data sources using pyodbc.
See ODBC Connection for full documentation.
-
sqlalchemy_scheme
[source]¶ Database provided in init if exists; otherwise,
schema
fromConnection
object.
-
connection_extra_lower
[source]¶ connection.extra_dejson
but where keys are converted to lower case.This is used internally for case-insensitive access of odbc params.
-
odbc_connection_string
[source]¶ ODBC connection string We build connection string instead of using
pyodbc.connect
params because, for example, there is no param representingApplicationIntent=ReadOnly
. Any key-value pairs provided inConnection.extra
will be added to the connection string.
-
connect_kwargs
[source]¶ Returns effective kwargs to be passed to
pyodbc.connect
after merging between conn extra,connect_kwargs
and hook init.Hook
connect_kwargs
precedesconnect_kwargs
from conn extra.String values for 'true' and 'false' are converted to bool type.
If
attrs_before
provided, keys and values are converted to int, as required by pyodbc.
-
get_uri
(self)[source]¶ URI invoked in
get_sqlalchemy_engine()
method
-