Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions polyapi/poly_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def update_one(*, id: str, where: Optional[{table_name}WhereFilter], data: {tabl
@staticmethod
def update_one(*args, **kwargs) -> {table_name}Row:
if args:
if len(args) != 2 or or not isinstance(args[0], str) not isinstance(args[1], dict):
if len(args) != 2 or not isinstance(args[0], str) or not isinstance(args[1], dict):
raise TypeError("Expected id and query as arguments or as kwargs")
query = args[1]
if not isinstance(query["where"], dict):
Expand Down Expand Up @@ -356,7 +356,7 @@ def delete_one(*, where: Optional[{table_name}WhereFilter]) -> PolyDeleteResult:
@staticmethod
def delete_one(*args, **kwargs) -> PolyDeleteResult:
if args:
if len(args) != 2 or or not isinstance(args[0], str) not isinstance(args[1], dict):
if len(args) != 2 or not isinstance(args[0], str) or not isinstance(args[1], dict):
raise TypeError("Expected id and query as arguments or as kwargs")
query = args[1]
if not isinstance(query["where"], dict):
Expand Down
6 changes: 3 additions & 3 deletions tests/test_tabi.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class MyTableRow(TypedDict, total=False):
active: Required[bool]
""" Required property """

optional: dict[str, Any]
optional: Dict[str, Any]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs reverted for now. See https://github.com/polyapi/poly-alpha/issues/5022 which is a ticket for resolving these type issues.




Expand Down Expand Up @@ -295,7 +295,7 @@ def update_one(*, id: str, where: Optional[MyTableWhereFilter], data: MyTableSub
@staticmethod
def update_one(*args, **kwargs) -> MyTableRow:
if args:
if len(args) != 2 or or not isinstance(args[0], str) not isinstance(args[1], dict):
if len(args) != 2 or not isinstance(args[0], str) or not isinstance(args[1], dict):
raise TypeError("Expected id and query as arguments or as kwargs")
query = args[1]
if not isinstance(query["where"], dict):
Expand Down Expand Up @@ -336,7 +336,7 @@ def delete_one(*, where: Optional[MyTableWhereFilter]) -> PolyDeleteResult: ...
@staticmethod
def delete_one(*args, **kwargs) -> PolyDeleteResult:
if args:
if len(args) != 2 or or not isinstance(args[0], str) not isinstance(args[1], dict):
if len(args) != 2 or not isinstance(args[0], str) or not isinstance(args[1], dict):
raise TypeError("Expected id and query as arguments or as kwargs")
query = args[1]
if not isinstance(query["where"], dict):
Expand Down
Loading