-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #606 from zen-xu/connectorx-stub
typing: add stubs for connectorx.so
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from __future__ import annotations | ||
|
||
from typing import overload, Literal, Any, TypeAlias | ||
import pandas as pd | ||
|
||
_ArrowArrayPtr: TypeAlias = int | ||
_ArrowSchemaPtr: TypeAlias = int | ||
_Column: TypeAlias = str | ||
|
||
@overload | ||
def read_sql( | ||
conn: str, | ||
return_type: Literal["pandas"], | ||
protocol: str | None, | ||
queries: list[str] | None, | ||
partition_query: dict[str, Any] | None, | ||
) -> pd.DataFrame: ... | ||
@overload | ||
def read_sql( | ||
conn: str, | ||
return_type: Literal["arrow", "arrow2"], | ||
protocol: str | None, | ||
queries: list[str] | None, | ||
partition_query: dict[str, Any] | None, | ||
) -> tuple[list[_Column], list[list[tuple[_ArrowArrayPtr, _ArrowSchemaPtr]]]]: ... | ||
def partition_sql(conn: str, partition_query: dict[str, Any]) -> list[str]: ... | ||
def read_sql2( | ||
sql: str, db_map: dict[str, str] | ||
) -> tuple[list[_Column], list[list[tuple[_ArrowArrayPtr, _ArrowSchemaPtr]]]]: ... | ||
def get_meta( | ||
conn: str, | ||
protocol: Literal["csv", "binary", "cursor", "simple", "text"] | None, | ||
query: str, | ||
) -> dict[str, Any]: ... |
Empty file.