DataFrame Utilities¶
ensure_columns ¶
ensure_columns(df: DataFrame, required: Iterable[str]) -> DataFrame
Validate that df
contains all required
columns.
Raises a ValueError
including the missing columns otherwise.
Source code in src/spark_fuse/utils/dataframe.py
15 16 17 18 19 20 21 22 23 |
|
preview ¶
preview(df: DataFrame, n: int = 5) -> str
Return a string preview of the dataframe head and schema.
Source code in src/spark_fuse/utils/dataframe.py
8 9 10 11 12 |
|