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

Fixes recursive dict encoding #394

Merged
merged 4 commits into from
Jun 6, 2023

Conversation

matt035343
Copy link
Collaborator

Fixes #391, please refer to this issue for a detailed description of what is fixed in this pull request.

I implemented both a fix to the encoding and added tests that will capture the behaviour.

@AbsurdlySuspicious
Copy link

AbsurdlySuspicious commented Feb 1, 2023

Wouldn't this still fail on dicts and lists with more than one level of nesting? I believe this type check should be done in _encode_json_type to be properly recursive

@matt035343
Copy link
Collaborator Author

@AbsurdlySuspicious

Wouldn't this still fail on dicts and lists with more than one level of nesting? I believe this type check should be done in _encode_json_type to be properly recursive

You are absolutely right. I have now fixed it and changed the test to catch this case as well.

@george-zubrienko
Copy link
Collaborator

@matt035343 could you sync your branch with master, so CI runs again w/o py3.6?

@george-zubrienko george-zubrienko self-requested a review June 5, 2023 17:46
@matt035343 matt035343 merged commit 83d3724 into lidatong:master Jun 6, 2023
4 checks passed
@matt035343 matt035343 deleted the recursive-dict-encoding branch June 6, 2023 11:51
renovate bot added a commit to ixm-one/pytest-cmake-presets that referenced this pull request Jun 12, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [dataclasses-json](https://togithub.com/lidatong/dataclasses-json) |
`0.5.7` -> `0.5.8` |
[![age](https://badges.renovateapi.com/packages/pypi/dataclasses-json/0.5.8/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/pypi/dataclasses-json/0.5.8/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/pypi/dataclasses-json/0.5.8/compatibility-slim/0.5.7)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/pypi/dataclasses-json/0.5.8/confidence-slim/0.5.7)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>lidatong/dataclasses-json</summary>

###
[`v0.5.8`](https://togithub.com/lidatong/dataclasses-json/releases/tag/v0.5.8)

[Compare
Source](https://togithub.com/lidatong/dataclasses-json/compare/v0.5.7...v0.5.8)

#### What's Changed

-
[#&#8203;341](https://togithub.com/lidatong/dataclasses-json/issues/341):
Fixes for type-parameters without arguments by
[@&#8203;USSX-Hares](https://togithub.com/USSX-Hares) in
[lidatong/dataclasses-json#346
- ci: disable 3.6 by [@&#8203;lidatong](https://togithub.com/lidatong)
in
[lidatong/dataclasses-json#400
- ci: bump gh action by
[@&#8203;lidatong](https://togithub.com/lidatong) in
[lidatong/dataclasses-json#403
- Update usage of mypy.main in test following updates to mypy package by
[@&#8203;rpmcginty](https://togithub.com/rpmcginty) in
[lidatong/dataclasses-json#374
- Fixes recursive dict encoding by
[@&#8203;matt035343](https://togithub.com/matt035343) in
[lidatong/dataclasses-json#394
- Removes unused type variables in api.py by
[@&#8203;matt035343](https://togithub.com/matt035343) in
[lidatong/dataclasses-json#415
- Documentation: added example of global_config by
[@&#8203;nr23](https://togithub.com/nr23) in
[lidatong/dataclasses-json#189
- ci: add publish to gh action workflow by
[@&#8203;lidatong](https://togithub.com/lidatong) in
[lidatong/dataclasses-json#421

#### New Contributors

- [@&#8203;rpmcginty](https://togithub.com/rpmcginty) made their first
contribution in
[lidatong/dataclasses-json#374
- [@&#8203;matt035343](https://togithub.com/matt035343) made their first
contribution in
[lidatong/dataclasses-json#394
- [@&#8203;nr23](https://togithub.com/nr23) made their first
contribution in
[lidatong/dataclasses-json#189

**Full Changelog**:
lidatong/dataclasses-json@v0.5.7...v0.5.8

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/ixm-one/pytest-cmake-presets).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMTAuMCIsInVwZGF0ZWRJblZlciI6IjM1LjExMC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.

to_dict(encode_json=True) is not recursive
3 participants