Skip to content

Commit

Permalink
check None, switch include_0d
Browse files Browse the repository at this point in the history
  • Loading branch information
itcarroll committed Jan 23, 2025
1 parent 7b429f9 commit c9f235b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xarray/core/variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def as_variable(
" ambiguous, please extract the data using the .data property."
)

if utils.is_scalar(data_, include_0d=True):
if utils.is_scalar(data_, include_0d=False) and sizes is not None:
try:
shape_ = tuple(sizes[i] for i in dims_)
except TypeError as err:
Expand Down

0 comments on commit c9f235b

Please sign in to comment.