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

Handle timestamp and nans in removing multi index failure cases #1516

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rorymcstay
Copy link

@rorymcstay rorymcstay commented Feb 27, 2024

Fixes the following issue

#1469

Longer term, there probably needs to be another way to track invalid records without serialising the index to string..

@rorymcstay rorymcstay force-pushed the bugfix/handle-timestamp-index-on-dropping-multiindex branch from 27fb29c to a770bda Compare February 27, 2024 22:06
Copy link

codecov bot commented Feb 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.30%. Comparing base (812b2a8) to head (ef5515f).
Report is 141 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1516      +/-   ##
==========================================
- Coverage   94.28%   93.30%   -0.98%     
==========================================
  Files          91      120      +29     
  Lines        7013     9133    +2120     
==========================================
+ Hits         6612     8522    +1910     
- Misses        401      611     +210     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cosmicBboy
Copy link
Collaborator

@rorymcstay thanks! need to run pre-commit to fix linter errors: https://pandera.readthedocs.io/en/stable/CONTRIBUTING.html#set-up-pre-commit

@rorymcstay rorymcstay force-pushed the bugfix/handle-timestamp-index-on-dropping-multiindex branch 2 times, most recently from 1a4c817 to 2a18b64 Compare August 15, 2024 11:39
…ai-oss#1469

Signed-off-by: Rory <rory@rorymcstay.com>
Signed-off-by: Rory McStay <rory.mcstay@fulcrumasset.com>
@rorymcstay rorymcstay force-pushed the bugfix/handle-timestamp-index-on-dropping-multiindex branch from 2a18b64 to ef5515f Compare August 15, 2024 12:46
@rorymcstay
Copy link
Author

@rorymcstay thanks! need to run pre-commit to fix linter errors: https://pandera.readthedocs.io/en/stable/CONTRIBUTING.html#set-up-pre-commit

@cosmicBboy thanks, finally came back round to this and updated the PR

err.failure_cases["index"]
.astype(str)
.apply(
lambda i: eval(i, _MULTIINDEX_HANDLED_TYPES) # pylint: disable=eval-used
Copy link
Collaborator

Choose a reason for hiding this comment

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

hmm, I didn't realize when this eval snuck into the codebase... are you aware of a more secure way of doing this @rorymcstay ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

looks like I missed the eval change reviewing this change: d43a11b

We don't need to address in this PR, but if you can think of a non-eval approach to this in a separate PR that would be awesome!

Copy link
Collaborator

@cosmicBboy cosmicBboy left a comment

Choose a reason for hiding this comment

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

Approving and merging this now @rorymcstay.

If you have any thoughts on https://github.com/unionai-oss/pandera/pull/1516/files#r1718793226 I'd appreciate any ideas you may have!

@rorymcstay
Copy link
Author

Thanks, I was trying to recall where the index is cast to a string to consider changing its implementation.

When I investigated this issue initially, I wasn't sure on how to proceed, as I considered it a breaking change to no longer cast to string.

Once I get back round to finding where this was done, I will see what the changes would look like.

@rorymcstay
Copy link
Author

@cosmicBboy Do you think we could merege this now?

@rorymcstay
Copy link
Author

@cosmicBboy Do you think we could merege this now?

I see some failed merge checks, please ignore whilst i investigate

@rorymcstay
Copy link
Author

@cosmicBboy what should the approach here be regarding project code coverage. I would need to add tests which aren't relevant to this PR IIUC.
Thanks

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.

2 participants