Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ classifiers = [
"Programming Language :: Python :: 3.14",
]
dependencies = [
"urllib3>=1.21.1",
"urllib3>=2.0.0", # Make aligned with td-client
"trino>=0.334.0",
"pandas>=2.1.0",
"numpy>=1.25.2",
"td-client>=1.6.0",
"td-client>=1.7.0",
"pytz>=2018.5",
"tqdm>=4.60.0",
"pyarrow>=14.0.1", # Enforce compatibility with NumPy 2.x
]

[project.optional-dependencies]
spark = [
"td-pyspark>20.10.0",
"pyspark>=3.0.0",
"pyarrow>=10.0",
]
test = [
"pytest",
Expand Down Expand Up @@ -118,6 +118,7 @@ exclude = [
"pytd.egg-info",
"pytd/tests/**", # Exclude tests for now
"pytd/pandas_td/ipython.py", # IPython dependency not in core requirements
"pytd/pandas_td/__init__.py", # Optional pandas enhancements
"pytd/spark.py", # Spark dependencies are optional
"noxfile.py", # Noxfile is for dev only
]
Expand Down
2 changes: 1 addition & 1 deletion pytd/pandas_td/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def _convert_time(time: Any) -> str:
t = pd.to_datetime(time) # type: ignore[misc]
else:
raise ValueError(f"invalid time value: {time}")
return f"'{t.replace(microsecond=0)}'"
return f"'{t.replace(microsecond=0)}'" # type: ignore[union-attr]


def _to_dataframe(dic: Any, index_col: Any, parse_dates: Any) -> pd.DataFrame:
Expand Down
8 changes: 4 additions & 4 deletions pytd/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def _replace_pd_na(dataframe: pd.DataFrame) -> None:
if dataframe.isnull().any().any(): # type: ignore[misc]
# Replace both np.nan and pd.NA with None
replace_dict = {np.nan: None, pd.NA: None}
dataframe.replace(replace_dict, inplace=True)
dataframe.replace(replace_dict, inplace=True) # type: ignore[misc]


def _to_list(ary: Any) -> list[Any] | None:
Expand All @@ -76,7 +76,7 @@ def _to_list(ary: Any) -> list[Any] | None:
_ary = np.where(_ary == "nan", None, _ary) # type: ignore[arg-type]
elif kind == "O":
_ary = np.array([None if _is_np_nan(x) or _is_pd_na(x) else x for x in _ary])
return _ary.tolist()
return _ary.tolist() # type: ignore[misc]


def _convert_nullable_str(x: Any, t: type, lower: bool = False) -> str | None:
Expand All @@ -103,7 +103,7 @@ def _cast_dtypes(
U Unicode
V void
"""
df = dataframe if inplace else dataframe.copy()
df = dataframe if inplace else dataframe.copy() # type: ignore[misc]

for column, kind in dataframe.dtypes.apply(lambda dtype: dtype.kind).items(): # type: ignore[misc]
t = str
Expand Down Expand Up @@ -134,7 +134,7 @@ def _cast_dtypes(
df[column] = df[column].astype(t) # type: ignore[misc]

if not inplace:
return df
return df # type: ignore[return-value]
return None


Expand Down
16 changes: 8 additions & 8 deletions uv.lock

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