Skip to content

Commit 86528f3

Browse files
committed
fix: apply suggestion
1 parent a4f5beb commit 86528f3

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

xarray/core/dtypes.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -322,16 +322,11 @@ def result_type(
322322

323323
if should_promote_to_object(arrays_and_dtypes, xp):
324324
return np.dtype(object)
325-
return array_api_compat.result_type(
326-
*map(
327-
functools.partial(
328-
maybe_promote_to_variable_width,
329-
# let extension arrays handle their own str/bytes
330-
should_return_str_or_bytes=any(
331-
map(utils.is_allowed_extension_array_dtype, arrays_and_dtypes)
332-
),
333-
),
334-
arrays_and_dtypes,
325+
maybe_promote = functools.partial(
326+
maybe_promote_to_variable_width,
327+
# let extension arrays handle their own str/bytes
328+
should_return_str_or_bytes=any(
329+
map(utils.is_allowed_extension_array_dtype, arrays_and_dtypes)
335330
),
336-
xp=xp,
337331
)
332+
return array_api_compat.result_type(*map(maybe_promote, arrays_and_dtypes), xp=xp)

0 commit comments

Comments
 (0)