Skip to content

Commit

Permalink
Fixing enforce_metadata documentation, not checking for dtypes (#9474)
Browse files Browse the repository at this point in the history
The current apply_and_enforce() implementation does not raise on mismatching dtypes.
  • Loading branch information
epizut committed Sep 13, 2022
1 parent 9a4b069 commit d20c729
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
9 changes: 6 additions & 3 deletions dask/dataframe/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,8 @@ def map_partitions(self, func, *args, **kwargs):
Whether to enforce at runtime that the structure of the DataFrame
produced by ``func`` actually matches the structure of ``meta``.
This will rename and reorder columns for each partition,
and will raise an error if this doesn't work or types don't match.
and will raise an error if this doesn't work,
but it won't raise if dtypes don't match.
transform_divisions : bool, default True
Whether to apply the function onto the divisions and apply those
transformed divisions to the output.
Expand Down Expand Up @@ -897,7 +898,8 @@ def map_overlap(self, func, before, after, *args, **kwargs):
Whether to enforce at runtime that the structure of the DataFrame
produced by ``func`` actually matches the structure of ``meta``.
This will rename and reorder columns for each partition,
and will raise an error if this doesn't work or types don't match.
and will raise an error if this doesn't work,
but it won't raise if dtypes don't match.
transform_divisions : bool, default True
Whether to apply the function onto the divisions and apply those
transformed divisions to the output.
Expand Down Expand Up @@ -6492,7 +6494,8 @@ def map_partitions(
Whether to enforce at runtime that the structure of the DataFrame
produced by ``func`` actually matches the structure of ``meta``.
This will rename and reorder columns for each partition,
and will raise an error if this doesn't work or types don't match.
and will raise an error if this doesn't work,
but it won't raise if dtypes don't match.
transform_divisions : bool, default True
Whether to apply the function onto the divisions and apply those
transformed divisions to the output.
Expand Down
3 changes: 2 additions & 1 deletion dask/dataframe/io/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,8 @@ def from_map(
Whether to enforce at runtime that the structure of the DataFrame
produced by ``func`` actually matches the structure of ``meta``.
This will rename and reorder columns for each partition,
and will raise an error if this doesn't work or types don't match.
and will raise an error if this doesn't work,
but it won't raise if dtypes don't match.
**kwargs:
Key-word arguments to broadcast to each output partition. These
same arguments will be passed to ``func`` for every output partition.
Expand Down
3 changes: 2 additions & 1 deletion dask/dataframe/rolling.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ def map_overlap(
Whether to enforce at runtime that the structure of the DataFrame
produced by ``func`` actually matches the structure of ``meta``.
This will rename and reorder columns for each partition,
and will raise an error if this doesn't work or types don't match.
and will raise an error if this doesn't work,
but it won't raise if dtypes don't match.
before : int or timedelta
The rows to prepend to partition ``i`` from the end of
partition ``i - 1``.
Expand Down

0 comments on commit d20c729

Please sign in to comment.