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

improve memory efficiency of validation process #360

Merged
merged 5 commits into from
Dec 17, 2020

Conversation

cosmicBboy
Copy link
Collaborator

@cosmicBboy cosmicBboy commented Dec 16, 2020

Fixes #317, #356

This PR improves overall memory efficiency of pandera by minimizing
the number of views/copies being created during the validation routine.
This lowers pandera's memory overhead so that it can handle larger
dataframes.

Another way it does this is by handling nulls in the Check class not
by dropping rows/elements that are na (thus creating copies), but by
ignoring null entries in the resulting check_output.

We also limit the number of failure cases captured and reported by
pandera to the check.n_failure_cases value.

this diff avoids creating copies and views of dataframes during
the validation routine so that pandera can handle larger
dataframes
@codecov
Copy link

codecov bot commented Dec 17, 2020

Codecov Report

Merging #360 (f784a98) into master (8b32e5e) will increase coverage by 0.07%.
The diff coverage is 97.67%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #360      +/-   ##
==========================================
+ Coverage   99.13%   99.21%   +0.07%     
==========================================
  Files          21       21              
  Lines        2440     2427      -13     
==========================================
- Hits         2419     2408      -11     
+ Misses         21       19       -2     
Impacted Files Coverage Δ
pandera/schemas.py 98.72% <80.00%> (ø)
pandera/checks.py 98.47% <100.00%> (-0.07%) ⬇️
pandera/error_handlers.py 100.00% <100.00%> (ø)
pandera/errors.py 100.00% <100.00%> (+1.63%) ⬆️
pandera/hypotheses.py 94.54% <100.00%> (+1.81%) ⬆️
pandera/schema_components.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8b32e5e...f784a98. Read the comment docs.

@cosmicBboy cosmicBboy merged commit bac5c16 into master Dec 17, 2020
@cosmicBboy cosmicBboy deleted the feature/improve-memory-efficiency branch December 17, 2020 15:10
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.

ignore_na drops elements/rows after passing through the check function
1 participant