Skip to content

[python] Fix nightly-build failure / pybind11 exception-mapping#2963

Merged
johnkerl merged 3 commits intomainfrom
kerl/nightly-fix
Sep 6, 2024
Merged

[python] Fix nightly-build failure / pybind11 exception-mapping#2963
johnkerl merged 3 commits intomainfrom
kerl/nightly-fix

Conversation

@johnkerl
Copy link
Copy Markdown
Contributor

@johnkerl johnkerl commented Sep 6, 2024

Issue and/or context: Resolves #2961

Changes:

Do explicit try-catch. See also #783.

Notes for Reviewer:

It's not necessarily causal that this triggered on https://github.com/jdblischak/centralized-tiledb-nightlies/issues/21. It's true that the apis/python/tests/test_shape.py was recently introduced on the #2407 stack. However, whether un-rethrown errors (on implicit pybind body, as in the "before" parts of this PR) reach the Python level as tiledbsoma.SOMAError or RuntimeError or tiledb.cc.TileDBError has some element of randomness.

There's an attempt to globally register a rethrow:
https://github.com/single-cell-data/TileDB-SOMA/blob/1.13.1/apis/python/src/tiledbsoma/pytiledbsoma.cc#L36-L50

However, @nguyenv and I have long found that some things come through as RuntimeError on one machine, and tiledb.cc.TileDBError in another. We suspect that TileDB-Py's exception registrar has a race condition with our own.

Regardless, a safe practice is explicit catch-and-rethrow at the boundary between C++ and Python, which is what we do more of here.

@johnkerl johnkerl requested a review from nguyenv September 6, 2024 17:22
@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.99%. Comparing base (796c168) to head (f29a82c).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2963      +/-   ##
==========================================
+ Coverage   89.89%   89.99%   +0.09%     
==========================================
  Files          39       39              
  Lines        4049     4057       +8     
==========================================
+ Hits         3640     3651      +11     
+ Misses        409      406       -3     
Flag Coverage Δ
python 89.99% <ø> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
python_api 89.99% <ø> (+0.09%) ⬆️
libtiledbsoma ∅ <ø> (∅)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Test failures from test_shape.py with libtiledb 2.26

2 participants