Skip to content

Commit

Permalink
fix pandas-dev tests (#3491)
Browse files Browse the repository at this point in the history
* Don't initialize DataArrays with Pandas attrs.

* re-enable pandas-dev CI.
  • Loading branch information
dcherian authored Nov 8, 2019
1 parent 3bb0414 commit 37e5ae7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ci/azure/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ steps:
--pre \
--upgrade \
matplotlib \
pandas=0.26.0.dev0+628.g03c1a3db2 \ # FIXME https://github.com/pydata/xarray/issues/3440
pandas \
scipy
# numpy \ # FIXME https://github.com/pydata/xarray/issues/3409
pip install \
Expand Down
3 changes: 2 additions & 1 deletion xarray/core/dataarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
from .dataset import Dataset, merge_indexes, split_indexes
from .formatting import format_item
from .indexes import Indexes, default_indexes
from .merge import PANDAS_TYPES
from .options import OPTIONS
from .utils import Default, ReprObject, _check_inplace, _default, either_dict_or_kwargs
from .variable import (
Expand Down Expand Up @@ -357,7 +358,7 @@ def __init__(
dims = getattr(data, "dims", getattr(coords, "dims", None))
if name is None:
name = getattr(data, "name", None)
if attrs is None:
if attrs is None and not isinstance(data, PANDAS_TYPES):
attrs = getattr(data, "attrs", None)
if encoding is None:
encoding = getattr(data, "encoding", None)
Expand Down

0 comments on commit 37e5ae7

Please sign in to comment.