Shared utilities for safe casting, schema enforcement, and arithmetic fallback logic. More...
Go to the source code of this file.
Namespaces | |
namespace | pipeline |
namespace | pipeline.utils |
Functions | |
pl.DataFrame | pipeline.utils.safe_vector_cast (pl.DataFrame df, dict schema) |
Cast a Polars DataFrame to match a declared schema, handling 'NA' strings as nulls. | |
pipeline.utils.safe_div (numerator, denominator) | |
Safely performs division, handling 'NA' values and invalid input. | |
pipeline.utils.safe_div_percent (numerator, denominator) | |
Computes percentage-based division safely, with 'NA' fallback. | |
Shared utilities for safe casting, schema enforcement, and arithmetic fallback logic.
safe_vector_cast
: Vectorized, schema-aware casting for Polars DataFrames safe_div
: Division with fallback for invalid or "NA" input safe_div_percent
: Percentage-style division with "NA" guard Definition in file utils.py.