Skip to content
New issue

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

Skipping optional field cause parameter shuffling #229

Closed
zhPavel opened this issue Feb 5, 2024 · 0 comments
Closed

Skipping optional field cause parameter shuffling #229

zhPavel opened this issue Feb 5, 2024 · 0 comments
Assignees
Labels
3.x bug Something isn't working

Comments

@zhPavel
Copy link
Member

zhPavel commented Feb 5, 2024

from dataclasses import dataclass

from adaptix import Retort, name_mapping


@dataclass
class Model:
    a: int
    b: int = 2
    c: int = 3


retort = Retort(recipe=[name_mapping(Model, skip=['b'])])
assert retort.load({'a': 10, 'c': 30}, Model) == Model(a=10, b=30)

Result must be Model(a=10, c=30).
This also affects on current converting implementation

@zhPavel zhPavel added bug Something isn't working 3.x labels Feb 5, 2024
@zhPavel zhPavel self-assigned this Feb 10, 2024
@zhPavel zhPavel closed this as completed Feb 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant