yobx.sql.coverage#
SQL / DataFrame / Polars coverage data.
Provides get_sql_coverage() which returns structured coverage information
for all three input paths (SQL strings, DataFrame tracer, Polars LazyFrame) as
lists of (construct, status, notes) tuples. The coverage page in the
documentation calls this function to build its tables programmatically.
- yobx.sql.coverage.get_sql_coverage(section: str = 'sql') str[source]#
Return a RST
list-tablefor one of the three coverage sections.- Parameters:
section – one of
"sql","dataframe", or"polars".- Returns:
RST source string ready to be printed inside a
.. runpython::block with:rst:enabled.- Raises:
ValueError – if section is not one of the recognised values.
- yobx.sql.coverage.not_implemented_error(section: str, construct: str) NotImplementedError[source]#
Return a
NotImplementedErrorfor construct in section.Looks up construct in the coverage data for section and builds an error message that includes the coverage notes, providing a consistent message across all converters.
Matching is done by normalising both the construct argument and the coverage table keys (stripping RST backticks, lowercasing) and then checking whether the normalised needle is a substring of the normalised key. Only rows with
_UNSUPPORTEDor_PARTIALstatus contribute to the error message; if a matching row has a_SUPPORTEDstatus it is skipped and the search continues. If no matching unsupported row is found, a generic “not supported” message is returned.Note
This helper is intended to be called only for constructs that the converter knows it cannot handle. Calling it for a fully-supported construct will silently return a generic error message.
- Parameters:
section – one of
"sql","dataframe", or"polars".construct – human-readable construct name (e.g.
"SELECT DISTINCT").
- Returns:
NotImplementedErrorready to be raised.