Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/comment_bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.12
- name: Install Archery and Crossbow dependencies
run: pip install -e dev/archery[bot]
- name: Handle Github comment event
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: 3.12
- name: Audit licenses
run: ./dev/release/run-rat.sh .

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.12
- name: Setup Archery
run: pip install -e dev/archery[docker]
- name: Execute Docker Build
Expand All @@ -64,12 +64,12 @@ jobs:
rustup default ${{ matrix.rust }}
rustup component add rustfmt clippy
- name: Cache Cargo
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: /home/runner/.cargo
key: cargo-maturin-cache-
- name: Cache Rust dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: /home/runner/target
# this key is not equal because maturin uses different compilation flags.
Expand Down
39 changes: 20 additions & 19 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Cache Cargo
uses: actions/cache@v2
uses: actions/cache@v4
with:
# these represent dependencies downloaded by cargo
# and thus do not depend on the OS, arch nor rust version.
path: /github/home/.cargo
key: cargo-cache3-
- name: Cache Rust dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
# these represent compiled steps of both dependencies and arrow
# and thus are specific for a particular OS, arch and rust version.
Expand Down Expand Up @@ -86,13 +86,13 @@ jobs:
with:
submodules: true
- name: Cache Cargo
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: /github/home/.cargo
# this key equals the ones on `linux-build-lib` for re-use
key: cargo-cache3-
- name: Cache Rust dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: /github/home/target
# this key equals the ones on `linux-build-lib` for re-use
Expand Down Expand Up @@ -154,12 +154,12 @@ jobs:
with:
submodules: true
- name: Cache Cargo
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: /github/home/.cargo
key: cargo-nightly-cache3-
- name: Cache Rust dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: /github/home/target
key: ${{ runner.os }}-${{ matrix.arch }}-target-nightly-cache3-${{ matrix.rust }}
Expand Down Expand Up @@ -205,6 +205,7 @@ jobs:
export PARQUET_TEST_DATA=$(pwd)/parquet-testing/data
# do not produce debug symbols to keep memory usage down
export RUSTFLAGS="-C debuginfo=0"
export CMAKE_POLICY_VERSION_MINIMUM=3.5
cargo test

