-
Notifications
You must be signed in to change notification settings - Fork 70
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
refactor!: make snapshot.schema()
return a SchemaRef
#751
refactor!: make snapshot.schema()
return a SchemaRef
#751
Conversation
snapshot.schema()
return a SchemaRef
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.
Awesome, thanks so much @maruschin! I left a few comments and would you mind updating the PR description to clearly state the breaking change? (snapshot.schema() -> SchemaRef
instead of -> &Schema
)
Ah also @maruschin looks like we need to fix ffi: You should be able to run a top-level I'm actually going to open a PR right quick to make sure that we default to building all crates instead of skipping FFI :) |
|
let schema = self.read_snapshot.schema(); | ||
let fields = schema | ||
.fields() |
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.
This change will break compilation because L159 was using the fields
we no longer define.
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 removed the redefinition of fields
. The fields
passed to Expression::struct_from
remain the same.
485849b
to
4c26b67
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.
LGTM thank you!!
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #751 +/- ##
==========================================
- Coverage 84.36% 84.35% -0.01%
==========================================
Files 81 81
Lines 19246 19242 -4
Branches 19246 19242 -4
==========================================
- Hits 16237 16232 -5
- Misses 2203 2206 +3
+ Partials 806 804 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
One comment to maybe consider, otherwise LGTM!
kernel/src/schema/mod.rs
Outdated
pub(crate) fn has_invariants(schema: SchemaRef) -> bool { | ||
let mut checker = InvariantChecker::default(); | ||
let _ = checker.transform_struct(schema); | ||
let _ = checker.transform_struct(schema.as_ref()); | ||
checker.has_invariants |
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.
Since we are already borrowing at the callsite, would it make sense to just keep &Schema
as argument type 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.
Yeah +1, callers can just do as_ref()
if they have a SchemaRef
.
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.
Returned back
730358c
to
3bd8902
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.
looks good!
What changes are proposed in this pull request?
Refactor snapshot.schema() to return a SchemaRef
resolves #710
This PR affects the following public APIs
Breaking: changes
snapshot.schema()
API to return aSchemaRef
(Arc<Schema>
) instead of an&Schema
How was this change tested?
existing