ds_provider_postgresql_py_lib.utils.dataset_rows ================================================ .. py:module:: ds_provider_postgresql_py_lib.utils.dataset_rows .. autoapi-nested-parse:: **File:** ``dataset_rows.py`` **Region:** ``ds_provider_postgresql_py_lib/utils/dataset_rows`` Dataset Row Helpers This module contains row execution and dataframe materialization helpers. Functions --------- .. autoapisummary:: ds_provider_postgresql_py_lib.utils.dataset_rows.execute_returning_rows ds_provider_postgresql_py_lib.utils.dataset_rows.output_from_rows Module Contents --------------- .. py:function:: execute_returning_rows(conn: sqlalchemy.engine.Connection, stmt: sqlalchemy.sql.Executable) -> list[dict[str, Any]] Execute a statement with RETURNING and convert rows to dicts. :param conn: SQLAlchemy connection. :param stmt: SQL statement to execute. :returns: Returned rows as dictionaries. :rtype: list[dict[str, Any]] .. py:function:: output_from_rows(table: sqlalchemy.Table, rows: list[dict[str, Any]]) -> pandas.DataFrame Build output DataFrame using a stable table-column order. :param table: Reflected SQLAlchemy table. :param rows: Row dictionaries to materialize. :returns: Output DataFrame aligned to table column order. :rtype: pd.DataFrame