airflow_indexima.uri.factory

URI utilities.

define_load_path_factory

define_load_path_factory(conn_id:str, decorator:Callable[[airflow.models.Connection], airflow.models.Connection], factory:Callable[[str, Union[Callable[[airflow.models.Connection], airflow.models.Connection], NoneType]], str]) -> Callable[[], str]
Create an uri factory function with UriFactory profile.

Example: def my_decorator(conn:Connection) -> Connection: ... return conn

decorated_redshift_uri_factory = define_load_path_factory( decorator=my_decorator, factory=get_redshift_load_path_uri )

Parameter

conn_id (str): connection identifier of data source
decorator (ConnectionDecorator): Connection decorator
factory (UriGeneratorFactory): uri decorated factory

Return

(UriFactory): function used as a macro to get load uri path

airflow_indexima.uri.jdbc

Define an uri generator for redshift.

get_jdbc_load_path_uri

get_jdbc_load_path_uri(jdbc_type:str, connection_id:str, decorator:Union[Callable[[airflow.models.Connection], airflow.models.Connection], NoneType]=None) -> str
Return jdbc load path uri from a connection_id.

Parameters

  • jdbc_type (str): jdbc connection type
  • connection_id (str): source connection identifier
  • decorator (Optional[ConnectionDecorator]): optinal connection decorator

Returns

(str) load path uri

get_redshift_load_path_uri

get_redshift_load_path_uri(connection_id:str, decorator:Union[Callable[[airflow.models.Connection], airflow.models.Connection], NoneType]=None) -> str
Return redshift load path uri from a connection_id.

Example:

    get_redshift_load_path_uri(connection_id='my_conn')
    >> 'jdbc:redshift://my-db:5439/db_client?ssl=true&user=airflow-user&password=XXXXXXXX'

Parameters

  • connection_id (str): source connection identifier
  • decorator (Optional[ConnectionDecorator]): optinal connection decorator

Returns

(str) load path uri

get_postgresql_load_path_uri

get_postgresql_load_path_uri(connection_id:str, decorator:Union[Callable[[airflow.models.Connection], airflow.models.Connection], NoneType]=None) -> str
Return postgresql load path uri from a connection_id.

Example:

    get_postgresql_load_path_uri(connection_id='my_conn')
    >> 'jdbc:postgresql://my-db:5432/db_client?ssl=true&user=airflow-user&password=XXXXXXXX'

Parameters

  • connection_id (str): source connection identifier
  • decorator (Optional[ConnectionDecorator]): optinal connection decorator

Returns

(str) load path uri