Skip to content

py-sdk: add register_prefix SDK call#11600

Merged
andrea-reale merged 2 commits intomainfrom
andrea/py_prefix_reg
Oct 27, 2025
Merged

py-sdk: add register_prefix SDK call#11600
andrea-reale merged 2 commits intomainfrom
andrea/py_prefix_reg

Conversation

@andrea-reale
Copy link
Member

Related

What

This PR builds up on the previous work and adds a new register_prefix python
SDK function that allows end-users to register all the recordings under a given
object store prefix (i.e., a directory).

Why

In a previous version of this change, we allowed users to register a prefix
simply by implicitly interpreting any trailing '/' in the object store URL as meaning
the customer wanted to register a prefix.

As debated in #11564, however, this is error prone, so we moved to requiring an explicit signal.

Instead of modifying the signature of the existing register_batch function in non-obvious
and possibly odd ways, I decided to add a new function that is explicit in its intent, that is.
register_prefix.

FAQs

  • The redap API allows prefix and non-prefix DataSources to be mixed in the same call. Why does
    the python SDK not allow this?
    • We'd need to make the register_batch python function signature more complex and awkward.
      This keeps the user surface simple, while leaving room for future improvements if needed.
  • Why not register_prefixes (plural)?
    • We could, but I don't see a strong use case for registering multiple prefixes
      at once.

Testing

Manually

@github-actions
Copy link

github-actions bot commented Oct 20, 2025

Web viewer built successfully.

Result Commit Link Manifest
7229ee7 https://rerun.io/viewer/pr/11600 +nightly +main

View image diff on kitdiff.

Note: This comment is updated whenever you push a commit.

@andrea-reale andrea-reale force-pushed the andrea/py_prefix_reg branch 3 times, most recently from 2e7d5ed to 3f24ef1 Compare October 20, 2025 16:21
@andrea-reale andrea-reale added dataplatform Rerun Data Platform integration include in changelog sdk-python Python logging API labels Oct 20, 2025
@andrea-reale andrea-reale requested a review from abey79 October 20, 2025 16:24
@andrea-reale andrea-reale marked this pull request as ready for review October 20, 2025 16:25
Copy link
Member

@abey79 abey79 left a comment

Choose a reason for hiding this comment

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

Apart from the bikeshedding, this lgtm, thanks.


"""

def register_prefix(self, recordings_prefix: str, recordings_layer: str | None = None) -> Tasks:
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure about the signature, see slack thread.

Signed-off-by: Andrea Reale <[email protected]>
@andrea-reale andrea-reale merged commit 1647cd9 into main Oct 27, 2025
41 checks passed
@andrea-reale andrea-reale deleted the andrea/py_prefix_reg branch October 27, 2025 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dataplatform Rerun Data Platform integration include in changelog sdk-python Python logging API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants