Skip to content

Commit 48c5702

Browse files
committed
Move config warning next to code that ignores order
1 parent e9118db commit 48c5702

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/zarr/api/asynchronous.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,13 +1039,6 @@ async def create(
10391039
)
10401040
warnings.warn(UserWarning(msg), stacklevel=1)
10411041
config_dict["write_empty_chunks"] = write_empty_chunks
1042-
if order is not None and config is not None:
1043-
msg = (
1044-
"Both order and config keyword arguments are set. "
1045-
"This is redundant. When both are set, order will be ignored and "
1046-
"config will be used."
1047-
)
1048-
warnings.warn(UserWarning(msg), stacklevel=1)
10491042

10501043
config_parsed = ArrayConfig.from_dict(config_dict)
10511044

src/zarr/core/array.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,13 @@ async def _create(
603603

604604
if order is not None:
605605
_warn_order_kwarg()
606+
if config is not None:
607+
msg = (
608+
"Both order and config keyword arguments are set. "
609+
"This is redundant. When both are set, order will be ignored and "
610+
"config will be used."
611+
)
612+
warnings.warn(UserWarning(msg), stacklevel=1)
606613
config_parsed = replace(config_parsed, order=order)
607614

608615
result = await cls._create_v3(

0 commit comments

Comments
 (0)