Skip to content

Commit

Permalink
fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dantownsend committed Mar 15, 2024
1 parent 7ed97e1 commit 2e2f41d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions piccolo_api/crud/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,9 @@ def __init__(
table=table, exclude_secrets=exclude_secrets, max_joins=max_joins
)
schema_extra["visible_fields_options"] = self.visible_fields_options
schema_extra[
"primary_key_name"
] = self.table._meta.primary_key._meta.name
schema_extra["primary_key_name"] = (
self.table._meta.primary_key._meta.name
)
self.schema_extra = schema_extra

root_methods = ["GET"]
Expand All @@ -282,9 +282,9 @@ def __init__(
Route(
path="/{row_id:str}/",
endpoint=self.detail,
methods=["GET"]
if read_only
else ["GET", "PUT", "DELETE", "PATCH"],
methods=(
["GET"] if read_only else ["GET", "PUT", "DELETE", "PATCH"]
),
),
]

Expand Down Expand Up @@ -860,9 +860,9 @@ async def get_all(
curr_page_len = curr_page_len + offset
count = await self.table.count().run()
curr_page_string = f"{offset}-{curr_page_len}"
headers[
"Content-Range"
] = f"{plural_name} {curr_page_string}/{count}"
headers["Content-Range"] = (
f"{plural_name} {curr_page_string}/{count}"
)

# We need to serialise it ourselves, in case there are datetime
# fields.
Expand Down
2 changes: 1 addition & 1 deletion piccolo_api/fastapi/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ def modify_signature(
# we have a column type of ``Array(Array(Integer()))``.
# For filtering purposes, we only need ``list[int]``.
if _is_multidimensional_array(type_=type_):
type_ = t.List[_get_array_base_type(type_=type_)]
type_ = t.List[_get_array_base_type(type_=type_)] # type: ignore # noqa: E501

parameters.append(
Parameter(
Expand Down

0 comments on commit 2e2f41d

Please sign in to comment.