Skip to content

Commit 8656984

Browse files
committed
0.2.2 - fix typos
Fix: Correct typos in the docstrings.
1 parent b833bb6 commit 8656984

File tree

9 files changed

+40
-29
lines changed

9 files changed

+40
-29
lines changed

Changelog.md

+6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44

55
## CHANGELOG
66

7+
### 0.2.2 @ 12/31/2024
8+
9+
#### :wrench: Fix
10+
11+
1. Fix: Correct typos in the docstrings.
12+
713
### 0.2.1 @ 12/17/2024
814

915
#### :wrench: Fix

flask_sqlalchemy_compat/auto.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,9 @@ def get_flask_sqlalchemy(
205205
`flask_sqlalchemy.SQLAlchemy` if the package is available.
206206
207207
If the package is not available, will attempt to return a
208-
`SQLAlchemyProxy[flask_sqlalchemy_lite.SQLAlchemy]` instance. However, this
209-
returned value is still notated by `flask_sqlalchemy.SQLAlchemy`, which
210-
indicates that users should use `flask_sqlalchemy` to develop their
208+
`SQLAlchemyProxy[flask_sqlalchemy_lite.SQLAlchemy, _ModelLite]` instance.
209+
However, this returned value is still notated by `flask_sqlalchemy.SQLAlchemy`,
210+
which indicates that users should use `flask_sqlalchemy` to develop their
211211
codes, while making this returned value as a falling back option.
212212
"""
213213
if app is not None and not isinstance(app, Flask):

flask_sqlalchemy_compat/backdict.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class BackDict(UserDict[K, V]):
130130
first. If it is not found, will return the value in `back_dict` domain. Since
131131
the modifications of the dictionary will only take effects on the `data` domain,
132132
this second-level domain will not change.
133-
3. The second-level dictionary can have different keyword types. compared to the
133+
3. The second-level dictionary can have different keyword types compared to the
134134
`data` domain. Users need to provide a `key_mapper` and its inverse operator
135135
`key_back_mapper` to support this feature.
136136
"""
@@ -287,16 +287,16 @@ def copy(self) -> Self:
287287
return res
288288

289289
def keys(self):
290-
"""`BackDict(...).keys()` -> a set-like object providing a view on
290+
"""`BackDict(...).keys()` is a set-like object providing a view on
291291
`BackDict`'s keys."""
292292
return collections.abc.KeysView(self.__view)
293293

294294
def items(self):
295-
"""`BackDict(...).items()` -> a set-like object providing a view on
295+
"""`BackDict(...).items()` is a set-like object providing a view on
296296
`BackDict`'s items."""
297297
return collections.abc.ItemsView(self.__view)
298298

299299
def values(self):
300-
"""`BackDict(...).values()` -> an object providing a view on `BackDict`'s
300+
"""`BackDict(...).values()` is an object providing a view on `BackDict`'s
301301
values."""
302302
return collections.abc.ValuesView(self.__view)

flask_sqlalchemy_compat/backends.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
Description
1717
-----------
1818
The backends of the `flask_sqlalchemy_compat` package. These backends are modules
19-
conditionally loaded. In other words, if the model is intalled, will load the module.
19+
conditionally loaded. In other words, if the module is intalled, will load the module.
2020
Otherwise, load a placeholder of the corresponding module.
2121
2222
The backends include:
@@ -89,8 +89,11 @@ class ModulePlaceholder(ModuleType):
8989

9090
def __init__(self, name: str, doc: Optional[str] = None) -> None:
9191
"""Initialization.
92-
Arguments:
93-
name: The module name. It will be passed to ModuleType.
92+
93+
Arguments
94+
---------
95+
name: `str`
96+
The module name. It will be passed to `ModuleType`.
9497
"""
9598
name = str(name)
9699
if doc is None:
@@ -185,7 +188,7 @@ def is_module_invalid(module: ModuleType) -> TypeGuard[ModulePlaceholder]:
185188
class BackendProxy(Generic[M1, M2]):
186189
"""A proxy class that is used for maintaining the dynamically loaded modules.
187190
188-
The properties of this module are editable, thus allowing the modules to be
191+
The properties of this instance are editable, thus allowing the modules to be
189192
dynamically changed if necessary.
190193
"""
191194

flask_sqlalchemy_compat/flask_sa_api.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class SQLAlchemyProxy(Generic[_SQLAlchemyLiteDB_co, _ModelLite_co]):
7878
`flask_sqlalchemy_lite.SQLAlchemy`, it can mimic the usage of
7979
`flask_sqlalchemy.SQLAlchemy`.
8080
81-
Note that not all the functionalities of `flask_sqlalchemy_lite.SQLAlchemy` can
81+
Note that not all the functionalities of this proxy can
8282
be exactly the same as the those of `flask_sqlalchemy.SQLAlchemy`. In specific,
8383
this proxy will do the following things:
8484
@@ -138,14 +138,16 @@ def __init__(
138138

139139
@property
140140
def db(self) -> _SQLAlchemyLiteDB_co:
141-
"""Property: The `db` instance provided by the Flask SQLAlchemy extension."""
141+
"""Property: The `db` instance provided by the Flask SQLAlchemy Lite
142+
extension."""
142143
return self.__db
143144

144145
@property
145146
def Model(self) -> Type[_ModelLite_co]:
146147
"""Property: The `Model` type. It can be used as the base class of the
147-
SQLAlchemy models. This value is `model_class` passed to the initialization
148-
of this wrapper.
148+
SQLAlchemy models. This value is identical to `model_class` passed to the
149+
initialization of this wrapper. But note that `model_class` is already
150+
modified for supporting extra functionalities.
149151
"""
150152
return self.__model_class
151153

@@ -192,7 +194,7 @@ def Query(self) -> Type[sa_orm.Query]:
192194

193195
@property
194196
def session(self) -> sa_orm.scoped_session[sa_orm.Session]:
195-
"""The same as `self.db.session`.
197+
"""The usages are similar to those of `self.db.session`.
196198
197199
The default session for the current application context. It will be
198200
closed when the context ends."""

flask_sqlalchemy_compat/flask_sa_lite_api.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ class SQLAlchemyLiteProxy(Generic[_SQLAlchemyDB_co]):
7979
the `flask_sqlalchemy.SQLAlchemy`, it can mimic the usage of
8080
`flask_sqlalchemy_lite.SQLAlchemy`.
8181
82-
Note that not all the functionalities of `flask_sqlalchemy.SQLAlchemy` can be
82+
Note that not all the functionalities of this proxy can be
8383
exactly the same as the those of `flask_sqlalchemy_lite.SQLAlchemy`. In specific,
8484
this proxy will do the following things:
8585
8686
* Provide a regular session like that of `flask_sqlalchemy_lite.SQLAlchemy`. This
87-
regular session is managed by this proxy class.
87+
regular session is managed by the instance of this proxy class.
8888
* Provide other basic methods in `flask_sqlalchemy_lite.SQLAlchemy`. The usages
8989
would be equivalent but the implmentation is based on `flask_sqlalchemy`.
9090
* Any functionality that cannot be used will raise a `NotImplementedError`.

flask_sqlalchemy_compat/protocols.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,12 @@ def Query(self) -> Callable[..., sa_orm.Query]:
213213

214214
@property
215215
def Table(self) -> Callable[..., sa.Table]:
216-
"""The default query class used by `Model.query` and `lazy="dynamic"`
217-
relationships."""
216+
"""The default data table class that does not require user-specified
217+
metadata."""
218218
...
219219

220220
@property
221221
def Model(self) -> Callable[..., ModelProtocol]:
222-
"""The default query class used by `Model.query` and `lazy="dynamic"`
223-
relationships."""
222+
"""The default object relationship mapping (ORM) model class that has
223+
extensive functionalies."""
224224
...

flask_sqlalchemy_compat/utilities.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
1616
Description
1717
-----------
18-
The extra functionalities used for hooking the original SQLAlchemy extensions. The
18+
The extra functionalities used for hooking the original `SQLAlchemy` extensions. The
1919
extensions need to be hooked because some extra functionalities may need to be
2020
provided.
2121
"""
@@ -272,9 +272,9 @@ def clone_method(
272272
-------
273273
#1: `((self: S, **P) -> T) -> ((self: S, **P) -> T)`
274274
A wrapper that forward a function as it is directly but the signature of the
275-
function will be consistent with the argument `method`.
275+
function will be consistent with the argument `func_o`.
276276
277-
The input signature will be copied from `method`. But the output value will
277+
The input signature will be copied from `func_o`. But the output value will
278278
be determined by the wrapped method.
279279
"""
280280

@@ -317,10 +317,10 @@ def clone_function(
317317
-------
318318
#1: `((**P) -> T) -> ((**P) -> T)`
319319
A wrapper that forward a function as it is directly but the signature of the
320-
function will be consistent with the argument `method`.
320+
function will be consistent with the argument `func_o`.
321321
322-
The input signature will be copied from `method`. But the output value will
323-
be determined by the wrapped method.
322+
The input signature will be copied from `func_o`. But the output value will
323+
be determined by the wrapped function.
324324
"""
325325

326326
def wrapper(func: Callable[P, T]) -> Callable[P, T]:

flask_sqlalchemy_compat/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020

2121
__all__ = ("__version__",)
2222

23-
__version__ = "0.2.1"
23+
__version__ = "0.2.2"

0 commit comments

Comments
 (0)