-
-
Notifications
You must be signed in to change notification settings - Fork 18.8k
BUG: Raise TypeError for invalid calendar types in CustomBusinessDay (#60647) #62012
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
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…used fixture) (pandas-dev#56612) Backport PR pandas-dev#56595: TST/CLN: Inline seldom used fixture Co-authored-by: Matthew Roeschke <[email protected]>
…nings) (pandas-dev#56620) Backport PR pandas-dev#56615: CI: Fix deprecation warnings Co-authored-by: Patrick Hoefler <[email protected]>
…from ruff) (pandas-dev#56624) Backport PR pandas-dev#56617: TYP: some return types from ruff Co-authored-by: Torsten Wörtwein <[email protected]>
…e) (pandas-dev#56639) Backport PR pandas-dev#56636: DOC: Fixup CoW userguide Co-authored-by: Patrick Hoefler <[email protected]>
….2.0 whatsnew) (pandas-dev#56640) Backport PR pandas-dev#56632: DOC: Minor fixups for 2.2.0 whatsnew Co-authored-by: Richard Shadrach <[email protected]>
…ising for arrow floats to numpy floats) (pandas-dev#56648) Backport PR pandas-dev#56644: BUG: Series.to_numpy raising for arrow floats to numpy floats Co-authored-by: Patrick Hoefler <[email protected]>
…ds for pyarrow duration types) (pandas-dev#56656) Backport PR pandas-dev#56650: ENH: Implement dt methods for pyarrow duration types Co-authored-by: Matthew Roeschke <[email protected]>
…values) (pandas-dev#56655) Backport PR pandas-dev#56647: floordiv fix for large values Co-authored-by: rohanjain101 <[email protected]>
… merging datetime columns with timedelta columns) (pandas-dev#56658) Backport PR pandas-dev#56613: BUG: Added raising when merging datetime columns with timedelta columns Co-authored-by: Huanghz2001 <[email protected]>
… MultiIndex raising read-only error) (pandas-dev#56660) Backport PR pandas-dev#56635: CoW: Boolean indexer in MultiIndex raising read-only error Co-authored-by: Patrick Hoefler <[email protected]>
…dencies table in 2.2 whatsnew) (pandas-dev#56662) Backport PR pandas-dev#56641: DOC: Add optional dependencies table in 2.2 whatsnew Co-authored-by: Matthew Roeschke <[email protected]>
…ime ArrowDtype) (pandas-dev#56665) Backport PR pandas-dev#56370: BUG: rolling with datetime ArrowDtype Co-authored-by: Matthew Roeschke <[email protected]>
…l not properly respecting check-dtype) (pandas-dev#56668) Backport PR pandas-dev#56654: BUG: assert_series_equal not properly respecting check-dtype Co-authored-by: Patrick Hoefler <[email protected]>
…ranch) (pandas-dev#56669) Backport PR pandas-dev#56664: CI: Run jobs on 2.2.x branch Co-authored-by: Matthew Roeschke <[email protected]>
…f pygrep check for future annotation import) (pandas-dev#56683) Backport PR pandas-dev#56666: STY: Use ruff instead of pygrep check for future annotation import Co-authored-by: Matthew Roeschke <[email protected]>
…andas-dev#56684) Backport PR pandas-dev#56682: CLN: NEP 50 followups Co-authored-by: Thomas Li <[email protected]>
…oncat regression) (pandas-dev#56686) Backport PR pandas-dev#56312: DOC: Add whatsnew for concat regression Co-authored-by: Thomas Li <[email protected]>
…owed in Series.struct.field) (pandas-dev#56698) Backport PR pandas-dev#56167: [ENH]: Expand types allowed in Series.struct.field Co-authored-by: Tom Augspurger <[email protected]>
…ion of str.fullmatch matches partial string. issue pandas-dev#56652) (pandas-dev#56715) Backport PR pandas-dev#56691: Bug pyarrow implementation of str.fullmatch matches partial string. issue pandas-dev#56652 Co-authored-by: JackCollins91 <[email protected]>
…warning on coerce) (pandas-dev#56719) Backport PR pandas-dev#56699: DOC: Corrected typo in warning on coerce Co-authored-by: aaron-robeson-8451 <[email protected]>
…EA ffill/bfill) (pandas-dev#56720) Backport PR pandas-dev#56616: BUG: Add limit_area to EA ffill/bfill Co-authored-by: Richard Shadrach <[email protected]>
…string) (pandas-dev#56725) Backport PR pandas-dev#56721: DOC: Fixup read_csv docstring Co-authored-by: Patrick Hoefler <[email protected]>
…type categorical using dictionary as categories) (pandas-dev#56723) Backport PR pandas-dev#56672: BUG: dictionary type astype categorical using dictionary as categories Co-authored-by: Patrick Hoefler <[email protected]>
…or read_excel) (pandas-dev#56730) Backport PR pandas-dev#56543: DOC: Update docstring for read_excel Co-authored-by: Patrick Hoefler <[email protected]>
…d floordiv for pyarrow types with large divisor and avoid floating points for floordiv) (pandas-dev#56744) Backport PR pandas-dev#56677: Fix integral truediv and floordiv for pyarrow types with large divisor and avoid floating points for floordiv Co-authored-by: rohanjain101 <[email protected]>
…ata preservation in groupby column selection) (pandas-dev#56770) Backport PR pandas-dev#56761: BUG: fix subclass metadata preservation in groupby column selection Co-authored-by: Joris Van den Bossche <[email protected]>
…loats with bools for ea dtypes) (pandas-dev#56780) Backport PR pandas-dev#56769: BUG: replace matching Floats with bools for ea dtypes Co-authored-by: Patrick Hoefler <[email protected]>
…ng for nullable bool dtype) (pandas-dev#56782) Backport PR pandas-dev#56767: BUG: Series.round raising for nullable bool dtype Co-authored-by: Patrick Hoefler <[email protected]>
…ing ea dtypes correctly) (pandas-dev#56783) Backport PR pandas-dev#56771: BUG: to_stata not handling ea dtypes correctly Co-authored-by: Patrick Hoefler <[email protected]>
…s for SciPy 1.14.0) (pandas-dev#59104) Backport PR pandas-dev#59094: BUG: Fix sparse doctests for SciPy 1.14.0 Co-authored-by: Lysandros Nikolaou <[email protected]>
…s to work for any module that raises an exception) (pandas-dev#59158) Backport PR pandas-dev#59114: BUG: Allow show_versions to work for any module that raises an exception Co-authored-by: Matthew Roeschke <[email protected]>
…g in matplotlib test) (pandas-dev#59175) Backport PR pandas-dev#59168: TST: Address UserWarning in matplotlib test Co-authored-by: Matthew Roeschke <[email protected]>
…gcs for pyarrow=17) (pandas-dev#59308) Backport PR pandas-dev#59306: CI: xfail test_to_read_gcs for pyarrow=17 Co-authored-by: Matthew Roeschke <[email protected]>
…imedelta * DateOffset) (pandas-dev#59444) Backport PR pandas-dev#59441: COMPAT: Fix numpy 2.1 timedelta * DateOffset Co-authored-by: Matthew Roeschke <[email protected]>
…failures) (pandas-dev#59550) Backport PR pandas-dev#59545: CI: Fix ci for numpy 2 failures Co-authored-by: Patrick Hoefler <[email protected]>
…ests (pandas-dev#59570) * Backport PR pandas-dev#59553: CI: Uninstall nomkl & 32 bit Interval tests * Update pandas/tests/indexes/interval/test_interval_tree.py * Update pandas/tests/indexes/interval/test_interval_tree.py * Update pandas/tests/indexing/interval/test_interval_new.py * Update pandas/tests/indexing/interval/test_interval_new.py
…2.2.3) (pandas-dev#59812) Backport PR pandas-dev#59811: DOC: add whatsnew for v2.2.3 Co-authored-by: Joris Van den Bossche <[email protected]>
…motion_state usage) (pandas-dev#59821) BUG: Remove np._get_promotion_state usage (pandas-dev#59818) (cherry picked from commit 081dcde) Co-authored-by: Lysandros Nikolaou <[email protected]>
…uilds) (pandas-dev#59828) Backport PR pandas-dev#59813: CI: Debug failing ARM builds Co-authored-by: Thomas Li <[email protected]>
…olve pandas-dev#2137) (pandas-dev#59535) * remove core.computation.ops.Div resolves pandas-dev#21374 pandas-dev#58748 * need to preserve order * updating tests * (update whatsnew -- no whatsnew for 2.2.x and 2.3 yet) * solve mypy issue * fixing pytests * better than cast * adding specific test (* Update pandas/tests/frame/test_query_eval.py // Not backported, fails on 2.2) * Update pandas/tests/computation/test_eval.py --------- Co-authored-by: Laurent Mutricy <[email protected]> Co-authored-by: Matthew Roeschke <[email protected]> Co-authored-by: Thomas Li <[email protected]>
* Backport PR pandas-dev#59065: ENH: Fix Python 3.13 test failures & enable CI * Remove deprecated plot_date calls (pandas-dev#58484) * Remove deprecated plot_date calls These were deprecated in Matplotlib 3.9. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> (cherry picked from commit c9bc480) * Pick out fastparquet xfails for green CI * pin pytz to fix test_arrays.py * more workflow tweaks for pytz and Python 3.13 * fix typing and tune tests for copy on write * remove WASM stuff * more arm skips * go for green --------- Co-authored-by: Lysandros Nikolaou <[email protected]> Co-authored-by: Elliott Sales de Andrade <[email protected]>
…otation) (pandas-dev#59837) Backport PR pandas-dev#59836: BLD: Fix bad Cython annotation Co-authored-by: Thomas Li <[email protected]>
…aded nightly wheels) (pandas-dev#59835) * Bump pypa/cibuildwheel from 2.19.1 to 2.19.2 (pandas-dev#59208) Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.19.1 to 2.19.2. - [Release notes](https://github.com/pypa/cibuildwheel/releases) - [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md) - [Commits](pypa/cibuildwheel@v2.19.1...v2.19.2) --- updated-dependencies: - dependency-name: pypa/cibuildwheel dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> (cherry picked from commit ad09dc6) * Upload 3.13 & free-threaded nightly wheels (pandas-dev#59136) * Upload free-threaded nightly wheels on Linux and macOS * Consolidate jobs into one * Install build dependencies in before-build and pass --no-build-isolation * Fix {project} placeholder in cibuildwheel config * Correctly quote echo CIBW_BUILD_FRONTEND command * Run echo -e * Add {package} to before-build * Include cibw script in sdist & add matrix value for build frontend * Change manifest and gitattributes * Change gitattributes * Install verioneer in before-build * Add cibw_before_test to install nightly NumPy * Expand before-test to musl * Better comments plus always run before-build/before-test on 3.13 * Add --no-build-isolation in 3.13 as well * Install nightly numpy before windows tests * Address feedback; add todo for NumPy nightly and move default outside matrix * Set build_frontend to 'build' in pyodide build --------- Co-authored-by: Matthew Roeschke <[email protected]> (cherry picked from commit 7c0ee27) * CI: Update to cibuildwheel 2.20.0 (pandas-dev#59401) cibuildwheel 2.20.0 uses the ABI stable Python 3.13.0rc1 and build Python 3.13 wheels by default, which allows removing the `CIBW_PRERELEASE_PYTHONS` flag. Co-authored-by: Matthew Roeschke <[email protected]> (cherry picked from commit 70bb855) * Update wheels.yml * BLD/RLS: build wheels with released numpy/cython for Python 3.13 (pandas-dev#59819) (cherry picked from commit 2237217) * enable prerelease again --------- Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Lysandros Nikolaou <[email protected]> Co-authored-by: Ewout ter Hoeven <[email protected]> Co-authored-by: Thomas Li <[email protected]>
We don't accept AI generated pull requests so closing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bug Description
Previously, if an invalid
calendar
argument was passed toCustomBusinessDay
(e.g., apandas_market_calendars
object), it was silently ignored. This resulted in potentially incorrect behavior without warning, which could lead to confusion and incorrect results.What This Fix Does
offsets.pyx
to ensure thecalendar
parameter is either anumpy.busdaycalendar
orAbstractHolidayCalendar
.TypeError
is raised with a clear error message.Tests Added
test_invalid_calendar_raises_typeerror
added totest_custom_business_day.py
to assert that an invalid calendar raises aTypeError
.test_calendar
was updated to construct a validnp.busdaycalendar
fromUSFederalHolidayCalendar
dates.Why This Matters
Silently ignoring invalid input is dangerous and can introduce subtle bugs. This fix ensures strict input validation and protects downstream consumers from incorrect assumptions.
Checklist
pytest
"BUG: Raise TypeError for invalid calendar types in CustomBusinessDay (#60647)"