-
Notifications
You must be signed in to change notification settings - Fork 331
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
Introduce ColumnSelector instead of ColumnDescriptor #7444
Conversation
7a33c41
to
7fc5c90
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this new API, it fits the dataframe view well. And I can see a path to have the future ArchetypeSelector
usable there as well.
impl From<ControlColumnDescriptor> for ControlColumnSelector { | ||
fn from(desc: ControlColumnDescriptor) -> Self { | ||
Self { | ||
component: desc.component_name, | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A helper for the row id column would be neat here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ha, yeah, I did exactly that in the python APIs.
pub fn new<C: re_types_core::Component>(entity_path: EntityPath) -> Self { | ||
Self { | ||
entity_path, | ||
component: C::name(), | ||
join_encoding: JoinEncoding::default(), | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: from my perspective, this is a bit too restrictive an API to deserve the privileged new()
name. Oftentimes, I just have a component name (e.g. when deserialising from blueprint).
pub fn new<C: re_types_core::Component>(entity_path: EntityPath) -> Self { | |
Self { | |
entity_path, | |
component: C::name(), | |
join_encoding: JoinEncoding::default(), | |
} | |
} | |
pub fn new(entity_path: EntityPath, component: ComponentName) -> Self { | |
Self { | |
entity_path, | |
component, | |
join_encoding: JoinEncoding::default(), | |
} | |
} | |
pub fn new_for_component<C: re_types_core::Component>(entity_path: EntityPath) -> Self { | |
Self::new(entity_path, C::name()) | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you are practically speaking in the minority of users that would feel restricted here. I think having concrete components is likely to be the more common pattern than dealing with raw ComponentNames.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough.
archetype_name: None, | ||
archetype_field_name: None, | ||
component_name: selector.component, | ||
store_datatype: ArrowListArray::<i32>::default_datatype(datatype.clone()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't that depend on selector.join_encoding
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope. The store_datatype
is always a list. join_encoding
influences the construction of .returned_datatype()
What
Resolves:
ComponentColumnDescriptor
cannot be used as a query input #7365ColumnSelector
to use in query APIs. #7435Checklist
main
build: rerun.io/viewernightly
build: rerun.io/viewerCHANGELOG.md
and the migration guideTo run all checks from
main
, comment on the PR with@rerun-bot full-check
.