From d502e0569a2afa8138c421d54376e32940e58f65 Mon Sep 17 00:00:00 2001 From: Tom White Date: Thu, 10 Mar 2022 13:56:48 +0000 Subject: [PATCH] Allow write_empty_chunks to be set in Zarr encoding --- xarray/backends/zarr.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xarray/backends/zarr.py b/xarray/backends/zarr.py index 97517818d07..aca0b8064f5 100644 --- a/xarray/backends/zarr.py +++ b/xarray/backends/zarr.py @@ -212,7 +212,13 @@ def extract_zarr_variable_encoding( """ encoding = variable.encoding.copy() - valid_encodings = {"chunks", "compressor", "filters", "cache_metadata"} + valid_encodings = { + "chunks", + "compressor", + "filters", + "cache_metadata", + "write_empty_chunks", + } if raise_on_invalid: invalid = [k for k in encoding if k not in valid_encodings]