Skip to content

Commit 2d4b02c

Browse files
MAINT: Fix Variable.to_dict type hint (#11258)
1 parent 915d0a3 commit 2d4b02c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

xarray/core/variable.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from collections.abc import Callable, Hashable, Mapping, Sequence
99
from functools import partial
1010
from types import EllipsisType
11-
from typing import TYPE_CHECKING, Any, NoReturn, cast
11+
from typing import TYPE_CHECKING, Any, Literal, NoReturn, cast
1212

1313
import numpy as np
1414
import pandas as pd
@@ -582,7 +582,7 @@ def to_index(self) -> pd.Index:
582582
return self.to_index_variable().to_index()
583583

584584
def to_dict(
585-
self, data: bool | str = "list", encoding: bool = False
585+
self, data: bool | Literal["list", "array"] = "list", encoding: bool = False
586586
) -> dict[str, Any]:
587587
"""Dictionary representation of variable."""
588588
item: dict[str, Any] = {

0 commit comments

Comments
 (0)