Commit 76ecef3
fix(python-binding): complete Python binding CI configuration (#18686)
* fix: enable Python binding CI for manual testing
- Add inputs to workflow_dispatch for manual CI testing
- Fix condition logic: change inputs.tag to inputs.version
- Allow optional version parameter with default test-build value
- This enables actual Python binding compilation in CI
* fix: handle non-semver version strings in CI
- Allow test-build and other non-semver version strings
- Use fallback if regex extraction fails
- This fixes CI failure when using default test-build version
* fix: remove rust-std from maturin rustup-components
The rust-std component was causing maturin-action to attempt installing
cargo-zigbuild which failed due to missing musl stdlib. Removing rust-std
allows maturin to handle target installation automatically.
* fix: add explicit rustup target installation in maturin action
Ensures the correct target (x86_64-unknown-linux-gnu) is installed
before maturin attempts compilation, preventing musl stdlib errors.
Also adds platform specification to avoid architecture mismatch.
* fix: install cargo-zigbuild manually with correct target
Manually install cargo-zigbuild with the GNU target instead of
letting maturin auto-install with musl target. This prevents
the "can't find crate for std/core" errors when musl stdlib
is unavailable in the Docker container.
* fix: use valid semver for test builds in Python packaging
When version input is not a valid semver (like "test-build-v4"),
fallback to "0.1.0" instead of using the invalid string directly.
This fixes TOML parse errors in pyproject.toml that require
version to start with a number.
* feat: improve Python binding documentation and fix version strategy
- Fix version conflict by using git tag-based versioning with dev suffix for tests
- Enhance README.md with accurate examples from actual code (context.rs, basic.py)
- Add comprehensive API reference table
- Improve pyproject.toml metadata with proper description and classifiers
- All examples verified against actual binding implementation
Examples include:
1. Register external files (parquet/csv/ndjson) and query
2. Create table, insert data, and convert to pandas/polars
* update descriptions based on official Databend positioning
* Add storage connection management APIs to Python binding
- Add create_*_connection methods for S3, Azure Blob, GCS, OSS, COS
- Add list_connections, describe_connection, drop_connection methods
- Use CREATE OR REPLACE CONNECTION for easier overwrites
- Support optional parameters for S3 endpoint_url and region
- Include comprehensive test coverage for all connection APIs
* Fix auto-initialization and testing issues
- Handle mutex poisoning in service initialization with proper recovery
- Implement dynamic port allocation to avoid conflicts in tests
- Fix test parameter matching for mock assertions
- Add comprehensive mock-based testing without full service startup
- Ensure all 10 connection API tests pass successfully
This enables seamless auto-initialization when creating SessionContext
without requiring manual databend.init_service() calls.
* fix: resolve Python binding compilation and permission issues
- Fix unused imports and compilation errors in bendpy
- Resolve root user permission denied issues by properly configuring account_admin role
- Fix warehouse assignment logic for embedded mode using manual cluster creation
- Bypass meta service connection errors in single-node embedded configuration
- All Python binding tests now pass successfully
* refactor: add unified embedded mode detection and optimize Python binding architecture
- Add GlobalConfig::is_embedded_mode() method for unified embedded mode detection
- Apply embedded mode checks to cluster discovery and session management
- Simplify Python binding with comprehensive user permissions instead of manual cluster creation
- Set virtual warehouse/cluster IDs for embedded mode to bypass warehouse validation
- Rename basic.py to test_basic.py for pytest discovery
- Remove unused dependencies from bendpy Cargo.toml
- Clean up interpreter factory by removing unnecessary embedded mode checks
* feat: enable automatic initialization in Python binding
- Remove requirement for manual databend.init_embedded() call
- SessionContext now auto-initializes embedded mode on first use
- Add data_path parameter to SessionContext constructor
- Update documentation and examples to reflect simplified API
* ci: add pytest testing to Python binding release pipeline
- Add test job that runs on PRs and workflow dispatches
- Integrate pytest execution into build_bindings_python action
- Test both development builds and release wheels
- Ensure all Python binding functionality is validated before release
* ci: fix Rust toolchain setup for Python binding tests
- Add proper Rust installation for development builds
- Separate test steps for development vs release builds
- Ensure Rust toolchain is available before maturin develop
* ci: improve version handling in Python binding following pack_deb pattern
- Use standard bash parameter expansion to remove v prefix
- Convert Databend version formats to PEP 440 compatible Python versions
- Handle nightly (-nightly -> .dev0) and patch (-p1 -> .post1) releases
- Add clear logging of version transformation
* fix: resolve Python binding CI failures in PR #18686
- Add condition to linux job to only run when version is provided
- Replace manual Rust installation with dtolnay/rust-toolchain action
- Eliminate duplicate job execution between test and linux jobs
- Ensure proper separation between PR testing and release builds
* fix: resolve maturin virtualenv requirement in CI
- Create proper virtual environment for maturin develop command
- Install required dependencies (maturin, pytest, pandas, polars, pyarrow) in venv
- Activate virtual environment before running maturin develop
- Fix 'Couldn't find a virtualenv or conda environment' error
* fix: remove trailing spaces in YAML file to pass lint check
- Remove trailing whitespace from build_bindings_python action.yml
- Fix yamllint errors that caused linux/check CI failure
- Resolve 'trailing spaces' error on lines 99, 103, 104, 106, 110, 113, 117, 126, 132, 136
* revert: remove unrelated grpc_server changes from Python binding CI fix
* fix: next_port() should not assign duplicated port
---------
Co-authored-by: Zhang Yanpo <drdr.xp@gmail.com>1 parent 3d49cd5 commit 76ecef3
File tree
17 files changed
+741
-363
lines changed- .github
- actions/build_bindings_python
- workflows
- src
- bendpy
- src
- tests
- meta/store/src
- query
- config/src
- service/src
- clusters
- interpreters
- sessions
17 files changed
+741
-363
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
20 | 24 | | |
21 | 25 | | |
22 | 26 | | |
| |||
57 | 61 | | |
58 | 62 | | |
59 | 63 | | |
60 | | - | |
| 64 | + | |
61 | 65 | | |
62 | 66 | | |
63 | 67 | | |
64 | 68 | | |
65 | 69 | | |
66 | 70 | | |
67 | 71 | | |
68 | | - | |
| 72 | + | |
69 | 73 | | |
70 | | - | |
| 74 | + | |
| 75 | + | |
71 | 76 | | |
72 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
73 | 82 | | |
74 | 83 | | |
75 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
6 | 12 | | |
7 | 13 | | |
8 | 14 | | |
| |||
27 | 33 | | |
28 | 34 | | |
29 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
30 | 54 | | |
| 55 | + | |
| 56 | + | |
31 | 57 | | |
32 | 58 | | |
33 | 59 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | | - | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
34 | | - | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
11 | | - | |
| 13 | + | |
12 | 14 | | |
13 | | - | |
14 | 15 | | |
15 | 16 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | 17 | | |
23 | | - | |
| 18 | + | |
| 19 | + | |
24 | 20 | | |
| 21 | + | |
| 22 | + | |
25 | 23 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | 24 | | |
30 | | - | |
31 | | - | |
32 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
33 | 28 | | |
34 | 29 | | |
35 | | - | |
| 30 | + | |
36 | 31 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 32 | + | |
42 | 33 | | |
43 | 34 | | |
| 35 | + | |
44 | 36 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
| 37 | + | |
50 | 38 | | |
51 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
52 | 43 | | |
53 | | - | |
54 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
55 | 47 | | |
56 | 48 | | |
57 | | - | |
| 49 | + | |
58 | 50 | | |
59 | | - | |
| 51 | + | |
| 52 | + | |
60 | 53 | | |
61 | | - | |
62 | | - | |
63 | | - | |
| 54 | + | |
64 | 55 | | |
65 | | - | |
| 56 | + | |
| 57 | + | |
66 | 58 | | |
67 | | - | |
68 | | - | |
69 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
70 | 62 | | |
71 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
72 | 66 | | |
73 | | - | |
74 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
75 | 70 | | |
76 | 71 | | |
77 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
78 | 88 | | |
79 | | - | |
80 | | - | |
81 | | - | |
| 89 | + | |
82 | 90 | | |
83 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
84 | 95 | | |
85 | | - | |
| 96 | + | |
86 | 97 | | |
| 98 | + | |
87 | 99 | | |
88 | 100 | | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
0 commit comments