Skip to content

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

Merged
merged 10 commits into from
Jan 29, 2025

Conversation

henriquebastos
Copy link
Collaborator

Before:

Registering a default encoder would impact any subclass of JSONEncoderStar.

After:

Registering default encoder on a subclass will not affect non-related subclasses.

…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)
…ith their base class without impacting other subclasses.

(cherry picked from commit 9e66fac)
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))
Copy link
Contributor

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?

Copy link
Collaborator Author

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

Copy link
Contributor

@justmobilize justmobilize left a 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.
Copy link
Contributor

Choose a reason for hiding this comment

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

@henriquebastos 2 things:

  1. We are still using 1.8
  2. Are there any real changes in here? If so, can this be it's own PR?

Copy link
Collaborator Author

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
Copy link
Contributor

@henriquebastos
Copy link
Collaborator Author

@justmobilize yes. I messed up the lock. Rerunning now.

@henriquebastos
Copy link
Collaborator Author

@justmobilize all green

@henriquebastos henriquebastos merged commit 21dd293 into main Jan 29, 2025
4 checks passed
@henriquebastos henriquebastos deleted the isolate-subclasses-default-encoders branch February 27, 2025 22:51
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.

3 participants