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

Re-enable tests xfailed in #3808 and fix new CFTimeIndex failures due to upstream changes #3874

Merged
merged 4 commits into from
Mar 22, 2020

Conversation

spencerkclark
Copy link
Member

xref: #3869

@spencerkclark
Copy link
Member Author

Hmm...the upstream-dev CI environment does not seem to be using the latest version of pandas. The failures don't seem to reflect the fact that pandas-dev/pandas#32684 was merged.

Testing locally with pandas master, I'm actually getting some new failures related to CFTimeIndex, e.g.:

_______________________________________ test_concat_cftimeindex[proleptic_gregorian] ________________________________________

date_type = <class 'cftime._cftime.DatetimeProlepticGregorian'>

    @requires_cftime
    def test_concat_cftimeindex(date_type):
        da1 = xr.DataArray(
>           [1.0, 2.0], coords=[[date_type(1, 1, 1), date_type(1, 2, 1)]], dims=["time"]
        )

test_cftimeindex.py:670:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../core/dataarray.py:344: in __init__
    coords, dims = _infer_coords_and_dims(data.shape, coords, dims)
../core/dataarray.py:165: in _infer_coords_and_dims
    assert_unique_multiindex_level_names(new_coords)
../core/variable.py:2390: in assert_unique_multiindex_level_names
    idx_level_names = var.to_index_variable().level_names
../core/variable.py:2252: in level_names
    index = self.to_index()
../core/variable.py:2244: in to_index
    index = index.set_names(self.name)
../../../pandas/pandas/core/indexes/base.py:1291: in set_names
    idx = self._shallow_copy()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = CFTimeIndex([0001-01-01 00:00:00, 0001-02-01 00:00:00], dtype='object'), values = None, name = None

    def _shallow_copy(self, values=None, name: Label = no_default):
        """
        Create a new Index with the same class as the caller, don't copy the
        data, use the same object attributes with passed in attributes taking
        precedence.

        *this is an internal non-public method*

        Parameters
        ----------
        values : the values to create the new Index, optional
        name : Label, defaults to self.name
        """
        name = self.name if name is no_default else name
>       cache = self._cache.copy() if values is None else {}
E       AttributeError: 'CFTimeIndex' object has no attribute '_cache'

../../../pandas/pandas/core/indexes/base.py:500: AttributeError

@spencerkclark spencerkclark changed the title Re-enable tests xfailed in #3808 Re-enable tests xfailed in #3808 and fix new CFTimeIndex failures due to upstream changes Mar 21, 2020
@spencerkclark
Copy link
Member Author

spencerkclark commented Mar 21, 2020

5f37fd4 fixes the additional failures I described in #3874 (comment). They seem to be related to pandas-dev/pandas#32568. @jbrockmendel, does 5f37fd4 seem like the correct fix to you?

@dcherian
Copy link
Contributor

the upstream-dev CI environment does not seem to be using the latest version of pandas.

There's something about wheels needing to be updated.

Here's how we install it.

python -m pip install \
-f https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com \
--no-deps \
--pre \
--upgrade \
matplotlib \
numpy \
pandas \
scipy

@dcherian dcherian mentioned this pull request Mar 21, 2020
13 tasks
@dcherian
Copy link
Contributor

Thanks @spencerkclark

@dcherian dcherian merged commit 2d0b85e into pydata:master Mar 22, 2020
@spencerkclark spencerkclark deleted the undo-3808 branch March 23, 2020 00:29
dcherian added a commit to dcherian/xarray that referenced this pull request Mar 23, 2020
* upstream/master:
  Re-enable tests xfailed in pydata#3808 and fix new CFTimeIndex failures due to upstream changes (pydata#3874)
dcherian added a commit to dcherian/xarray that referenced this pull request Mar 28, 2020
* upstream/master: (54 commits)
  Limit repr of arrays containing long strings (pydata#3900)
  expose a few zarr backend functions as semi-public api (pydata#3897)
  Use drawstyle instead of linestyle in plot.step. (pydata#3274)
  Implementation of polyfit and polyval (pydata#3733)
  misplaced quote in whatsnew (pydata#3889)
  Rename ordered_dict_intersection -> compat_dict_intersection (pydata#3887)
  Control attrs of result in `merge()`, `concat()`, `combine_by_coords()` and `combine_nested()` (pydata#3877)
  xfail test_uamiv_format_write (pydata#3885)
  Use `fixes` in PR template (pydata#3886)
  Tweaks to "how_to_release" (pydata#3882)
  whatsnew section for 0.16.0
  Release v0.15.1
  whatsnew for 0.15.1 (pydata#3879)
  update panel documentation (pydata#3880)
  reword the whats-new entry for unit support (pydata#3878)
  Raise error when assigning to IndexVariable.values & IndexVariable.data (pydata#3862)
  Re-enable tests xfailed in pydata#3808 and fix new CFTimeIndex failures due to upstream changes (pydata#3874)
  add spacing in the versions section of the issue report (pydata#3876)
  map_blocks: allow user function to add new unindexed dimension. (pydata#3817)
  Delete associated indexes when deleting coordinate variables. (pydata#3840)
  ...
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