Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(pandas): enable copy_on_write for Pandas #401

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

d33bs
Copy link
Member

@d33bs d33bs commented Apr 9, 2024

Description

This PR adds a configuration module and setting for Pandas (copy_on_write) which will eventually be turned on by default in Pandas >= 3.0.0 . Besides proactively avoiding issues with upgrades to Pandas, there are also possible performance benefits to doing this early (as per Pandas documentation on copy_on_write). I made these changes based on tests which were failing and noted in #366 .

After making this change, there are new test warnings concerning PerformanceWarning: DataFrame is highly fragmented. which may be worth investigating as part of this issue or possibly a new issue.

Closes #366

What is the nature of your change?

  • Bug fix (fixes an issue).
  • Enhancement (adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).
  • This change requires a documentation update.

Checklist

Please ensure that all boxes are checked before indicating that a pull request is ready for review.

  • I have read the CONTRIBUTING.md guidelines.
  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • New and existing unit tests pass locally with my changes.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have deleted all non-relevant text in this pull request template.

@d33bs d33bs marked this pull request as ready for review April 11, 2024 14:23
@d33bs d33bs requested a review from kenibrewer April 11, 2024 14:23
Copy link
Member

@kenibrewer kenibrewer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for making this proactive change here!

@d33bs
Copy link
Member Author

d33bs commented Apr 12, 2024

Thanks @kenibrewer , merging this in!

@d33bs d33bs merged commit 62eec0b into cytomining:main Apr 12, 2024
11 checks passed
@d33bs d33bs deleted the pandas-copy_on_write branch April 12, 2024 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FeatureRequest: Enable Pandas options.mode.copy_on_write = True Compatibility
2 participants