Skip to content

Commit

Permalink
apacheGH-43680: [Integration] Unskip nanoarrow in IPC integration tes…
Browse files Browse the repository at this point in the history
…ts (apache#43715)

### Rationale for this change

Nanoarrow can now read and write IPC files as of apache/arrow-nanoarrow#585 so it should no longer be skipped as a producer/consumer

### What changes are included in this PR?

Nanoarrow's tester is updated to point to the new integration executable and to report nanoarrow as a consumer/producer of IPC files.

Notably the `null_trivial` case is skipped even though nanoarrow nominally supports it since it represents a corner case in which nanoarrow's flatbuffers library will not accept some vectors produced by other flatbuffers libraries dvidelabs/flatcc#287

### Are these changes tested?

Yes

### Are there any user-facing changes?

No

* GitHub Issue: apache#43680

Lead-authored-by: Benjamin Kietzman <[email protected]>
Co-authored-by: Antoine Pitrou <[email protected]>
Signed-off-by: Benjamin Kietzman <[email protected]>
  • Loading branch information
bkietz and pitrou authored Sep 24, 2024
1 parent 83f35de commit 242f98c
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ci/scripts/nanoarrow_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ set -x
mkdir -p ${build_dir}
pushd ${build_dir}

cmake ${source_dir} -DNANOARROW_BUILD_INTEGRATION_TESTS=ON
cmake ${source_dir} -DNANOARROW_IPC=ON -DNANOARROW_BUILD_INTEGRATION_TESTS=ON
cmake --build .

popd
11 changes: 10 additions & 1 deletion dev/archery/archery/integration/datagen.py
Original file line number Diff line number Diff line change
Expand Up @@ -1914,33 +1914,42 @@ def _temp_path():
generate_duplicate_fieldnames_case()
.skip_tester('JS'),

generate_dictionary_case(),
generate_dictionary_case()
# TODO(https://github.com/apache/arrow-nanoarrow/issues/622)
.skip_tester('nanoarrow'),

generate_dictionary_unsigned_case()
.skip_tester('nanoarrow')
.skip_tester('Java'), # TODO(ARROW-9377)

generate_nested_dictionary_case()
# TODO(https://github.com/apache/arrow-nanoarrow/issues/622)
.skip_tester('nanoarrow')
.skip_tester('Java'), # TODO(ARROW-7779)

generate_run_end_encoded_case()
.skip_tester('C#')
.skip_tester('Java')
.skip_tester('JS')
# TODO(https://github.com/apache/arrow-nanoarrow/issues/618)
.skip_tester('nanoarrow')
.skip_tester('Rust'),

generate_binary_view_case()
.skip_tester('JS')
# TODO(https://github.com/apache/arrow-nanoarrow/issues/618)
.skip_tester('nanoarrow')
.skip_tester('Rust'),

generate_list_view_case()
.skip_tester('C#') # Doesn't support large list views
.skip_tester('JS')
# TODO(https://github.com/apache/arrow-nanoarrow/issues/618)
.skip_tester('nanoarrow')
.skip_tester('Rust'),

generate_extension_case()
.skip_tester('nanoarrow')
# TODO: ensure the extension is registered in the C++ entrypoint
.skip_format(SKIP_C_SCHEMA, 'C++')
.skip_format(SKIP_C_ARRAY, 'C++'),
Expand Down
39 changes: 33 additions & 6 deletions dev/archery/archery/integration/tester_nanoarrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

from . import cdata
from .tester import Tester, CDataExporter, CDataImporter
from .util import run_cmd, log
from ..utils.source import ARROW_ROOT_DEFAULT


Expand All @@ -32,10 +33,14 @@
_NANOARROW_PATH, "libnanoarrow_c_data_integration" + cdata.dll_suffix
)

_INTEGRATION_EXE = os.path.join(
_NANOARROW_PATH, "nanoarrow_ipc_integration"
)


class NanoarrowTester(Tester):
PRODUCER = False
CONSUMER = False
PRODUCER = True
CONSUMER = True
FLIGHT_SERVER = False
FLIGHT_CLIENT = False
C_DATA_SCHEMA_EXPORTER = True
Expand All @@ -45,17 +50,39 @@ class NanoarrowTester(Tester):

name = "nanoarrow"

def _run(self, arrow_path, json_path, command, quirks):
env = {
'ARROW_PATH': arrow_path,
'JSON_PATH': json_path,
'COMMAND': command,
**{
f'QUIRK_{q}': "1"
for q in quirks or ()
},
}

if self.debug:
log(f'{_INTEGRATION_EXE} {env}')

run_cmd([_INTEGRATION_EXE], env=env)

def validate(self, json_path, arrow_path, quirks=None):
raise NotImplementedError()
return self._run(arrow_path, json_path, 'VALIDATE', quirks)

def json_to_file(self, json_path, arrow_path):
raise NotImplementedError()
return self._run(arrow_path, json_path, 'JSON_TO_ARROW', quirks=None)

def stream_to_file(self, stream_path, file_path):
raise NotImplementedError()
self.run_shell_command([_INTEGRATION_EXE, '<', stream_path], env={
'COMMAND': 'STREAM_TO_FILE',
'ARROW_PATH': file_path,
})

def file_to_stream(self, file_path, stream_path):
raise NotImplementedError()
self.run_shell_command([_INTEGRATION_EXE, '>', stream_path], env={
'COMMAND': 'FILE_TO_STREAM',
'ARROW_PATH': file_path,
})

def make_c_data_exporter(self):
return NanoarrowCDataExporter(self.debug, self.args)
Expand Down

0 comments on commit 242f98c

Please sign in to comment.