From a45f36cb662878418865d3ed01a135ba3df6ab44 Mon Sep 17 00:00:00 2001 From: jacgoldsm Date: Mon, 25 Sep 2023 13:45:57 -0400 Subject: [PATCH] fix dict subsetting for 3.7 --- osos/_implementations.py | 8 ++++---- osos/column.py | 2 +- osos/types.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/osos/_implementations.py b/osos/_implementations.py index 6eae464..d20fcdd 100644 --- a/osos/_implementations.py +++ b/osos/_implementations.py @@ -2,7 +2,7 @@ import numpy as np from pandas.core.groupby.generic import SeriesGroupBy from pandas.core.window.rolling import Rolling as RollingWindow -from typing import Union, Callable, Iterable, Any, overload, Optional,List,Tuple +from typing import Union, Callable, Iterable, Any, overload, Optional,List,Tuple,Dict from warnings import warn from .window import EmptyWindow, ConcreteWindowSpec @@ -104,7 +104,7 @@ def sum_func(series: SeriesType, *args, **kwargs) -> pd.Series: def udf_func( series: pd.Series, udf: Callable, - args_and_kwargs: dict[Iterable, dict[str, Any]], + args_and_kwargs: Dict[Iterable, Dict[str, Any]], _over=None, ) -> pd.Series: args, kwargs = args_and_kwargs.get("args"), args_and_kwargs.get("kwargs") @@ -568,7 +568,7 @@ def nanvl_func(col1: pd.Series, col2: pd.Series): def percentile_approx_func( col: pd.Series, - percentage: Union[pd.Series, float, List[float], tuple[float]], + percentage: Union[pd.Series, float, List[float], Tuple[float]], accuracy: Union[pd.Series, float] = 10000, ): @@ -686,7 +686,7 @@ def struct_func( def struct_func( *cols: Union[ pd.Series, - Union[List[pd.Series], tuple[pd.Series, ...]], + Union[List[pd.Series], Tuple[pd.Series, ...]], ] ): diff --git a/osos/column.py b/osos/column.py index e9bedd8..cba7b17 100644 --- a/osos/column.py +++ b/osos/column.py @@ -112,7 +112,7 @@ class FuncOrOp(Node): class ForwardRef: - def __init__(self, reference: str, args: Union[list, None] = None): + def __init__(self, reference: str, args: Union[List, None] = None): self.reference = reference self.args = args if args is not None else [] diff --git a/osos/types.py b/osos/types.py index a6602c7..f2ff913 100644 --- a/osos/types.py +++ b/osos/types.py @@ -2,7 +2,7 @@ import pandas as pd from decimal import Decimal -from typing import List,Tuple +from typing import List,Tuple,Dict # integral IntegerType = lambda: np.int32 @@ -35,7 +35,7 @@ # complex ArrayType = lambda elementType, containsNull=False: List -MapType = lambda keyType, elementType, valueContainsNull=False: dict +MapType = lambda keyType, elementType, valueContainsNull=False: Dict StructType = lambda fields: np.array StructField = lambda name,dataType,nullable=False: Tuple