-
Notifications
You must be signed in to change notification settings - Fork 785
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
Seal ArrowPrimitiveType #3882
Seal ArrowPrimitiveType #3882
Conversation
@@ -230,27 +230,7 @@ pub type Decimal128Array = PrimitiveArray<Decimal128Type>; | |||
/// scale less or equal to 76. | |||
pub type Decimal256Array = PrimitiveArray<Decimal256Type>; | |||
|
|||
/// Trait bridging the dynamic-typed nature of Arrow (via [`DataType`]) with the | |||
/// static-typed nature of rust types ([`ArrowNativeType`]) for all types that implement [`ArrowNativeType`]. | |||
pub trait ArrowPrimitiveType: 'static { |
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 moved this into types along with all the other traits of this sort
mod run { | ||
use super::*; | ||
|
||
pub trait RunEndTypeSealed {} |
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 is no longer necessary, as PrimitiveType is sealed
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 -- @jhorstmann and @viirya may be interested
Fully agree with making this sealed 👍 |
arrow-array/src/types.rs
Outdated
|
||
impl RunEndTypeSealed for Int64Type {} | ||
} | ||
|
||
/// A subtype of primitive type that is used as run-ends index | ||
/// in `RunArray`. | ||
/// See <https://arrow.apache.org/docs/format/Columnar.html> | ||
/// | ||
/// Note: The implementation of this trait is sealed to avoid accidental misuse. |
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.
Now a redundant comment line:
/// Note: The implementation of this trait is sealed to avoid accidental misuse. |
Making sense. 👍 |
* Seal ArrowPrimitiveType * Fix doc * Review feedback
Which issue does this PR close?
Closes #.
Rationale for this change
As ArrowNativeType is sealed, it is hard to see how or why anyone would implement this for a custom type, but sealing it makes this contract very clear.
What changes are included in this PR?
Are there any user-facing changes?
Technically this is a breaking change, practically I sincerely doubt anyone will notice