Skip to content

Commit

Permalink
feat: provide helper func to find objs with schema key within data in…
Browse files Browse the repository at this point in the history
…stance

Test for the helper func is included in this
commit as well
  • Loading branch information
candleindark committed Feb 7, 2025
1 parent 07ab7a2 commit 999ea3e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions dandischema/tests/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Dict, List, Optional, Union
from typing import Any, Dict, List, Optional, Union

import pytest

Expand Down Expand Up @@ -232,6 +232,8 @@ def test_sanitize_value() -> None:
),
],
)
def test_find_objs_parametrized(instance, schema_key, expected):
def test_find_objs_parametrized(
instance: Any, schema_key: str, expected: list[dict]
) -> None:
result = find_objs(instance, schema_key)
assert result == expected
2 changes: 1 addition & 1 deletion dandischema/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,6 @@ def find_objs_(data: Any) -> None:
else:
return

objs = []
objs: list[dict] = []
find_objs_(instance)
return objs

0 comments on commit 999ea3e

Please sign in to comment.