Skip to content

Commit

Permalink
fix lint for python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
kenny-statsig committed Nov 7, 2024
1 parent c9ee5a4 commit 73a1ce8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions azureai/get_statsig_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ def get_statsig_user(user: Optional[StatsigUser] = None) -> StatsigUser:
if user is not None:
user.custom_ids["sdk_type"] = "azureai-python"
return user
else:
return StatsigUser(custom_ids={"sdk_type": "azureai-python"})

return StatsigUser(custom_ids={"sdk_type": "azureai-python"})
5 changes: 3 additions & 2 deletions azureai/model_client.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import time

from typing import Dict, Iterable, List, Optional, Union, Callable
from typing import Dict, Iterable, List, Optional, Union, Callable, TypeVar
from azure.ai.inference import ChatCompletionsClient, EmbeddingsClient
from azure.ai.inference.models._models import (
ChatRequestMessage,
Expand All @@ -15,6 +15,7 @@
from statsig import statsig, StatsigUser, StatsigEvent
from .get_statsig_user import get_statsig_user

T = TypeVar( "T" )

class InvokeContext:
invoke_time: float
Expand Down Expand Up @@ -139,7 +140,7 @@ def task():
return res
return self.handle_errors(task=task, fallback=None)

def handle_errors[T](self, task: Callable[[], T], fallback: T) -> T:
def handle_errors(self, task: Callable[[], T], fallback: T) -> T:
try:
return task()
except HttpResponseError as e:
Expand Down

0 comments on commit 73a1ce8

Please sign in to comment.