Isolate the default encoders of subclasses.#2
Merged
henriquebastos merged 10 commits intomainfrom Jan 29, 2025
Merged
Conversation
…ith their base class without impacting other subclasses.
Revert "Update poetry and lock." This reverts commit 44d33c6. Revert "Replace default encoder lambdas with named functions to facilitate debugging." This reverts commit 83ac429. Revert "Allow JSONEncoder subclasses to have isolated namespaces to compose with their base class without impacting other subclasses." This reverts commit 9e66fac.
(cherry picked from commit 44d33c6)
…bugging. (cherry picked from commit 83ac429)
…ith their base class without impacting other subclasses. (cherry picked from commit 9e66fac)
tomharel
reviewed
Jan 28, 2025
jsonstar/encoder.py
Outdated
Comment on lines
+59
to
+64
| a = cls._default_typed_encoders | ||
| b = cls.__base__.default_typed_encoders() | ||
| c = ChainMap(a, b) | ||
| d = TypedEncoderRegistry(c) | ||
| return d | ||
| # return TypedEncoderRegistry(ChainMap(cls.__base__.default_typed_encoders(), cls._default_typed_encoders)) |
Contributor
There was a problem hiding this comment.
Did you mean to leave it like this or was this for debugging and L64 is what needs to stay?
Collaborator
Author
There was a problem hiding this comment.
It was for debugging. I will fix it. Thank you
Contributor
justmobilize
left a comment
There was a problem hiding this comment.
@henriquebastos can you point a BE branch to this branch and run a full test pass on Circle?
poetry.lock
Outdated
| @@ -1,25 +1,27 @@ | |||
| # This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. | |||
| # This file is automatically @generated by Poetry 2.0.1 and should not be changed by hand. | |||
Contributor
There was a problem hiding this comment.
@henriquebastos 2 things:
- We are still using 1.8
- Are there any real changes in here? If so, can this be it's own PR?
Collaborator
Author
There was a problem hiding this comment.
Reverted. I was having trouble setting up my environment and it was fixed by updating this.
tomharel
approved these changes
Jan 29, 2025
Contributor
Collaborator
Author
|
@justmobilize yes. I messed up the lock. Rerunning now. |
Collaborator
Author
|
@justmobilize all green |
justmobilize
approved these changes
Jan 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before:
Registering a default encoder would impact any subclass of JSONEncoderStar.
After:
Registering default encoder on a subclass will not affect non-related subclasses.