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

Add support for NumPy arrays to the arrow serializer for string datatypes #7689

Merged
merged 8 commits into from
Oct 14, 2024

Conversation

abey79
Copy link
Member

@abey79 abey79 commented Oct 11, 2024

What

This adds support for Numpy array for batches of Utf8 datatypes. For example, this facilitates logging a TextBatch when using Pandas dataframe:

rr.send_columns(
    "/entity/path",
    times=[rr.TimeSequenceColumn("frame_nr", df["frame_nr"])],
    components=[
        rr.components.TextBatch(np.where(df["mouth_open"], "OPEN", "CLOSE")),
    ],
)

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG
  • If applicable, add a new check to the release checklist!
  • If have noted any breaking changes to the log API in CHANGELOG.md and the migration guide

To run all checks from main, comment on the PR with @rerun-bot full-check.

@Wumpf Wumpf self-requested a review October 11, 2024 09:29
@abey79 abey79 marked this pull request as draft October 11, 2024 09:30
Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

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

unit test plz!

also this could be fairly easy part of codegen? Something seems to be wrong with codegen here

@abey79 abey79 changed the title Add support for NumPy arrays to the Utf8 datatype arrow serializer Add support for NumPy arrays to the arrow serializer for string datatypes Oct 11, 2024
@abey79 abey79 force-pushed the antoine/utf8-numpy branch from 9d7a0d8 to bb3f99f Compare October 11, 2024 13:04
@abey79 abey79 marked this pull request as ready for review October 11, 2024 13:04
@abey79 abey79 force-pushed the antoine/utf8-numpy branch from bb3f99f to 487e557 Compare October 11, 2024 13:15
@abey79 abey79 requested a review from Wumpf October 11, 2024 13:15
Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

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

annotation only change now huh? But very nice to solve this once and for all via codegen :)

@abey79 abey79 merged commit 07fb9e7 into main Oct 14, 2024
35 checks passed
@abey79 abey79 deleted the antoine/utf8-numpy branch October 14, 2024 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants