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

Time slicing / indexing bug in Pandas v1.3.0 #254

Closed
1 of 3 tasks
jkrasting opened this issue Jul 15, 2021 · 0 comments · Fixed by #255
Closed
1 of 3 tasks

Time slicing / indexing bug in Pandas v1.3.0 #254

jkrasting opened this issue Jul 15, 2021 · 0 comments · Fixed by #255
Assignees
Labels
bug Something isn't working framework Issue pertains to the framework code testing-CI Issues related to testing. (Bugs found via testing should get the "bug" tag instead.)

Comments

@jkrasting
Copy link
Collaborator

Regression tests are catching a framework-wide issue with Pandas v1.3.0. This is related to the handling of time indexing and slicing. It manifests itself with this error message:

TypeError: _maybe_cast_slice_bound() missing 1 required positional argument: 'kind'

This is also showing up in the community: pandas-dev/pandas#41378

Bug Severity

  • 1 = Minor problem that does not affect total framework functionality (e.g., computation error in a POD, problem with logging output, or an issue on a single system
  • 2 = Major problem that affects overall functionality, but that does not occur for all users (e.g., problems installing the framework with a specific Conda version, a framework option that causes one or more PODs to fail, or missing/incompatible Python modules).
  • 3 = Catastrophic problem that occurs frequently for multiple users and/or on multiple systems (e.g.,framework consistently fails to install on multiple systems, or one or more PODs continuously fails after running successfully)

Describe the bug
The new version of Pandas released in early July is causing errors when the framework is performing time slicing.

Steps To Reproduce
Rebuilding conda environments and running the default tests will reproduce the issue.

Environment
Describe the system environment:

Log information and/or terminal output

Traceback (most recent call last):
  File "/Volumes/external/mdtf/MDTF-diagnostics/src/preprocessor.py", line 578, in process
    ds = f.process(var, ds)
  File "/Volumes/external/mdtf/MDTF-diagnostics/src/preprocessor.py", line 163, in process
    ds = ds.sel({t_coord.name: slice(dt_start_lower, dt_end_upper)})
  File "/Users/krasting/miniconda3/envs/_MDTF_base/lib/python3.7/site-packages/xarray/core/dataset.py", line 2183, in sel
    self, indexers=indexers, method=method, tolerance=tolerance
  File "/Users/krasting/miniconda3/envs/_MDTF_base/lib/python3.7/site-packages/xarray/core/coordinates.py", line 398, in remap_label_indexers
    obj, v_indexers, method=method, tolerance=tolerance
  File "/Users/krasting/miniconda3/envs/_MDTF_base/lib/python3.7/site-packages/xarray/core/indexing.py", line 270, in remap_label_indexers
    idxr, new_idx = convert_label_indexer(index, label, dim, method, tolerance)
  File "/Users/krasting/miniconda3/envs/_MDTF_base/lib/python3.7/site-packages/xarray/core/indexing.py", line 124, in convert_label_indexer
    _sanitize_slice_element(label.step),
  File "/Users/krasting/miniconda3/envs/_MDTF_base/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 5686, in slice_indexer
    start_slice, end_slice = self.slice_locs(start, end, step=step)
  File "/Users/krasting/miniconda3/envs/_MDTF_base/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 5889, in slice_locs
    start_slice = self.get_slice_bound(start, "left")
  File "/Users/krasting/miniconda3/envs/_MDTF_base/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 5799, in get_slice_bound
    label = self._maybe_cast_slice_bound(label, side)
TypeError: _maybe_cast_slice_bound() missing 1 required positional argument: 'kind'
@wrongkindofdoctor wrongkindofdoctor added bug Something isn't working testing-CI Issues related to testing. (Bugs found via testing should get the "bug" tag instead.) framework Issue pertains to the framework code labels Jul 15, 2021
@wrongkindofdoctor wrongkindofdoctor linked a pull request Jul 15, 2021 that will close this issue
11 tasks
@wrongkindofdoctor wrongkindofdoctor self-assigned this Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working framework Issue pertains to the framework code testing-CI Issues related to testing. (Bugs found via testing should get the "bug" tag instead.)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants