diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 02226d803bf..a9fb3d699ff 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,7 @@ repos: hooks: - id: flake8 - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.720 + rev: v0.720 # Must match ci/requirements/*.yml hooks: - id: mypy # run these occasionally, ref discussion https://github.com/pydata/xarray/pull/3194 diff --git a/ci/requirements/py36.yml b/ci/requirements/py36.yml index 60259d59965..53da54e3b90 100644 --- a/ci/requirements/py36.yml +++ b/ci/requirements/py36.yml @@ -15,6 +15,7 @@ dependencies: - pytest-env - coveralls - flake8 + - mypy==0.720 # Must match .pre-commit-config.yaml - numpy>=1.12 - pandas>=0.19 - pip @@ -34,5 +35,4 @@ dependencies: - iris>=1.10 - pydap - lxml - - pip: - - mypy==0.711 + diff --git a/ci/requirements/py37.yml b/ci/requirements/py37.yml index f61aab69e0f..538d4679a79 100644 --- a/ci/requirements/py37.yml +++ b/ci/requirements/py37.yml @@ -16,6 +16,7 @@ dependencies: - pytest-env - coveralls - flake8 + - mypy==0.720 # Must match .pre-commit-config.yaml - numpy>=1.12 - pandas>=0.19 - pip @@ -32,5 +33,4 @@ dependencies: - lxml - pydap - pip: - - mypy==0.650 - numbagg diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py index 8aada5117c1..618d70e06e9 100644 --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -489,7 +489,8 @@ def __init__( self._indexes = None # type: Optional[OrderedDict[Any, pd.Index]] if attrs is not None: - self.attrs = attrs + self._attrs = OrderedDict(attrs) + self._encoding = None # type: Optional[Dict] self._initialized = True