Skip to content

Commit

Permalink
Fix Pandas type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
RadekBuczkowski committed May 12, 2024
1 parent f895542 commit 5d18056
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/spetlr/power_bi/SparkPandasDataFrame.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
import numpy as np
import pandas as pd
from dateutil.parser import parse
from pandas.core.generic import NDFrameT
from pandas.core.frame import DataFrame as PandasDataFrame
from pandas.core.generic import NDFrameT as PandasColumn
from pyspark.sql import DataFrame
from pytz import timezone, utc

Expand All @@ -26,7 +27,9 @@ class SparkPandasDataFrame:
def __init__(
self,
json: Union[Dict, List],
schema: List[tuple[Union[str, Callable[[pd.DataFrame], NDFrameT]], str, str]],
schema: List[
tuple[Union[str, Callable[[PandasDataFrame], PandasColumn]], str, str]
],
*,
indexing_columns: Union[int, List[int], str, List[str], None] = None,
sorting_columns: Union[int, List[int], str, List[str], None] = None,
Expand Down Expand Up @@ -193,7 +196,7 @@ def _localize_time(
time = time.astimezone(timezone(local_timezone_name))
return time.replace(tzinfo=None)

def get_pandas_df(self) -> Union[pd.DataFrame, None]:
def get_pandas_df(self) -> Union[PandasDataFrame, None]:
"""
Returns the data frame as a Pandas data frame.
Expand Down

0 comments on commit 5d18056

Please sign in to comment.