Skip to content

Commit dc178c6

Browse files
docs: add some missing inline documentation (#95)
1 parent 4e90818 commit dc178c6

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

src/finch/_base_client.py

+11
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,17 @@ def __init__(
132132

133133

134134
class BasePage(GenericModel, Generic[ModelT]):
135+
"""
136+
Defines the core interface for pagination.
137+
138+
Type Args:
139+
ModelT: The pydantic model that represents an item in the response.
140+
141+
Methods:
142+
has_next_page(): Check if there is another page available
143+
next_page_info(): Get the necesary information to make a request for the next page
144+
"""
145+
135146
_options: FinalRequestOptions = PrivateAttr()
136147
_model: Type[ModelT] = PrivateAttr()
137148

src/finch/_utils/_transform.py

+4
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ def _get_annoted_type(type_: type) -> type | None:
108108

109109

110110
def _maybe_transform_key(key: str, type_: type) -> str:
111+
"""Transform the given `data` based on the annotations provided in `type_`.
112+
113+
Note: this function only looks at `Annotated` types that contain `PropertInfo` metadata.
114+
"""
111115
annotated_type = _get_annoted_type(type_)
112116
if annotated_type is None:
113117
# no `Annotated` definition for this type, no transformation needed

src/finch/_utils/_utils.py

+6
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ def extract_files(
2727
*,
2828
paths: Sequence[Sequence[str]],
2929
) -> list[tuple[str, FileTypes]]:
30+
"""Recursively extract files from the given dictionary based on specified paths.
31+
32+
A path may look like this ['foo', 'files', '<array>', 'data'].
33+
34+
Note: this mutates the given dictionary.
35+
"""
3036
files: list[tuple[str, FileTypes]] = []
3137
for path in paths:
3238
files.extend(_extract_items(query, path, index=0, flattened_key=None))

0 commit comments

Comments
 (0)