astro.sql

Subpackages

Submodules

Package Contents

Functions

get_value_list(sql, conn_id, **kwargs)

Execute a sql statement and return the result.

astro.sql.get_value_list(sql, conn_id, **kwargs)

Execute a sql statement and return the result. By default, the response size is less than equal to value of max_map_length conf. You can call a callable handler to alter the response by default it call fetchall on database result set.

Parameters
  • sql (str) – sql query to execute. If the sql query will return huge number of row then it can overload the XCOM. also, If you are using output of this method to expand a task using dynamic task map then it can create lots of parallel task. So it is advisable to limit your sql query statement.

  • conn_id (str) – Airflow connection id. This connection id will be used to identify the database client and connect with it at runtime

Return type

airflow.models.xcom_arg.XComArg