Skip to content

Commit 28362b5

Browse files
committed
raise a TypeError when passing DataArray to Variable
1 parent 50776af commit 28362b5

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

xarray/core/variable.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,9 @@ def as_variable(obj, name=None) -> "Union[Variable, IndexVariable]":
116116
obj = obj.copy(deep=False)
117117
elif isinstance(obj, tuple):
118118
if isinstance(obj[1], DataArray):
119-
# TODO: change into TypeError
120-
warnings.warn(
121-
(
122-
"Using a DataArray object to construct a variable is"
123-
" ambiguous, please extract the data using the .data property."
124-
" This will raise a TypeError in 0.19.0."
125-
),
126-
DeprecationWarning,
119+
raise TypeError(
120+
"Using a DataArray object to construct a variable is"
121+
" ambiguous, please extract the data using the .data property."
127122
)
128123
try:
129124
obj = Variable(*obj)

0 commit comments

Comments
 (0)