Skip to content

Commit

Permalink
Fix Python lint error (construct was not valid syntax on Python 3.8)
Browse files Browse the repository at this point in the history
  • Loading branch information
pitrou committed Oct 16, 2023
1 parent a83f199 commit 94505c6
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions dev/archery/archery/integration/tester_java.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,22 +188,22 @@ def import_batch_and_compare_to_json(self, json_path, num_batch,
if num_batch > 0:
actually_skipped = json_reader.skip(num_batch)
assert actually_skipped == num_batch
with (json_reader.read() as batch,
self.java_arrow.vector.VectorSchemaRoot.create(
schema, self.java_allocator) as imported_batch):
# We need to pass a dict provider primed with dictionary ids
# matching those in the schema, hence an empty
# CDataDictionaryProvider would not work here!
dict_provider = (self.java_arrow.vector.dictionary
.DictionaryProvider.MapDictionaryProvider())
dict_provider.copyStructureFrom(json_reader, self.java_allocator)
with dict_provider:
self.java_arrow.c.Data.importIntoVectorSchemaRoot(
self.java_allocator,
self._wrap_c_array_ptr(c_array_ptr),
imported_batch, dict_provider)
self._assert_batches_equal(batch, imported_batch)
self._assert_dict_providers_equal(json_reader, dict_provider)
with json_reader.read() as batch:
with self.java_arrow.vector.VectorSchemaRoot.create(
schema, self.java_allocator) as imported_batch:
# We need to pass a dict provider primed with dictionary ids
# matching those in the schema, hence an empty
# CDataDictionaryProvider would not work here.
dict_provider = (self.java_arrow.vector.dictionary
.DictionaryProvider.MapDictionaryProvider())
dict_provider.copyStructureFrom(json_reader, self.java_allocator)
with dict_provider:
self.java_arrow.c.Data.importIntoVectorSchemaRoot(
self.java_allocator,
self._wrap_c_array_ptr(c_array_ptr),
imported_batch, dict_provider)
self._assert_batches_equal(batch, imported_batch)
self._assert_dict_providers_equal(json_reader, dict_provider)

@property
def supports_releasing_memory(self):
Expand Down

0 comments on commit 94505c6

Please sign in to comment.