From f57574416b106e57b3b9001054eb241543b1f1f4 Mon Sep 17 00:00:00 2001 From: Yannik Tausch Date: Wed, 28 Jan 2026 09:36:16 +0100 Subject: [PATCH] docs: Document that `validate` and `filter` remove excess columns --- dataframely/schema.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dataframely/schema.py b/dataframely/schema.py index 2a80f4bf..b64f0616 100644 --- a/dataframely/schema.py +++ b/dataframely/schema.py @@ -553,8 +553,9 @@ def validate( Returns: The input eager or lazy frame, wrapped in a generic version of the - input's data frame type to reflect schema adherence. This operation is - guaranteed to maintain input ordering of rows. + input's data frame type to reflect schema adherence. Columns not defined + in the schema are removed from the output. This operation is guaranteed + to maintain input ordering of rows. Raises: SchemaError: If `eager=True` and the input data frame misses columns or @@ -704,7 +705,8 @@ def filter( Returns: A tuple of the validated rows in the input data frame (potentially empty) and a simple dataclass carrying information about the rows of the - data frame which could not be validated successfully. Just like in polars' + data frame which could not be validated successfully. Columns not defined + in the schema are removed from the output. Just like in polars' native :meth:`~polars.DataFrame.filter`, the order of rows in the returned data frame is maintained.