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: apply global config globally #524

Merged

Conversation

PJCampi
Copy link
Contributor

@PJCampi PJCampi commented Apr 18, 2024

Use the encoder/decoder registered in the global configuration

dataclasses_json/core.py Outdated Show resolved Hide resolved
@george-zubrienko
Copy link
Collaborator

Will merge / release by EOW - maybe can squeeze another PR from @PJCampi on top of this one

Co-authored-by: George Zubrienko <zubrienkog@gmail.com>
@george-zubrienko george-zubrienko merged commit 7d76570 into lidatong:master Apr 25, 2024
9 checks passed
renovate bot added a commit to ixm-one/pytest-cmake-presets that referenced this pull request Apr 29, 2024
[![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)
([changelog](https://togithub.com/lidatong/dataclasses-json/releases)) |
`0.6.4` -> `0.6.5` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/dataclasses-json/0.6.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/dataclasses-json/0.6.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/dataclasses-json/0.6.4/0.6.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/dataclasses-json/0.6.4/0.6.5?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

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

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

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

#### What's Changed

- fix: apply global config globally by
[@&#8203;PJCampi](https://togithub.com/PJCampi) in
[lidatong/dataclasses-json#524
- fix: support generic dataclass by
[@&#8203;PJCampi](https://togithub.com/PJCampi) in
[lidatong/dataclasses-json#525

#### New Contributors

- [@&#8203;PJCampi](https://togithub.com/PJCampi) made their first
contribution in
[lidatong/dataclasses-json#524

**Full Changelog**:
lidatong/dataclasses-json@v0.6.4...v0.6.5

</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://developer.mend.io/github/ixm-one/pytest-cmake-presets).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMjEuMiIsInVwZGF0ZWRJblZlciI6IjM3LjMyMS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZTpkZXBlbmRlbmNpZXMiXX0=-->

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
def _decode_type(type_, value, infer_missing):
if _has_decoder_in_global_config(type_):
return _get_decoder_in_global_config(type_)(value)
if is_dataclass(type_) or is_dataclass(type_):
Copy link

@rtsscy rtsscy May 7, 2024

Choose a reason for hiding this comment

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

If this is a refactor from _decode_generic, would this line need to be
if is_dataclass(type_) or is_dataclass(value):

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes you are correct. Let me create a new PR to fix this.

@PJCampi PJCampi deleted the fix-apply-global-config-globally branch May 9, 2024 18:33
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