Skip to content

Commit ff703a9

Browse files
committed
Bump to next version, add docs regarding migration to v0.14.0
1 parent 56d507b commit ff703a9

File tree

6 files changed

+646
-610
lines changed

6 files changed

+646
-610
lines changed

docs/v0_14_migration.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Breaking Changes in v0.14
2+
3+
## 1. `total` becomes required by default
4+
5+
`total` field now becomes required in `Page` and `LimitOffsetPage` classes.
6+
It was previously optional, but now it is required for non-optional pages.
7+
8+
## 2. `UseIncludeTotal` updates `total` field type.
9+
10+
`UseIncludeTotal` customization now updates `total` field to required or optional based on its value.
11+
12+
## 3. `CursorPage` now includes `total` field by default
13+
14+
`CursorPage` class now includes `total` field by default.
15+
Now all pages have same default behavior regarding `total` field.
16+
17+
You can still use `UseIncludeTotal` to disable `total` field in `CursorPage`.
18+
19+
```python
20+
from typing import TypeVar
21+
22+
from fastapi_pagination.cursor import CursorPage
23+
from fastapi_pagination.customization import UseIncludeTotal, CustomizedPage
24+
25+
T = TypeVar("T")
26+
27+
CursorPageNoTotal = CustomizedPage[
28+
CursorPage[T],
29+
UseIncludeTotal(False),
30+
]
31+
32+
```
33+
34+
## 4. `beanie` min version update
35+
36+
`beanie` package now requires version `2.0.0` or higher.

fastapi_pagination/customization.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ def _make_field_optional(field: Any) -> Any:
352352

353353
field = copy(field)
354354

355-
field.annotation = Optional[field.annotation] # type: ignore[assignment]
355+
field.annotation = Optional[field.annotation]
356356
field.default = None
357357
field.default_factory = None
358358

@@ -389,7 +389,7 @@ def _make_field_required(field: Any) -> Any:
389389
assert isinstance(field, _PydanticField)
390390

391391
field = copy(field)
392-
field.required = True # type: ignore[attr-defined]
392+
field.required = True
393393
field.default = ...
394394
field.default_factory = None
395395

fastapi_pagination/ext/sqlmodel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def paginate(
110110
session,
111111
query,
112112
params,
113-
count_query=count_query,
113+
count_query=count_query, # type: ignore[arg-type]
114114
subquery_count=subquery_count,
115115
transformer=transformer,
116116
additional_data=additional_data,
@@ -122,7 +122,7 @@ def paginate(
122122
session,
123123
query,
124124
params,
125-
count_query=count_query,
125+
count_query=count_query, # type: ignore[arg-type]
126126
subquery_count=subquery_count,
127127
transformer=transformer, # type: ignore[arg-type]
128128
additional_data=additional_data,

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ nav:
9090
- "Cursor Pagination": integrations/sqlalchemy/cursor_pagination.md
9191
- "Relationships": integrations/sqlalchemy/relationships.md
9292
- "Migration to v0.13.x": "v0_13_migration.md"
93+
- "Migration to v0.14.x": "v0_14_migration.md"
9394
- "FAQ":
9495
- "FAQ": faq/faq.md
9596
- "Contributing": contributing.md

pyproject.toml

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "fastapi-pagination"
3-
version = "0.13.2"
3+
version = "0.14.0b1"
44
description = "FastAPI pagination"
55
authors = [
66
{ name = "Yurii Karabas", email = "[email protected]" },
@@ -53,31 +53,11 @@ piccolo = ["piccolo>=0.89,<1.25"]
5353
motor = ["motor>=3.6.0,<4.0.0"]
5454
bunnet = ["bunnet>=1.1.0,<2"]
5555
mongoengine = ["mongoengine>=0.23.1,<0.30.0"]
56-
beanie = ["beanie>=1.25.0"]
56+
beanie = ["beanie>=2.0.0"]
5757
scylla-driver = ["scylla-driver>=3.25.6,<4"]
5858
odmantic = ["odmantic>=1.0.2,<2"]
5959
elasticsearch = ["elasticsearch-dsl>=8.13.0,<9"]
6060
firestore = ["google-cloud-firestore>=2.19.0,<3"]
61-
all = [
62-
"sqlmodel>=0.0.22",
63-
"SQLAlchemy>=1.3.20",
64-
"databases>=0.6.0",
65-
"orm>=0.3.1",
66-
"odmantic>=1.0.2,<2",
67-
"tortoise-orm>=0.22.0",
68-
"asyncpg>=0.24.0",
69-
"django<6.0.0",
70-
"piccolo>=0.89,<1.25",
71-
"motor>=3.6.0,<4.0.0",
72-
"mongoengine>=0.23.1,<0.30.0",
73-
"pony>=0.7.16,<0.8",
74-
"beanie>=1.25.0",
75-
"sqlakeyset>=2.0.1680321678,<3",
76-
"scylla-driver>=3.25.6,<4",
77-
"bunnet>=1.1.0,<2",
78-
"elasticsearch-dsl>=8.13.0,<9",
79-
"google-cloud-firestore>=2.19.0,<3",
80-
]
8161

8262
[project.urls]
8363
Repository = "https://github.com/uriyyo/fastapi-pagination"

0 commit comments

Comments
 (0)