Skip to content

Commit

Permalink
Turn off pandas copy-on-write
Browse files Browse the repository at this point in the history
  • Loading branch information
has2k1 committed Mar 14, 2024
1 parent 1dc71e0 commit 77d9a1f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 9 additions & 0 deletions doc/changelog.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
title: Changelog
---

## v0.13.2
(not-yet-released)

### Enhancements

- Drawing the plot ensures that pandas Copy-on-Write is turned off. Plotnine
is not yet compatible with Copy-on-Write so this prevents errors for users
who have turned on the option.

## v0.13.1
(2024-03-06)

Expand Down
5 changes: 4 additions & 1 deletion plotnine/_utils/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ def __enter__(self) -> Self:
# from slices we do not want complaints. We always uses the
# new frames knowing that they are separate from the original.
self.pd_option_context = pd.option_context(
"mode.chained_assignment", None
"mode.chained_assignment",
None,
"mode.copy_on_write",
False,
)
self.rc_context.__enter__()
self.pd_option_context.__enter__()
Expand Down

0 comments on commit 77d9a1f

Please sign in to comment.