Skip to content

Commit

Permalink
Make code example for microsoft/pyright#9709
Browse files Browse the repository at this point in the history
  • Loading branch information
Pwuts committed Jan 15, 2025
1 parent 85180e1 commit ede7fb4
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions autogpt_platform/backend/backend/server/v2/library/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,22 @@ async def update_agent_version_in_library(
where={"id": library_agent.id},
data=prisma.types.LibraryAgentUpdateInput(
Agent=prisma.types.AgentGraphUpdateOneWithoutRelationsInput(
connect=prisma.types._AgentGraphCompoundPrimaryKey(
graphVersionId=prisma.types._AgentGraphCompoundPrimaryKeyInner(
id=agent_id,
version=agent_version,
)
connect=prisma.types.AgentGraphWhereUniqueInput(
# This is INVALID, but the type checker doesn't complain:
id=agent_id,
version=agent_version,
),

# This would be valid:
# connect=prisma.types.AgentGraphWhereUniqueInput(
# graphVersionId={"id": agent_id, "version": agent_version},
# ),

# This DOES raise an error:
# connect=prisma.types._AgentGraphCompoundPrimaryKey(
# id=agent_id,
# version=agent_version,
# ),
),
),
)
Expand Down

0 comments on commit ede7fb4

Please sign in to comment.