Closed tesslinden closed 2 weeks ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 83.11%. Comparing base (
4df61da
) to head (2e247b3
). Report is 81 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
thanks @tesslinden 🚀 and congrats on your first PR to pandera 🎉
Awesome! Thank you!
Fixes #1182. I ran into this bug myself, then found it was previously reported.
See the included tests for a minimal example of the bug:
test_config_coerce()
passes onmain
;test_config_coerce_with_regex()
fails onmain
, but passes with this fix.The change I've submitted here is the minimal change necessary to fix the bug. With this fix, some code is duplicated between the regex and non-regex blocks of the
_coerce_dtype_helper()
function. I considered separating it into helper functions like_should_coerce()
or_override_and_try_coercion()
, but there are several ways one could split it up, so I figured reviewers can decide which of those would be preferred.Also, I wasn't sure which file the tests should go in -- let me know if they should be moved.