Skip to content

Commit 59333e5

Browse files
feat: undepracate ArrayData.array_elements() (#1493)
<!-- Thanks for sending a pull request! Here are some tips for you: 1. If this is your first time, please read our contributor guidelines: https://github.com/delta-incubator/delta-kernel-rs/blob/main/CONTRIBUTING.md 2. Run `cargo t --all-features --all-targets` to get started testing, and run `cargo fmt`. 3. Ensure you have added or run the appropriate tests for your PR. 4. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP] Your PR title ...'. 5. Be sure to keep the PR description updated to reflect all changes. --> <!-- PR title formatting: This project uses conventional commits: https://www.conventionalcommits.org/ Each PR corresponds to a commit on the `main` branch, with the title of the PR (typically) being used for the commit message on main. In order to ensure proper formatting in the CHANGELOG please ensure your PR title adheres to the conventional commit specification. Examples: - new feature PR: "feat: new API for snapshot.update()" - bugfix PR: "fix: correctly apply DV in read-table example" --> ## What changes are proposed in this pull request? Fixes #1197 <!-- Please clarify what changes you are proposing and why the changes are needed. The purpose of this section is to outline the changes, why they are needed, and how this PR fixes the issue. If the reason for the change is already explained clearly in an issue, then it does not need to be restated here. 1. If you propose a new API or feature, clarify the use case for a new API or feature. 2. If you fix a bug, you can clarify why it is a bug. --> <!-- Uncomment this section if there are any changes affecting public APIs: ### This PR affects the following public APIs If there are breaking changes, please ensure the `breaking-changes` label gets added by CI, and describe why the changes are needed. Note that _new_ public APIs are not considered breaking. --> ## How was this change tested? <!-- Please make sure to add test cases that check the changes thoroughly including negative and positive cases if possible. If it was tested in a way different from regular unit tests, please clarify how you tested, ideally via a reproducible test documented in the PR description. --> Co-authored-by: aleksandarskrbic <[email protected]> Co-authored-by: Zach Schuermann <[email protected]>
1 parent 38068c4 commit 59333e5

File tree

4 files changed

+0
-10
lines changed

4 files changed

+0
-10
lines changed

ffi/src/expressions/engine_visitor.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,6 @@ fn visit_expression_array(
317317
array: &ArrayData,
318318
sibling_list_id: usize,
319319
) {
320-
#[allow(deprecated)]
321320
let elements = array.array_elements();
322321
let child_list_id = call!(visitor, make_field_list, elements.len());
323322
for scalar in elements {

kernel/src/engine/arrow_expression/evaluate_expression.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,6 @@ pub fn evaluate_predicate(
380380
}
381381
}
382382
(Expression::Literal(lit), Expression::Literal(Scalar::Array(ad))) => {
383-
#[allow(deprecated)]
384383
let exists = ad.array_elements().contains(lit);
385384
Ok(BooleanArray::from(vec![exists]))
386385
}

kernel/src/engine/arrow_expression/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ impl Scalar {
113113
Array(data) => {
114114
let builder = builder_as!(array::ListBuilder<Box<dyn ArrayBuilder>>);
115115
for _ in 0..num_rows {
116-
#[allow(deprecated)]
117116
for value in data.array_elements() {
118117
value.append_to(builder.values(), 1)?;
119118
}
@@ -218,7 +217,6 @@ impl ArrayData {
218217
pub fn to_arrow(&self) -> DeltaResult<ArrayRef> {
219218
let arrow_data_type = ArrowDataType::try_from_kernel(self.array_type().element_type())?;
220219

221-
#[allow(deprecated)]
222220
let elements = self.array_elements();
223221
let mut builder = array::make_builder(&arrow_data_type, elements.len());
224222
for element in elements {

kernel/src/expressions/scalars.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,6 @@ impl ArrayData {
9494
&self.tpe
9595
}
9696

97-
#[deprecated(
98-
note = "These fields will be removed eventually and are unstable. See https://github.com/delta-io/delta-kernel-rs/issues/291"
99-
)]
10097
pub fn array_elements(&self) -> &[Scalar] {
10198
&self.elements
10299
}
@@ -923,7 +920,6 @@ mod tests {
923920

924921
#[test]
925922
fn test_arrays() {
926-
#[allow(deprecated)]
927923
let array = Scalar::Array(ArrayData {
928924
tpe: ArrayType::new(DataType::INTEGER, false),
929925
elements: vec![Scalar::Integer(1), Scalar::Integer(2), Scalar::Integer(3)],
@@ -1173,7 +1169,6 @@ mod tests {
11731169
let Scalar::Array(array_data) = scalar else {
11741170
panic!("Expected Array scalar");
11751171
};
1176-
#[allow(deprecated)]
11771172
let elements = array_data.array_elements();
11781173
assert_eq!(elements.len(), 3);
11791174
assert!(!array_data.array_type().contains_null());
@@ -1206,7 +1201,6 @@ mod tests {
12061201
panic!("Expected Array scalar");
12071202
};
12081203

1209-
#[allow(deprecated)]
12101204
let elements = array_data.array_elements();
12111205
assert_eq!(elements.len(), 3);
12121206
assert!(array_data.array_type().contains_null());

0 commit comments

Comments
 (0)