Skip to content

Commit aa4eff5

Browse files
authored
Add try/raise around processing of arrow arrays (#53)
* Centos 7 has been EOL'ed as of July 1 2024. Use vault.centos.org instead of mirror.centos.org now * Add try/raise around processing of arrow arrays
1 parent eb4d1b9 commit aa4eff5

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

.github/scripts/install_prereqs.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ install_prereqs_for_macos() {
109109
}
110110

111111
install_prereqs_for_centos7() {
112+
# Centos 7 has been EOL'ed as of 07/01/2024. Use vault.centos.org instead of mirrorlist.centos.org
113+
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
114+
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
112115
yum install -y -q which wget git &&
113116
yum install -y -q autoconf automake libtool unzip &&
114117
yum install -y -q cmake3 patch &&

src/genomicsdb.pyx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -372,14 +372,17 @@ cdef class _GenomicsDB:
372372

373373
cdef void* arrow_array = NULL
374374
while True:
375-
arrow_array = processor.arrow_array()
376-
if arrow_array:
377-
array_capsule = pycapsule_get_arrow_array(arrow_array)
378-
array_obj = _ArrowArrayWrapper._import_from_c_capsule(schema_capsule, array_capsule)
379-
arrays = [pa.array(array_obj.child(i)) for i in range(array_obj.n_children)]
380-
yield pa.RecordBatch.from_arrays(arrays, schema=schema).serialize().to_pybytes()
381-
else:
382-
break
375+
try:
376+
arrow_array = processor.arrow_array()
377+
if arrow_array:
378+
array_capsule = pycapsule_get_arrow_array(arrow_array)
379+
array_obj = _ArrowArrayWrapper._import_from_c_capsule(schema_capsule, array_capsule)
380+
arrays = [pa.array(array_obj.child(i)) for i in range(array_obj.n_children)]
381+
yield pa.RecordBatch.from_arrays(arrays, schema=schema).serialize().to_pybytes()
382+
else:
383+
break
384+
except Exception as e:
385+
raise GenomicsDBException("Exception from processing of arrow arrays", e)
383386

384387
if batching:
385388
query_thread.join()

0 commit comments

Comments
 (0)