Skip to content

Commit

Permalink
fix(bindings/python): add blocking client related to pyi
Browse files Browse the repository at this point in the history
  • Loading branch information
everpcpc committed Mar 21, 2024
1 parent def62dd commit 3d9b95e
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 121 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bindings.python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
run: pipenv install --dev
- name: Check format
working-directory: bindings/python
run: pipenv run black --check .
run: pipenv run ruff format --check .
- name: Setup develop
working-directory: bindings/python
run: pipenv run maturin develop
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ verify_ssl = true
name = "pypi"

[packages]
databend-driver = {path = ".", editable = true}

[dev-packages]
maturin = "*"
behave = "*"
black = "*"
flake8 = "*"
ruff = "*"

[requires]
python_version = "3.11"
164 changes: 48 additions & 116 deletions bindings/python/Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions bindings/python/package/databend_driver/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@
# limitations under the License.

# flake8: noqa

from ._databend_driver import *
16 changes: 14 additions & 2 deletions bindings/python/package/databend_driver/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# flake8: noqa

class ServerStats:
@property
def total_rows(self) -> int: ...
Expand Down Expand Up @@ -59,7 +61,6 @@ class RowIterator:
async def __anext__(self) -> Row: ...
def schema(self) -> Schema: ...

# flake8: noqa
class AsyncDatabendConnection:
async def info(self) -> ConnectionInfo: ...
async def version(self) -> str: ...
Expand All @@ -68,7 +69,18 @@ class AsyncDatabendConnection:
async def query_iter(self, sql: str) -> RowIterator: ...
async def stream_load(self, sql: str, data: list[list[str]]) -> ServerStats: ...

# flake8: noqa
class AsyncDatabendClient:
def __init__(self, dsn: str): ...
async def get_conn(self) -> AsyncDatabendConnection: ...

class BlockingDatabendConnection:
def info(self) -> ConnectionInfo: ...
def version(self) -> str: ...
def exec(self, sql: str) -> int: ...
def query_row(self, sql: str) -> Row: ...
def query_iter(self, sql: str) -> RowIterator: ...
def stream_load(self, sql: str, data: list[list[str]]) -> ServerStats: ...

class BlockingDatabendClient:
def __init__(self, dsn: str): ...
def get_conn(self) -> BlockingDatabendConnection: ...

0 comments on commit 3d9b95e

Please sign in to comment.