oceanbase / oceanbase/pyobvector

Python 3.14 emits SyntaxWarning for return in finally block

Open Beginner friendly
#72 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
19
Forks
12
PR merge metrics
No merged PRs in 30d

Description

Summary

Importing pyobvector on Python 3.14 emits a SyntaxWarning because ob_vec_json_table_client.py returns from a finally block.

Reproduction

Environment:

  • Python 3.14.x
  • pyobvector 0.2.28

Running a CLI that imports the package (for example, a PowerContext server/configuration command) produces:

.../site-packages/pyobvector/client/ob_vec_json_table_client.py:799: SyntaxWarning: 'return' in a 'finally' block
  return n_new_records

Impact

This is non-fatal on the normal path, but Python warns that a return in finally can suppress an exception raised by the try block. It also makes every importing CLI appear to have failed or misconfigured on Python 3.14.

Suggested fix

Move the return after the try/finally cleanup (or otherwise avoid returning from finally) so exceptions are not masked. Please consider adding Python 3.14 to the compatibility test matrix.

Thank you!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in pyobvector/client/ob_vec_json_table_client.py around line 799 and inspect the try/finally cleanup that returns n_new_records. Run the importing CLI or an equivalent Python 3.14 import to reproduce the warning. Done means cleanup still runs, exceptions are not masked, and the import no longer emits this SyntaxWarning; check the compatibility tests if present.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
82/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.