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

fix(unit): serialization into string not dict #389

Merged
merged 8 commits into from Mar 2, 2023

Conversation

EribertoLopez
Copy link
Contributor

Issue:

asdict(DispenseColumn) returns {'column': 1, 'volume': {'value': 700.0, 'units': 'microliter'}}
  • Unit dataclass is being serialized into a dict but is expected as a str

Solution:

  • Adding asdict(obj, dict_factory=unit_as_strings_factory)

@codecov-commenter
Copy link

codecov-commenter commented Feb 28, 2023

Codecov Report

Merging #389 (67ab4d1) into master (84665a7) will decrease coverage by 0.01%.
The diff coverage is 94.44%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff             @@
##           master     #389      +/-   ##
==========================================
- Coverage   84.62%   84.62%   -0.01%     
==========================================
  Files          23       24       +1     
  Lines        4541     4554      +13     
==========================================
+ Hits         3843     3854      +11     
- Misses        698      700       +2     
Impacted Files Coverage Δ
autoprotocol/version.py 0.00% <0.00%> (ø)
autoprotocol/builders.py 85.73% <100.00%> (ø)
autoprotocol/protocol.py 79.34% <100.00%> (+0.01%) ⬆️
autoprotocol/types/__init__.py 100.00% <100.00%> (ø)
autoprotocol/types/ref.py 94.59% <100.00%> (+0.15%) ⬆️
autoprotocol/unit.py 87.59% <100.00%> (-0.96%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Contributor

@joshhacksthings joshhacksthings left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@joshhacksthings joshhacksthings merged commit 30113a4 into master Mar 2, 2023
@joshhacksthings joshhacksthings deleted the EL/fix-unit-serialization branch March 2, 2023 00:01
@EribertoLopez EribertoLopez restored the EL/fix-unit-serialization branch March 2, 2023 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants