We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello and thank you for amazing library! i have problem with next simple example:
from dataclasses import dataclass import pytest from adaptix import Retort from adaptix._internal.morphing.provider_template import ABCProxy @dataclass(frozen=True) class B: b: str @dataclass class A: a: set[B] @pytest.fixture def retort() -> Retort: return Retort( recipe=[ ABCProxy(set, list, for_loader=False), ] ) def test_retort(retort: Retort): assert retort.dump(set(), set) == [] assert retort.load([], set) == set() assert retort.dump({1, 2}, set) == [1, 2] assert retort.load([1, 2], set) == {1, 2} assert retort.dump(A({B("a")})) == {"a": [{"b": "a"}]}
This test failed with next error:
FAILED [100%] test_deserialize.py:106 (test_retort) {'a': [B(b='a')]} != {'a': [{'b': 'a'}]} Expected :{'a': [{'b': 'a'}]} Actual :{'a': [B(b='a')]} retort = <adaptix._internal.morphing.facade.retort.Retort object at 0x7fc7ba919210> def test_retort(retort: Retort): assert retort.dump(set(), set) == [] assert retort.load([], set) == set() assert retort.dump({1, 2}, set) == [1, 2] assert retort.load([1, 2], set) == {1, 2} > assert retort.dump(A({B("a")})) == {"a": [{"b": "a"}]} E AssertionError: assert {'a': [B(b='a')]} == {'a': [{'b': 'a'}]} E Differing items: E {'a': [B(b='a')]} != {'a': [{'b': 'a'}]} E Full diff: E - {'a': [{'b': 'a'}]} E + {'a': [B(b='a')]} test_deserialize.py:112: AssertionError
The text was updated successfully, but these errors were encountered:
I guess we newer want to save sets after loading, so we can convert any Iterable to lists and it will be great in most cases
Sorry, something went wrong.
Merge pull request #349 from reagento/iterable-serialization
c9f9a88
Fix #348, Iterable is now converted to tuple or list
Fixed at #349
No branches or pull requests
Hello and thank you for amazing library!
i have problem with next simple example:
This test failed with next error:
The text was updated successfully, but these errors were encountered: