-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add deserialization_fn parameter to serializable_field #44
Conversation
GitHub actions yielded the following error. The relevant lines from the logs are:
This error occurred during the execution of the command This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests. I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR. |
GitHub actions yielded the following error. The relevant lines from the logs are:
These errors occurred during the execution of the This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests. I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR. |
3 similar comments
GitHub actions yielded the following error. The relevant lines from the logs are:
These errors occurred during the execution of the This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests. I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR. |
GitHub actions yielded the following error. The relevant lines from the logs are:
These errors occurred during the execution of the This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests. I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR. |
GitHub actions yielded the following error. The relevant lines from the logs are:
These errors occurred during the execution of the This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests. I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR. |
GitHub actions yielded the following error. The relevant lines from the logs are:
These errors occurred during the execution of the This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests. I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR. |
Description
This PR adds a new
deserialization_fn
parameter to theserializable_field()
function in themuutils.json_serialize.serializable_dataclass
module. Thedeserialization_fn
parameter allows for specifying a function that will be used to deserialize individual fields, taking the field value as an argument. This change improves the code clarity and aligns with typical usage patterns for deserialization functions.Summary of Changes
deserialization_fn
parameter to theSerializableField
class in themuutils.json_serialize.serializable_dataclass
module.serializable_field()
function to include thedeserialization_fn
parameter when creatingSerializableField
instances.serializable_dataclass
decorator function to handle thedeserialization_fn
parameter when creating or modifyingSerializableField
instances.Fixes #40.
To checkout this PR branch, run the following command in your terminal:
To make tweaks to this pull request, leave a comment below or in the code.