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

Support for Counter objects #471

Merged
merged 5 commits into from
Aug 18, 2023
Merged

Support for Counter objects #471

merged 5 commits into from
Aug 18, 2023

Conversation

matt035343
Copy link
Collaborator

Based on #363, I have resolved the conflicts and fixed a bug I found when updating the rest of the code base.

@n1chre please have a look.

@github-actions
Copy link

github-actions bot commented Aug 12, 2023

Coverage

Coverage Report
FileStmtsMissCoverMissing
dataclasses_json
   cfg.py51492%80, 84–86
   core.py2371096%38–41, 51, 64, 66, 81, 83, 169, 197
   mm.py2023085%33–36, 42–45, 53–56, 62–65, 88, 161–162, 167, 171, 175, 180, 184, 188, 196, 202, 207, 216, 221, 226, 235, 244–251
   stringcase.py25388%59, 76, 97
   undefined.py143299%24, 38
   utils.py1313673%12–25, 45–50, 61–65, 75, 100–101, 109–110, 125–133, 163, 182, 207
tests
   entities.py234399%22, 234, 240
   test_annotations.py814248%50–67, 78–102, 106–122
   test_api.py142497%88, 99, 139–140
   test_str_subclass.py22195%9
   test_union.py981090%87–94, 108–115
TOTAL250314594% 

Tests Skipped Failures Errors Time
294 3 💤 0 ❌ 0 🔥 5.858s ⏱️

Copy link
Collaborator

@george-zubrienko george-zubrienko left a comment

Choose a reason for hiding this comment

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

https://docs.python.org/3/library/collections.html#collections.Counter

afaik typing.Counter is deprecated and Counter is just another python sugar for a dictionary type. Does this affect implementation, if taken into account?

@matt035343
Copy link
Collaborator Author

@george-zubrienko Since it is only the typing alias that is deprecated I can use collections.Counter instead. I still think support for Counter is relevant even though it is just a wrapper.

@george-zubrienko
Copy link
Collaborator

@george-zubrienko Since it is only the typing alias that is deprecated I can use collections.Counter instead. I still think support for Counter is relevant even though it is just a wrapper.

Yeah I do not deny this is needed, I'm just curious if we can fallback to code that handles dict instead of writing logic specific to Counter type, given this might break due to import being removed in future python versions?

Copy link
Collaborator

@george-zubrienko george-zubrienko left a comment

Choose a reason for hiding this comment

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

Bless typing lib :D

@matt035343
Copy link
Collaborator Author

I will merge this by the end of this week unless @n1chre raises any concerns

@matt035343 matt035343 merged commit 89578cb into master Aug 18, 2023
9 checks passed
@matt035343 matt035343 deleted the coutner branch August 18, 2023 07:06
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

2 participants