Open umawani opened 9 months ago
Hey @umawani thanks for sharing this issue. We'll put it into backlog for review. If you think you have a solution, please share with us here.
Hey @HaebichanGX , hope you're well. I think the solution would be to defaulting the values to string when they are not serializable by the json.dumps method to avoid non-serializable errors. Specifically, the change I'm talking about should look something like this:
great_expectations/checkpoint/types/checkpoint_result.py (line:410)
return json.dumps(serializable_dict, indent=2, default=str)
Let me know what you think about this change. If you think this change is fine, I can go ahead and create a PR for it?
@umawani Have you tried updating to the latest gx
version?
I would suggest updating to at least 0.18.2
.
I have a similar problem on gx
version 0.18.7
Hey @HaebichanGX and @Kilo59
This issue still exists in 0.18.7
. Please look into this.
Bug Description Seems like when there is a non-string/number data type to return in the result object, the serialization of the object to JSON fails.
To Reproduce Here is my great_expcetations.yml:
My expectation suite:
And finally my checkpoint file:
The Python code that was used to execute this checkpoint is pretty straighforward:
The Stacktrace of the error received:
Expected behavior The expected behaviour is that the after the successful execution of the checkpoint, the checkpoint result object would be printed. Instead it seems like the checkpoint result object cannot be serialized into a JSON.
Environment (please complete the following information):
Additional context I think I know the issue. We should be giving a default string value to the json.dumps method which will then convert the data type to string while serializing.