Skip to content

Commit

Permalink
fix: Literal not supported in python 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbarros authored and fabclmnt committed Oct 28, 2024
1 parent 3642b01 commit 7ae5e16
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/ydata_profiling/config.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
"""Configuration for the package."""
from enum import Enum
from pathlib import Path
from typing import Any, Dict, List, Literal, Optional, Tuple, Union
from typing import Any, Dict, List, Optional, Tuple, Union

import yaml
from pydantic.v1 import BaseModel, BaseSettings, Field, PrivateAttr

try:
# typing only available in python 3.8+
from typing import Literal
AutoLagType = Literal["AIC", "BIC", "t-stat"]
except:
AutoLagType = str

def _merge_dictionaries(dict1: dict, dict2: dict) -> dict:
"""
Expand Down Expand Up @@ -112,7 +118,7 @@ class TimeseriesVars(BaseModel):
lags: List[int] = [1, 7, 12, 24, 30]
significance: float = 0.05
pacf_acf_lag: int = 100
autolag: Optional[Literal["AIC", "BIC", "t-stat"]] = "AIC"
autolag: Optional[AutoLagType] = "AIC"
maxlag: Optional[int] = None


Expand Down

0 comments on commit 7ae5e16

Please sign in to comment.