From 3e31f216a58243aacef288a53b928e6f498e1cdb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 20:13:22 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- virtualizarr/tests/test_writers/test_icechunk.py | 1 - virtualizarr/writers/icechunk.py | 16 ++++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/virtualizarr/tests/test_writers/test_icechunk.py b/virtualizarr/tests/test_writers/test_icechunk.py index 52aea027..04524670 100644 --- a/virtualizarr/tests/test_writers/test_icechunk.py +++ b/virtualizarr/tests/test_writers/test_icechunk.py @@ -1,4 +1,3 @@ -import asyncio from pathlib import Path from typing import TYPE_CHECKING diff --git a/virtualizarr/writers/icechunk.py b/virtualizarr/writers/icechunk.py index 468de988..0adbc59d 100644 --- a/virtualizarr/writers/icechunk.py +++ b/virtualizarr/writers/icechunk.py @@ -65,7 +65,11 @@ def write_variables_to_icechunk_group( group, ): print(variables) - virtual_variables = {name: var for name, var in variables.items() if isinstance(var.data, ManifestArray)} + virtual_variables = { + name: var + for name, var in variables.items() + if isinstance(var.data, ManifestArray) + } for name, var in virtual_variables.items(): write_virtual_variable_to_icechunk( @@ -75,8 +79,10 @@ def write_variables_to_icechunk_group( var=var, ) - loadable_variables = {name: var for name, var in variables.items() if name not in virtual_variables} - + loadable_variables = { + name: var for name, var in variables.items() if name not in virtual_variables + } + ds = Dataset(loadable_variables) ds.to_zarr(store, zarr_format=3, consolidated=False, mode="r+") @@ -96,7 +102,9 @@ def write_variable_to_icechunk( var=var, ) else: - raise ValueError("Cannot write non-virtual variables as virtual variables to Icechunk stores") + raise ValueError( + "Cannot write non-virtual variables as virtual variables to Icechunk stores" + ) def write_virtual_variable_to_icechunk(