Skip to content

Commit 999ea3e

Browse files
committed
feat: provide helper func to find objs with schema key within data instance
Test for the helper func is included in this commit as well
1 parent 07ab7a2 commit 999ea3e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

dandischema/tests/test_utils.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Dict, List, Optional, Union
1+
from typing import Any, Dict, List, Optional, Union
22

33
import pytest
44

@@ -232,6 +232,8 @@ def test_sanitize_value() -> None:
232232
),
233233
],
234234
)
235-
def test_find_objs_parametrized(instance, schema_key, expected):
235+
def test_find_objs_parametrized(
236+
instance: Any, schema_key: str, expected: list[dict]
237+
) -> None:
236238
result = find_objs(instance, schema_key)
237239
assert result == expected

dandischema/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,6 @@ def find_objs_(data: Any) -> None:
160160
else:
161161
return
162162

163-
objs = []
163+
objs: list[dict] = []
164164
find_objs_(instance)
165165
return objs

0 commit comments

Comments
 (0)