Skip to content

finprint.export

module finprint

Export a recipe in existing wire formats (load-bearing decision 9): an OpenLineage RunEvent with schema and columnLineage facets, and W3C PROV-JSON with entities, activities, used and wasGeneratedBy.

Column lineage is derived from the recorded steps: a column keeps the origins of the same-named column in the step’s inputs, a rename carries them to the new name, and a column a step adds takes the origins of every column its expression read (df["net"] = df["spend"] * 0.85 gives net <- spend). A column added inside a named step has no known origin and says so in its description.

function

def column_origins(
recipe: TransformRecipe,
) -> tuple[dict[str, set[Origin]], dict[str, str]]

For each output column, the input columns it came from, and a note for columns of unknown origin.

Source: packages/finprint/src/finprint/export.py, line 41

function

def to_openlineage(recipe: TransformRecipe) -> dict[str, Any]

An OpenLineage 2-0-2 RunEvent (eventType COMPLETE) for the recipe.

Source: packages/finprint/src/finprint/export.py, line 101

function

def to_prov(recipe: TransformRecipe) -> dict[str, Any]

W3C PROV-JSON: inputs, intermediate frames and the output as entities, steps as activities.

Source: packages/finprint/src/finprint/export.py, line 140

NameTypeValueDescription
PRODUCERf'urn:ump:ump-recipe:{__version__}'
OL_RUN_EVENT'https://openlineage.io/spec/2-0-2/OpenLineage.json#/$defs/RunEvent'
OL_SCHEMA_FACET'https://openlineage.io/spec/facets/1-1-1/SchemaDatasetFacet.json#/$defs/Sche...
OL_COLUMN_FACET'https://openlineage.io/spec/facets/1-2-0/ColumnLineageDatasetFacet.json#/$de...
OL_JOBTYPE_FACET'https://openlineage.io/spec/facets/2-0-3/JobTypeJobFacet.json#/$defs/JobType...
Origintuple[str, str]