diff --git a/.github/workflows/integration-ffi.yml b/.github/workflows/integration-ffi.yml index 3fce8f24fd8..7f7b4ce3d35 100644 --- a/.github/workflows/integration-ffi.yml +++ b/.github/workflows/integration-ffi.yml @@ -25,7 +25,7 @@ jobs: key: ${{ runner.os }}-amd64-target-maturin-cache - uses: actions/setup-python@v2 with: - python-version: '3.7' + python-version: "3.7" - name: Install Python dependencies run: python -m pip install --upgrade pip setuptools wheel - name: Run tests @@ -38,6 +38,6 @@ jobs: python -m venv venv source venv/bin/activate - pip install maturin==0.10.2 toml==0.10.1 pyarrow==5.0.0 + pip install maturin==0.10.2 toml==0.10.1 pyarrow==6.0.0 maturin develop python -m unittest discover tests diff --git a/arrow-pyarrow-integration-testing/tests/test_sql.py b/arrow-pyarrow-integration-testing/tests/test_sql.py index 5dc6a3e2a5a..3cd9c2e069b 100644 --- a/arrow-pyarrow-integration-testing/tests/test_sql.py +++ b/arrow-pyarrow-integration-testing/tests/test_sql.py @@ -39,8 +39,7 @@ def tearDown(self): # No leak of C++ memory self.assertEqual(self.old_allocated_cpp, pyarrow.total_allocated_bytes()) - # see https://issues.apache.org/jira/browse/ARROW-14680 - def _test_null(self): + def test_null(self): """ Python -> Rust -> Python """ diff --git a/src/array/union/ffi.rs b/src/array/union/ffi.rs index 655ed43eabb..5702e4f9d6c 100644 --- a/src/array/union/ffi.rs +++ b/src/array/union/ffi.rs @@ -9,12 +9,11 @@ unsafe impl ToFfi for UnionArray { fn buffers(&self) -> Vec>> { if let Some(offsets) = &self.offsets { vec![ - None, Some(self.types.as_ptr().cast::()), Some(offsets.as_ptr().cast::()), ] } else { - vec![None, Some(self.types.as_ptr().cast::())] + vec![Some(self.types.as_ptr().cast::())] } } @@ -37,11 +36,11 @@ impl FromFfi for UnionArray { let data_type = field.data_type().clone(); let fields = Self::get_fields(field.data_type()); - let mut types = unsafe { array.buffer::(1) }?; + let mut types = unsafe { array.buffer::(0) }?; let offsets = if Self::is_sparse(&data_type) { None } else { - Some(unsafe { array.buffer::(2) }?) + Some(unsafe { array.buffer::(1) }?) }; let length = array.array().len();