Skip to content

Commit 1ef6001

Browse files
committed
fix more typing for python < 3.12
1 parent 9de7092 commit 1ef6001

File tree

4 files changed

+5
-13
lines changed

4 files changed

+5
-13
lines changed

pocketbase/models/file_upload.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
from __future__ import annotations
22

3-
from collections.abc import Sequence
3+
from typing import Sequence, Union
44

55
from httpx._types import FileTypes
66

7-
FileUploadTypes = FileTypes | Sequence[FileTypes]
7+
FileUploadTypes = Union[FileTypes, Sequence[FileTypes]]
88

99

1010
class FileUpload:

pocketbase/services/admin_service.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
from typing import Any, override
3+
from typing import Any
44

55
from pocketbase.models.admin import Admin
66
from pocketbase.services.utils.crud_service import CrudService
@@ -23,15 +23,12 @@ def is_valid(self) -> bool:
2323

2424

2525
class AdminService(CrudService[Admin]):
26-
@override
2726
def decode(self, data: dict[str, Any]) -> Admin:
2827
return Admin(data)
2928

30-
@override
3129
def base_crud_path(self) -> str:
3230
return "/api/admins"
3331

34-
@override
3532
def update(
3633
self,
3734
id: str,
@@ -52,7 +49,6 @@ def update(
5249
self.client.auth_store.save(self.client.auth_store.token, item)
5350
return item
5451

55-
@override
5652
def delete(
5753
self, id: str, query_params: dict[str, Any] | None = None
5854
) -> bool:

pocketbase/services/record_service.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33
from dataclasses import dataclass
4-
from typing import TYPE_CHECKING, Any, override
4+
from typing import TYPE_CHECKING, Any
55
from urllib.parse import quote, urlencode
66

77
from pocketbase.models.record import Record
@@ -58,15 +58,12 @@ def __init__(self, client: Client, collection_id_or_name: str) -> None:
5858
super().__init__(client)
5959
self.collection_id_or_name = collection_id_or_name
6060

61-
@override
6261
def decode(self, data: dict[str, Any]) -> Record:
6362
return Record(data)
6463

65-
@override
6664
def base_crud_path(self) -> str:
6765
return self.base_collection_path() + "/records"
6866

69-
@override
7067
def update(
7168
self,
7269
id: str,
@@ -90,7 +87,6 @@ def update(
9087
self.client.auth_store.save(self.client.auth_store.token, item)
9188
return item
9289

93-
@override
9490
def delete(
9591
self, id: str, query_params: dict[str, Any] | None = None
9692
) -> bool:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "pocketbase"
3-
version = "0.13.1"
3+
version = "0.13.2"
44
description = "PocketBase SDK for python."
55
authors = ["Vithor Jaeger <[email protected]>", "Max Amling <[email protected]>"]
66
readme = "README.md"

0 commit comments

Comments
 (0)