Skip to content

FIX: Propagate record conversion errors as PyErr in DBNDecoder#124

Open
wtn wants to merge 1 commit intodatabento:devfrom
wtn:python
Open

FIX: Propagate record conversion errors as PyErr in DBNDecoder#124
wtn wants to merge 1 commit intodatabento:devfrom
wtn:python

Conversation

@wtn
Copy link
Copy Markdown
Contributor

@wtn wtn commented Apr 17, 2026

DBNDecoder.decode() panicked on record conversion failure because the inner push_rec called .unwrap() on into_py_any(py).

This change extracts push_rec to module scope with return type PyResult<()> so errors propagate to the Python caller instead.

Motivation: The existing code was not breaking, but had a comment referencing a clippy bug. I found that the clippy behavior is OK, so I fixed up the code here.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How has this change been tested?

I ran tests locally and with a regression test (not necessary to keep permanently).

Checklist

  • My code builds locally with no new warnings (scripts/build.sh)
  • My code follows the style guidelines (scripts/lint.sh and scripts/format.sh)
  • New and existing unit tests pass locally with my changes (scripts/test.sh)
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works (not applicable)

Declaration

I confirm this contribution is made under an Apache 2.0 license and that I have the authority
necessary to make this contribution on behalf of its copyright owner.

@wtn wtn force-pushed the python branch 2 times, most recently from edc940b to 0b7b35e Compare April 17, 2026 18:55
@wtn wtn marked this pull request as ready for review April 17, 2026 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant