-
Notifications
You must be signed in to change notification settings - Fork 26
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 JSONValues container for holding Python values as JSON objects if possible, and as pybind11::object otherwise #455
Add JSONValues container for holding Python values as JSON objects if possible, and as pybind11::object otherwise #455
Conversation
…ception Remove uneeded as_string method
…al with unsupported objects
…devin-json-serializable
…alized python objects
…methods to check if the object is holding unserializable objects, and the ability to return a json doc
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## branch-24.06 #455 +/- ##
================================================
+ Coverage 73.68% 73.77% +0.09%
================================================
Files 400 402 +2
Lines 14275 14395 +120
Branches 1113 1129 +16
================================================
+ Hits 10518 10620 +102
- Misses 3757 3775 +18
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 4 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
/merge |
* Contains breaking changes for the C++ API * No breaking changes for the Python API * Updates `nlohmann_json from` 3.9 to 3.11 for `patch_inplace` method. * Requires nv-morpheus/MRC#455 to be merged first Closes #1560 ## By Submitting this PR I confirm: - I am familiar with the [Contributing Guidelines](https://github.com/nv-morpheus/Morpheus/blob/main/docs/source/developer_guide/contributing.md). - When the PR is ready for review, new or existing tests cover these changes. - When the PR is ready for review, the documentation is up to date with these changes. Authors: - David Gardner (https://github.com/dagardner-nv) Approvers: - Michael Demoret (https://github.com/mdemoret-nv) URL: #1589
Description
unserializable_handler_fn
callback tomrc::pymrc::cast_from_pyobject
which will be invoked for any unsupported Python object. Allowing for serializing unsupported object.ex:
Add
JSONValues
container class which is an immutable container for holding Python values asnlohmann::json
objects if possible, and aspybind11::object
otherwise. The container can be copied and moved, but the underlyingnlohmann::json
object is immutable.Updates
nlohmann_json
from 3.9 to 3.11 forpatch_inplace
method.Incorporates ideas from @drobison00's PR Update PythonObjectCache to support get and pop operations, update utils to allow passing of cached python objects. #417 with three key differences:
cast_from_pyobject
are opt-in whenunserializable_handler_fn
is provided, otherwise there is no behavior change to the method.JSONValues
rather than a global cache.This PR is related to nv-morpheus/Morpheus#1560
Checklist