Skip to content

Commit 326f4cd

Browse files
author
matmoncon
committed
docs: update docstrings
1 parent 593ac58 commit 326f4cd

File tree

5 files changed

+28
-28
lines changed

5 files changed

+28
-28
lines changed

pyneo4j_ogm/fields/property_options.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ def WithOptions(
1818
1919
Args:
2020
property_type (Type[T]): The property type to return for the model field.
21-
range_index (bool, optional): Whether the property should have a `RANGE` index or not. Defaults to False.
22-
text_index (bool, optional): Whether the property should have a `TEXT` index or not. Defaults to False.
23-
point_index (bool, optional): Whether the property should have a `POINT` index or not. Defaults to False.
21+
range_index (bool, optional): Whether the property should have a `RANGE` index or not. Defaults to `False`.
22+
text_index (bool, optional): Whether the property should have a `TEXT` index or not. Defaults to `False`.
23+
point_index (bool, optional): Whether the property should have a `POINT` index or not. Defaults to `False`.
2424
unique (bool, optional): Whether a `UNIQUENESS` constraint should be created for the property.
25-
Defaults to False.
25+
Defaults to `False`.
2626
2727
Returns:
2828
Type[T]: A subclass of the provided type with extra attributes.

pyneo4j_ogm/logger.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
Logging configuration for pyneo4j-ogm
33
44
Logging is controlled by two environment variables:
5-
- PYNEO4J_OGM_LOG_LEVEL: the log level to use (default: WARNING)
6-
- PYNEO4J_OGM_ENABLE_LOGGING: whether to enable logging (default: True)
5+
- PYNEO4J_OGM_LOG_LEVEL: the log level to use. Defaults to `WARNING`.
6+
- PYNEO4J_OGM_ENABLE_LOGGING: whether to enable logging. Defaults to `True`.
77
"""
88
import logging
99
from os import environ

pyneo4j_ogm/queries/operators.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ def normalize_expressions(
109109
Normalizes and formats the provided expressions into usable expressions for the builder.
110110
111111
Args:
112-
expressions (Union[Dict[str, Any], List[Any]]): The expressions to normalize
112+
expressions (Union[Dict[str, Any], List[Any]]): The expressions to normalize.
113113
level (int, optional): The recursion depth level. Should not be modified outside the
114-
function itself. Defaults to 0.
114+
function itself. Defaults to `0`.
115115
116116
Returns:
117117
Union[Dict[str, Any], List[Any]]: The normalized expressions.
@@ -179,7 +179,7 @@ def remove_invalid_expressions(self, expressions: Dict[str, Any], level: int = 0
179179
Args:
180180
expressions (Dict[str, Any]): The expression to check.
181181
level (int, optional): The recursion depth level. Should not be modified outside the
182-
function itself. Defaults to 0.
182+
function itself. Defaults to `0`.
183183
"""
184184
operators_to_remove: List[str] = []
185185

pyneo4j_ogm/queries/query_builder.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def node_filters(self, filters: NodeFilters, ref: str = "n") -> None:
6767
6868
Args:
6969
filters (Dict[str, Any]): The filters to build.
70-
ref (str, optional): The reference to the node. Defaults to "n".
70+
ref (str, optional): The reference to the node. Defaults to `'n'`.
7171
"""
7272
logger.debug("Building node filters %s", filters)
7373
self._operator_builder.ref = ref
@@ -94,7 +94,7 @@ def relationship_filters(self, filters: RelationshipFilters, ref: str = "r") ->
9494
9595
Args:
9696
filters (Dict[str, Any]): The filters to build.
97-
ref (str, optional): The reference to the relationship. Defaults to "r".
97+
ref (str, optional): The reference to the relationship. Defaults to `'r'`.
9898
"""
9999
logger.debug("Building relationship filters %s", filters)
100100
self._operator_builder.ref = ref
@@ -123,8 +123,8 @@ def relationship_property_filters(
123123
124124
Args:
125125
filters (Dict[str, Any]): The filters to build.
126-
ref (str, optional): The reference to the relationship. Defaults to "r".
127-
node_ref (str, optional): The reference to the node. Defaults to "end".
126+
ref (str, optional): The reference to the relationship. Defaults to `'r'`.
127+
node_ref (str, optional): The reference to the node. Defaults to `'end'`.
128128
"""
129129
logger.debug("Building relationship property filters %s", filters)
130130
self._operator_builder.reset_state()
@@ -160,9 +160,9 @@ def multi_hop_filters(
160160
161161
Args:
162162
filters (Dict[str, Any]): The filters to build.
163-
start_ref (str, optional): The reference to the start node. Defaults to "n".
164-
end_ref (str, optional): The reference to the end node. Defaults to "m".
165-
rel_ref (str, optional): The reference to the relationship. Defaults to "r".
163+
start_ref (str, optional): The reference to the start node. Defaults to `'n'`.
164+
end_ref (str, optional): The reference to the end node. Defaults to `'m'`.
165+
rel_ref (str, optional): The reference to the relationship. Defaults to `'r'`.
166166
"""
167167
logger.debug("Building multi hop filters %s", filters)
168168
self._operator_builder.ref = start_ref
@@ -237,7 +237,7 @@ def query_options(self, options: QueryOptions, ref: str = "n") -> None:
237237
238238
Args:
239239
options (QueryOptions): The options to build.
240-
ref (str, optional): The reference to the node or relationship. Defaults to "n".
240+
ref (str, optional): The reference to the node or relationship. Defaults to `'n'`.
241241
"""
242242
logger.debug("Building query options %s", options)
243243

@@ -305,16 +305,16 @@ def relationship_match(
305305
306306
Args:
307307
type_ (str): The type of the relationship.
308-
ref (str, optional): The reference to the relationship. Defaults to "r".
309-
start_node_ref (Optional[str], optional): The reference to the start node. Defaults to None.
310-
start_node_labels (Optional[List[str]], optional): The labels of the start node. Defaults to None.
311-
end_node_ref (Optional[str], optional): The reference to the end node. Defaults to None.
312-
end_node_labels (Optional[List[str]], optional): The labels of the end node. Defaults to None.
313-
min_hops (Optional[Union[int, str]], optional): The minimum number of hops. Defaults to None.
314-
max_hops (Optional[Union[int, str]], optional): The maximum number of hops. Defaults to None.
308+
ref (str, optional): The reference to the relationship. Defaults to `'r'`.
309+
start_node_ref (Optional[str], optional): The reference to the start node. Defaults to `None`.
310+
start_node_labels (Optional[List[str]], optional): The labels of the start node. Defaults to `None`.
311+
end_node_ref (Optional[str], optional): The reference to the end node. Defaults to `None`.
312+
end_node_labels (Optional[List[str]], optional): The labels of the end node. Defaults to `None`.
313+
min_hops (Optional[Union[int, str]], optional): The minimum number of hops. Defaults to `None`.
314+
max_hops (Optional[Union[int, str]], optional): The maximum number of hops. Defaults to `None`.
315315
316316
Raises:
317-
InvalidRelationshipHops: Raised when the min_hops or max_hops are invalid.
317+
InvalidRelationshipHops: If the min_hops or max_hops are invalid.
318318
319319
Returns:
320320
str: The relationship to match.
@@ -374,7 +374,7 @@ def build_projections(
374374
Builds a projection which only returns the node properties defined in the projection.
375375
376376
Args:
377-
ref (str): The reference to the node. Defaults to "n".
377+
ref (str): The reference to the node. Defaults to `'n'`.
378378
projections (Dict[str, str]): The projections to build.
379379
"""
380380
if not isinstance(projections, dict):

pyneo4j_ogm/queries/validators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ class MultiHopNodeModel(BaseModel):
295295

296296
class Config:
297297
"""
298-
Pydantic configuration
298+
Pydantic configuration.
299299
"""
300300

301301
extra = Extra.allow
@@ -319,7 +319,7 @@ class MultiHopFiltersModel(BaseModel):
319319

320320
class Config:
321321
"""
322-
Pydantic configuration
322+
Pydantic configuration.
323323
"""
324324

325325
extra = Extra.allow

0 commit comments

Comments
 (0)