Skip to content

Commit

Permalink
SE-1356 Fix TypeError: 'type' object is not subscriptable error for P…
Browse files Browse the repository at this point in the history
…ython < 3.9
  • Loading branch information
medhatphq committed Jul 16, 2024
1 parent b2b74c4 commit 4a97ebd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions predicthq/endpoints/v1/features/schemas.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from datetime import date
from typing import Any, List, Optional, Union
from typing import Any, Dict, List, Optional, Union

from pydantic import BaseModel, RootModel

Expand All @@ -25,7 +25,7 @@ class FeatureStat(BaseModel):


class Feature(RootModel):
root: dict[str, Union[date, Optional[FeatureStat], Optional[FeatureRankLevel]]]
root: Dict[str, Union[date, Optional[FeatureStat], Optional[FeatureRankLevel]]]

def __getattr__(self, name: str) -> Any:
return self.root[name]
Expand Down

0 comments on commit 4a97ebd

Please sign in to comment.