clippy:
Expand All @@ -226,13 +227,13 @@ jobs:
with:
submodules: true
- name: Cache Cargo
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: /github/home/.cargo
# this key equals the ones on `linux-build-lib` for re-use
key: cargo-cache3-
- name: Cache Rust dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: /github/home/target
# this key equals the ones on `linux-build-lib` for re-use
Expand Down Expand Up @@ -268,13 +269,13 @@ jobs:
with:
submodules: true
- name: Cache Cargo
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: /github/home/.cargo
# this key equals the ones on `linux-build-lib` for re-use
key: cargo-cache3-
- name: Cache Rust dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: /github/home/target
# this key equals the ones on `linux-build-lib` for re-use
Expand Down Expand Up @@ -321,13 +322,13 @@ jobs:
rustup default ${{ matrix.rust }}
rustup component add rustfmt clippy
- name: Cache Cargo
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: /home/runner/.cargo
# this key is not equal because the user is different than on a container (runner vs github)
key: cargo-coverage-cache3-
- name: Cache Rust dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: /home/runner/target
# this key is not equal because coverage uses different compilation flags.
Expand Down Expand Up @@ -369,12 +370,12 @@ jobs:
with:
submodules: true
- name: Cache Cargo
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: /github/home/.cargo
key: cargo-wasm32-cache3-
- name: Cache Rust dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: /github/home/target
key: ${{ runner.os }}-${{ matrix.arch }}-target-wasm32-cache3-${{ matrix.rust }}
Expand Down Expand Up @@ -414,14 +415,14 @@ jobs:
- name: Install python dev
run: |
apt update
apt install -y libpython3.11-dev
apt install -y libpython3.12-dev
- name: Cache Cargo
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: /github/home/.cargo
key: cargo-nightly-cache3-
- name: Cache Rust dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: /github/home/target
key: ${{ runner.os }}-${{ matrix.arch }}-target-nightly-cache3-${{ matrix.rust }}
Expand Down Expand Up @@ -453,13 +454,13 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Cache Cargo
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: /github/home/.cargo
# this key equals the ones on `linux-build-lib` for re-use
key: cargo-cache3-
- name: Cache Rust dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: /github/home/target
# this key equals the ones on `linux-build-lib` for re-use
Expand Down
30 changes: 21 additions & 9 deletions arrow/src/compute/kernels/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3043,7 +3043,8 @@ mod tests {
fn test_cast_utf8_to_i32() {
let a = StringArray::from(vec!["5", "6", "seven", "8", "9.1"]);
let array = Arc::new(a) as ArrayRef;
let b = cast(&array, &DataType::Int32).unwrap();
let b =
cast_with_options(&array, &DataType::Int32, &DEFAULT_CAST_OPTIONS).unwrap();
let c = b.as_any().downcast_ref::<Int32Array>().unwrap();
assert_eq!(5, c.value(0));
assert_eq!(6, c.value(1));
Expand Down Expand Up @@ -3073,7 +3074,9 @@ mod tests {
let strings = Arc::new(StringArray::from(vec![
"true", "false", "invalid", " Y ", "",
])) as ArrayRef;
let casted = cast(&strings, &DataType::Boolean).unwrap();
let casted =
cast_with_options(&strings, &DataType::Boolean, &DEFAULT_CAST_OPTIONS)
.unwrap();
let expected =
BooleanArray::from(vec![Some(true), Some(false), None, Some(true), None]);
assert_eq!(*as_boolean_array(&casted), expected);
Expand Down Expand Up @@ -3257,8 +3260,12 @@ mod tests {
None,
])) as ArrayRef;
for array in &[a1, a2] {
let b =
cast(array, &DataType::Timestamp(TimeUnit::Nanosecond, None)).unwrap();
let b = cast_with_options(
array,
&DataType::Timestamp(TimeUnit::Nanosecond, None),
&DEFAULT_CAST_OPTIONS,
)
.unwrap();
let c = b
.as_any()
.downcast_ref::<TimestampNanosecondArray>()
Expand All @@ -3284,7 +3291,8 @@ mod tests {
None,
])) as ArrayRef;
for array in &[a1, a2] {
let b = cast(array, &DataType::Date32).unwrap();
let b = cast_with_options(array, &DataType::Date32, &DEFAULT_CAST_OPTIONS)
.unwrap();
let c = b.as_any().downcast_ref::<Date32Array>().unwrap();
assert_eq!(17890, c.value(0));
assert_eq!(17891, c.value(1));
Expand All @@ -3306,7 +3314,8 @@ mod tests {
None,
])) as ArrayRef;
for array in &[a1, a2] {
let b = cast(array, &DataType::Date64).unwrap();
let b = cast_with_options(array, &DataType::Date64, &DEFAULT_CAST_OPTIONS)
.unwrap();
let c = b.as_any().downcast_ref::<Date64Array>().unwrap();
assert_eq!(1599566400000, c.value(0));
assert!(c.is_null(1));
Expand Down Expand Up @@ -5026,7 +5035,8 @@ mod tests {
"2000", // just a year is invalid
]);
let array = Arc::new(a) as ArrayRef;
let b = cast(&array, &DataType::Date32).unwrap();
let b =
cast_with_options(&array, &DataType::Date32, &DEFAULT_CAST_OPTIONS).unwrap();
let c = b.as_any().downcast_ref::<Date32Array>().unwrap();

// test valid inputs
Expand Down Expand Up @@ -5067,7 +5077,8 @@ mod tests {
"2000-01-01", // just a date is invalid
]);
let array = Arc::new(a) as ArrayRef;
let b = cast(&array, &DataType::Date64).unwrap();
let b =
cast_with_options(&array, &DataType::Date64, &DEFAULT_CAST_OPTIONS).unwrap();
let c = b.as_any().downcast_ref::<Date64Array>().unwrap();

// test valid inputs
Expand Down Expand Up @@ -5097,7 +5108,8 @@ mod tests {
for array in get_arrays_of_all_types() {
for to_type in &all_types {
println!("Test casting {:?} --> {:?}", array.data_type(), to_type);
let cast_result = cast(&array, to_type);
let cast_result =
cast_with_options(&array, to_type, &DEFAULT_CAST_OPTIONS);
let reported_cast_ability = can_cast_types(array.data_type(), to_type);

// check for mismatch
Expand Down
Loading
Loading