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

Allow bytes in from_json typing #471

Merged
merged 2 commits into from
Feb 12, 2024
Merged

Conversation

davetapley
Copy link
Contributor

Fixes #450

@davetapley davetapley changed the title From json bytes Allow bytes in from_json typing Feb 6, 2024
Copy link

codecov bot commented Feb 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (cd7d84a) 89.82% compared to head (e493deb) 89.82%.
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #471   +/-   ##
=======================================
  Coverage   89.82%   89.82%           
=======================================
  Files          12       12           
  Lines        1937     1937           
  Branches      401      401           
=======================================
  Hits         1740     1740           
  Misses        145      145           
  Partials       52       52           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Owner

@yukinarit yukinarit left a comment

Choose a reason for hiding this comment

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

Thanks! @davetapley Please take a look at my comments.

serde/de.py Outdated
@@ -390,7 +391,7 @@ class Deserializer(Generic[T], metaclass=abc.ABCMeta):

@classmethod
@abc.abstractmethod
def deserialize(cls, data: T, **opts: Any) -> Any:
def deserialize(cls, data: AnyStr, **opts: Any) -> Any:
Copy link
Owner

Choose a reason for hiding this comment

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

Can you leave it unchanged as it may be non AnyStr in the future?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. Done (amended)!

Copy link
Owner

@yukinarit yukinarit left a comment

Choose a reason for hiding this comment

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

LGTM!

@yukinarit yukinarit added the enhancement New feature or request label Feb 12, 2024
@yukinarit yukinarit merged commit c9cb405 into yukinarit:main Feb 12, 2024
9 checks passed
github-actions bot pushed a commit that referenced this pull request Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing option bytes typing in from_json (and maybe others)
2 participants