Skip to content

Commit

Permalink
fix: only convert project ids to string if they are int or uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasKoehneckeAA committed Jan 30, 2025
1 parent b4cc819 commit 7ca97c6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/intelligence_layer/connectors/studio/studio.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from datetime import datetime
from typing import Any, Generic, Optional, TypeVar
from urllib.parse import urljoin
from uuid import uuid4
from uuid import UUID, uuid4

import requests
from pydantic import BaseModel, Field, RootModel, field_validator
Expand Down Expand Up @@ -111,7 +111,9 @@ class GetBenchmarkResponse(BaseModel):

@field_validator("project_id", mode="before")
def transform_id_to_str(cls, value) -> str:
return str(value)
if type(value) is int or type(value) is UUID:
return str(value)
return value


class PostBenchmarkExecution(BaseModel):
Expand Down

0 comments on commit 7ca97c6

Please sign in to comment.