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

[BUG]: mrc::pymrc::cast_from_pyobject should throw an exception rather than returning a None #450

Closed
2 tasks done
dagardner-nv opened this issue Mar 11, 2024 · 0 comments · Fixed by #451
Closed
2 tasks done
Assignees
Labels
bug Something isn't working

Comments

@dagardner-nv
Copy link
Contributor

Version

24.03

Which installation method(s) does this occur on?

No response

Describe the bug.

Encountered this while working on nv-morpheus/Morpheus#1539 when cast_from_pyobject encounters an object which is not json serializable it returns a None.

Instead we should throw a TypeError since that is the error that the Python std json.dumps rasises.

Minimum reproducible example

from morpheus.llm import LLMContext
ctx = LLMContext()
ctx.set_output(['a', RuntimeError('test'), 'b'])
print(ctx.view_outputs)

Relevant log output

No response

Full env printout

No response

Other/Misc.

No response

Code of Conduct

  • I agree to follow MRC's Code of Conduct
  • I have searched the open bugs and have found no duplicates for this bug report
@dagardner-nv dagardner-nv added the bug Something isn't working label Mar 11, 2024
@dagardner-nv dagardner-nv self-assigned this Mar 11, 2024
dagardner-nv added a commit to dagardner-nv/MRC that referenced this issue Mar 11, 2024
@rapids-bot rapids-bot bot closed this as completed in #451 Mar 12, 2024
rapids-bot bot pushed a commit that referenced this issue Mar 12, 2024
…eturning null (#451)

* Currently when `cast_from_pyobject` encounters an unsupported type it returns a json null.
* Updates the method to throw a `pybind11::type_error`, matching the `TypeError` exception raised by the Python std `json.dumps` method.
* Add `get_py_type_name` helper method
* Breaking behavior change

Closes #450

Authors:
  - David Gardner (https://github.com/dagardner-nv)

Approvers:
  - Michael Demoret (https://github.com/mdemoret-nv)

URL: #451
@github-project-automation github-project-automation bot moved this from Todo to Done in Morpheus Boards Mar 12, 2024
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
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant