Skip to content

Conversation

grtlr
Copy link
Contributor

@grtlr grtlr commented May 26, 2025

Related

What

This PR does multiple things:

  • Works towards providing a common AnyValues interface that is similar across Python 🐍 , C++ 🌊 , and Rust 🦀 SDKs (so far we only have AnyValues in Python).
  • By using the new AnyValues we ensure that more of the logged data is actually tagged.

Copy link

github-actions bot commented May 26, 2025

Web viewer built successfully. If applicable, you should also test it:

  • I have tested the web viewer
Result Commit Link Manifest
f59fbb9 https://rerun.io/viewer/pr/10074 +nightly +main

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

@grtlr grtlr added include in changelog 🚜 refactor Change the code, not the functionality 🪵 Log & send APIs Affects the user-facing API for all languages 🔩 data model Sorbet labels May 26, 2025
@grtlr grtlr force-pushed the grtlr/any-values branch 3 times, most recently from d546580 to b68f3c3 Compare May 26, 2025 13:05
Comment on lines +17 to +25
Arc::new(arrow::array::StringArray::from(vec![
"https://www.rerun.io",
])),
)
.with_field(
"repository",
Arc::new(arrow::array::StringArray::from(vec![
"https://github.com/rerun-io/rerun",
])),
Copy link
Member

Choose a reason for hiding this comment

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

If we use impl Into<ArrayRef> as the argument type, maybe we can get rid of the Arc::new here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried this, but unfortunately could not get the compiler to comply.

@grtlr grtlr changed the base branch from main to grtlr/big-switcheroo June 6, 2025 10:43
@grtlr grtlr force-pushed the grtlr/any-values branch from 3e4da6f to b312be2 Compare June 6, 2025 10:46
@grtlr grtlr force-pushed the grtlr/big-switcheroo branch 2 times, most recently from be8b72d to f860d0d Compare June 11, 2025 06:20
Base automatically changed from grtlr/big-switcheroo to main June 12, 2025 06:56
@grtlr grtlr changed the title Unify AnyValues across all SDKs and use archetype_field_name as discriminator Provide AnyValues helpers in Rust SDK Jun 12, 2025
@grtlr grtlr mentioned this pull request Jun 12, 2025
2 tasks
@grtlr grtlr force-pushed the grtlr/any-values branch 2 times, most recently from b813e71 to 1fed3a5 Compare June 12, 2025 14:20
@grtlr grtlr changed the base branch from main to grtlr/remove-component-batch-descriptor-cpp June 12, 2025 14:21
@grtlr grtlr requested a review from emilk June 12, 2025 14:22
@grtlr grtlr marked this pull request as ready for review June 12, 2025 14:23
@grtlr grtlr removed the 🚜 refactor Change the code, not the functionality label Jun 12, 2025
Comment on lines +18 to +20
/// Assigns an (archetype) name to this set of any values.
#[inline]
pub fn new(archetype_name: impl Into<ArchetypeName>) -> Self {
Copy link
Member

Choose a reason for hiding this comment

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

I think most users will first grab for AnyValues::new(), and maybe not even realize there is a AnyValues::default(), and so they will wonder what they should pick for archetype name.

So I suggest we do builder pattern all the way instead:

AnyValues::new().with_field()
// vs
AnyValues::new().with_archtype_name().with_field()

or alternatively use a more verbose ctor name:

AnyValues::new().with_field()
// vs
AnyValues::from_archtype_name().with_field()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I deliberately made that choice to nudge users to provide an archetype name, which should be good practice going forward as it helps with uniquely identifying the data going forward.

Base automatically changed from grtlr/remove-component-batch-descriptor-cpp to main June 13, 2025 08:48
Copy link

github-actions bot commented Jun 13, 2025

Latest documentation preview deployed successfully.

Result Commit Link
681dbc6 https://landing-ik6jd35fu-rerun.vercel.app/docs

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

@grtlr grtlr force-pushed the grtlr/any-values branch from 681dbc6 to ddf0a1d Compare June 13, 2025 09:05
@grtlr grtlr force-pushed the grtlr/any-values branch from ddf0a1d to f59fbb9 Compare June 13, 2025 09:06
@grtlr grtlr merged commit f1c6141 into main Jun 13, 2025
40 checks passed
@grtlr grtlr deleted the grtlr/any-values branch June 13, 2025 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔩 data model Sorbet include in changelog 🪵 Log & send APIs Affects the user-facing API for all languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AnyValues should use argument names to set archetype_field_name metadata
2 participants