-
Notifications
You must be signed in to change notification settings - Fork 0
Isolate the default encoders of subclasses. #2
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
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)
jsonstar/encoder.py
Outdated
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)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean to leave it like this or was this for debugging and L64 is what needs to stay?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was for debugging. I will fix it. Thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted. I was having trouble setting up my environment and it was fixed by updating this.
@justmobilize yes. I messed up the lock. Rerunning now. |
@justmobilize all green |
Before:
Registering a default encoder would impact any subclass of JSONEncoderStar.
After:
Registering default encoder on a subclass will not affect non-related subclasses.