Skip to content

Commit

Permalink
Don't emit warnings for each actually supported text YAML wildcard (#105
Browse files Browse the repository at this point in the history
)
  • Loading branch information
akx authored Nov 10, 2023
1 parent 6e921b8 commit dcfc03d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/dynamicprompts/wildcards/collection/structured.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def _parse_structured_file_list(value: list[Any]) -> Iterable[str | WildcardItem
# fall through to yielding the item as-is.
pass
yield item
continue
elif isinstance(item, dict):
# Support {"text": "foo", "weight": 1.1} syntax
# and {"content": "foo", "weight": 1.1}
Expand Down
6 changes: 6 additions & 0 deletions tests/wildcard/test_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from dynamicprompts.wildcards.collection.structured import _parse_structured_file_list


def test_structured_parsing_emits_no_warnings(caplog):
assert list(_parse_structured_file_list(["a", "b", "c"])) == ["a", "b", "c"]
assert not caplog.records

0 comments on commit dcfc03d

Please sign in to comment.