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

Transform custom PyEvent into standard python dictionary for easier d… #557

Merged
merged 7 commits into from
Jun 17, 2024

Conversation

haixuanTao
Copy link
Collaborator

@haixuanTao haixuanTao commented Jun 16, 2024

…ebuggability.

Currently having a custom PyEvent make debugging very hard as fields are hidden within the class PyEvent that is defined within Rust Code.

Python user are getting really confused about this obscure class.

This PR transforms the class into a standard python dictionary.

It also makes external event and dora event expose the same user API meaning to access the data people just use:

data = event["value"] instead of data = event.inner()

…ebuggability.

Currently having a custom PyEvent make debugging very hard as fields are hidden within the class PyEvent that is defined within Rust Code.

Python user are getting really confused about this obscure class.

This PR transforms the class into a standard python dictionary.
Copy link
Collaborator

@phil-opp phil-opp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall!

Is this a breaking change or does existing code continue to work?

apis/python/node/src/lib.rs Outdated Show resolved Hide resolved
apis/python/operator/src/lib.rs Outdated Show resolved Hide resolved
examples/python-dataflow/requirements.txt Outdated Show resolved Hide resolved
@haixuanTao
Copy link
Collaborator Author

Ezisting code will continue to work!

Except for ros2-bridge where you will have to change data.inner() -> data["value"] but I think that it is still okay as a breaking change

@phil-opp
Copy link
Collaborator

Ezisting code will continue to work!

Except for ros2-bridge where you will have to change data.inner() -> data["value"] but I think that it is still okay as a breaking change

Ok great! The ROS2 bridge change is fine I think given that we still consider it experimental.

@haixuanTao
Copy link
Collaborator Author

Ezisting code will continue to work!
Except for ros2-bridge where you will have to change data.inner() -> data["value"] but I think that it is still okay as a breaking change

Ok great! The ROS2 bridge change is fine I think given that we still consider it experimental.

Yup. It makes the current implementation of the ros2-bridge closer to the rest of dora API

@haixuanTao haixuanTao force-pushed the convert-pyevent-into-dictionary branch from 1a15af7 to a8d4c07 Compare June 17, 2024 11:38
@haixuanTao haixuanTao merged commit 42255f5 into main Jun 17, 2024
18 checks passed
@haixuanTao haixuanTao deleted the convert-pyevent-into-dictionary branch June 17, 2024 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants