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

First approach for the issue #25 #26

Closed
wants to merge 1 commit into from
Closed

Conversation

Fairlight8
Copy link
Contributor

As mentioned in the issue #25, this is one solution to the problem. However, this change directly overrides the schema every single time. I guess that the original devs added the check if not hasattr(cls, _PROPERTIES): for a reason.

So, in conclusion, if you still want to maintain that check for efficiency, or for other reasons of the code I still don't know. I have a second solution prepared.

@dkraczkowski
Copy link
Contributor

@Fairlight8 As per the discussion I would like to keep the check. This check is set in place to protect the data that should not be serialised as it is not explicitly marked as so.

@Fairlight8
Copy link
Contributor Author

@dkraczkowski But this change does not remove that check you are talking about. What it is removed is that the code does not add an encode/decode scheme if it already has one. I guess that this check is there to avoid unnecessary repetitions (i.e. if a class is decorated, but also included as a member of other serializable class). As I said, I thought of an alternative solution that maintains this check.

@dkraczkowski
Copy link
Contributor

@Fairlight8 Thanks, released the fix here: https://github.com/kodemore/chili/releases/tag/2.6.0

I have added a test and a lru cache to cover your scenario. Now it should be fine. Thanks for your support.

@dkraczkowski dkraczkowski added the bug Something isn't working label Nov 8, 2023
@dkraczkowski dkraczkowski added this to the 2.6.0 milestone Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants