Skip to content

Commit

Permalink
mypy fixes (#252)
Browse files Browse the repository at this point in the history
  • Loading branch information
WillAyd authored Jan 28, 2024
1 parent ec028fd commit 1c820fd
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ addopts = [

[tool.mypy]
[[tool.mypy.overrides]]
module = ["tableauhyperapi.*"]
module = ["tableauhyperapi.*", "pyarrow.*"]
ignore_missing_imports = true

[tool.isort]
Expand Down
2 changes: 1 addition & 1 deletion src/pantab/_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import tableauhyperapi as tab_api

import pantab._types as pantab_types
import pantab.libpantab as libpantab # type: ignore
import pantab.libpantab as libpantab


def frame_from_hyper_query(
Expand Down
12 changes: 6 additions & 6 deletions src/pantab/_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
import shutil
import tempfile
import uuid
from typing import Any, Literal, Union
from typing import Any, Literal, Optional, Union

import tableauhyperapi as tab_api

import pantab._types as pantab_types
import pantab.libpantab as libpantab # type: ignore
import pantab.libpantab as libpantab


def _validate_table_mode(table_mode: Literal["a", "w"]) -> None:
Expand Down Expand Up @@ -54,8 +54,8 @@ def frame_to_hyper(
*,
table: pantab_types.TableNameType,
table_mode: Literal["a", "w"] = "w",
json_columns: list[str] = None,
geo_columns: list[str] = None,
json_columns: Optional[set[str]] = None,
geo_columns: Optional[set[str]] = None,
) -> None:
"""See api.rst for documentation"""
frames_to_hyper(
Expand All @@ -72,8 +72,8 @@ def frames_to_hyper(
database: Union[str, pathlib.Path],
*,
table_mode: Literal["a", "w"] = "w",
json_columns: set[str] = None,
geo_columns: set[str] = None,
json_columns: Optional[set[str]] = None,
geo_columns: Optional[set[str]] = None,
) -> None:
"""See api.rst for documentation."""
_validate_table_mode(table_mode)
Expand Down
10 changes: 10 additions & 0 deletions src/pantab/libpantab.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from typing import Any, Literal

def write_to_hyper(
dict_of_capsules: dict[tuple[str, str], Any],
path: str,
table_mode: Literal["w", "a"],
json_columns: set[str],
geo_columns: set[str],
) -> None: ...
def read_from_hyper_query(path: str, query: str): ...

0 comments on commit 1c820fd

Please sign in to comment.