Skip to content

feat(bendpy): improve local embedded python api#19699

Merged
sundy-li merged 7 commits intodatabendlabs:mainfrom
sundy-li:feat/bendpy-local-embedded-api
Apr 11, 2026
Merged

feat(bendpy): improve local embedded python api#19699
sundy-li merged 7 commits intodatabendlabs:mainfrom
sundy-li:feat/bendpy-local-embedded-api

Conversation

@sundy-li
Copy link
Copy Markdown
Member

@sundy-li sundy-li commented Apr 11, 2026

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

  • improve bendpy local embedded runtime stability by switching embedded listeners to ephemeral ports
  • add a Python-side local API facade with connect(), relation helpers, and dataframe registration helpers
  • add regression coverage for the DuckDB-style local API behavior

Implementation

  1. Configure embedded MySQL/HTTP/Flight/Admin/Metric listeners to bind 127.0.0.1 with port 0
  2. Export the Rust classes needed by the Python facade from the PyO3 module
  3. Add a Python wrapper layer in src/bendpy/python/databend/__init__.py for connect, SessionContext, Relation, register, and from_df
  4. Enable maturin python-source packaging so the Python facade ships in the wheel
  5. Add tests covering query execution, fetch helpers, and dataframe/Arrow registration

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test - Pair with the reviewer to explain why

Validation used locally:

  • built bendpy wheel with Python 3.12
  • exercised real local embedded queries through the built wheel
  • verified bendsql Python local integration against the rebuilt wheel

Type of change

  • New feature (non-breaking change which adds functionality)

This change is Reviewable

@github-actions github-actions bot added the pr-feature this PR introduces a new feature to the codebase label Apr 11, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1f35992f06

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 11, 2026

🤖 CI Job Analysis

Workflow: 24282318350

📊 Summary

  • Total Jobs: 87
  • Failed Jobs: 1
  • Retryable: 0
  • Code Issues: 1

NO RETRY NEEDED

All failures appear to be code/test issues requiring manual fixes.

🔍 Job Details

  • linux / sqllogic / standalone_iceberg_tpch: Not retryable (Code/Test)

🤖 About

Automated analysis using job annotations to distinguish infrastructure issues (auto-retried) from code/test issues (manual fixes needed).

@sundy-li sundy-li merged commit de74bc1 into databendlabs:main Apr 11, 2026
89 of 91 checks passed
@sundy-li sundy-li deleted the feat/bendpy-local-embedded-api branch April 11, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-feature this PR introduces a new feature to the codebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant