Blob Blame History Raw
From c15aabe93e8468ac7561bbdcc2a1a2898bc07d83 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Thu, 20 May 2021 02:40:23 -0400
Subject: [PATCH 4/5] Fix type inference for dask push.

Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
 xarray/core/dask_array_ops.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/xarray/core/dask_array_ops.py b/xarray/core/dask_array_ops.py
index 87f67028..0bd2cece 100644
--- a/xarray/core/dask_array_ops.py
+++ b/xarray/core/dask_array_ops.py
@@ -66,9 +66,10 @@ def push(array, n, axis):
         )
     if all(c == 1 for c in array.chunks[axis]):
         array = array.rechunk({axis: 2})
-    pushed = array.map_blocks(push, axis=axis, n=n)
+    pushed = array.map_blocks(push, axis=axis, n=n, dtype=array.dtype, meta=array._meta)
     if len(array.chunks[axis]) > 1:
         pushed = pushed.map_overlap(
-            push, axis=axis, n=n, depth={axis: (1, 0)}, boundary="none"
+            push, axis=axis, n=n, depth={axis: (1, 0)}, boundary="none",
+            dtype=array.dtype, meta=array._meta
         )
     return pushed
-- 
2.31.1