Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions dataframely/_native.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def regex_matching_string_length(regex: str) -> tuple[int, int | None]:

Returns:
A tuple of the minimum of maximum length of the matching strings. While the minimum
length is guaranteed to be available, the maximum length may be ``None`` if ``regex``
matches strings of potentially infinite length (e.g. due to the use of ``+`` or ``*``).
length is guaranteed to be available, the maximum length may be `None` if `regex`
matches strings of potentially infinite length (e.g. due to the use of `+` or `*`).

Raises:
ValueError: If the regex cannot be parsed or analyzed.
Expand All @@ -40,21 +40,21 @@ def regex_sample(
Args:
regex: The regular expression generated strings must match. The regular
expression must not contain any lookaround operators.
n: The number of random strings to generate or ``None`` if a single one should
n: The number of random strings to generate or `None` if a single one should
be generated.
max_repetitions: The maximum number of repetitions for ``+`` and ``*``
max_repetitions: The maximum number of repetitions for `+` and `*`
quantifiers.
seed: The seed to use for the random sampling procedure.

Returns:
A single randomly generated string if ``n is None`` or a list of randomly
generated strings if ``n`` is an integer.
A single randomly generated string if `n is None` or a list of randomly
generated strings if `n` is an integer.

Raises:
ValueError: If the regex cannot be parsed.

Attention:
Using wildcards (i.e. ``.``) really means _any_ valid Unicode character.
Using wildcards (i.e. `.`) really means _any_ valid Unicode character.
Consider using more precise regular expressions if this is undesired.
"""

Expand Down
2 changes: 1 addition & 1 deletion dataframely/_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def all_rules_required(

Contrary to :meth:`all_rules`, this method raises a
:mod:`~polars.exceptions.ComputeError` at execution time if any rule indicates a
validation failure. The ``ComputeError`` includes a helpful error message.
validation failure. The `ComputeError` includes a helpful error message.

Args:
rules: The rules to evaluate.
Expand Down
18 changes: 9 additions & 9 deletions dataframely/_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def rule(*, group_by: list[str] | None = None) -> Callable[[ValidationFunction],

The name of the function will be used as the name of the rule. The function should
return an expression providing a boolean value whether a row is valid wrt. the rule.
A value of ``true`` indicates validity.
A value of `true` indicates validity.

Rules should be used only in the following two circumstances:

Expand All @@ -113,12 +113,12 @@ def rule(*, group_by: list[str] | None = None) -> Callable[[ValidationFunction],
group_by: An optional list of columns to group by for rules operating on groups
of rows. If this list is provided, the returned expression must return a
single boolean value, i.e. some kind of aggregation function must be used
(e.g. ``sum``, ``any``, ...).
(e.g. `sum`, `any`, ...).

Note:
You'll need to explicitly handle ``null`` values in your columns when defining
rules. By default, any rule that evaluates to ``null`` because one of the
columns used in the rule is ``null`` is interpreted as ``true``, i.e. the row
You'll need to explicitly handle `null` values in your columns when defining
rules. By default, any rule that evaluates to `null` because one of the
columns used in the rule is `null` is interpreted as `true`, i.e. the row
is assumed to be valid.

Attention:
Expand Down Expand Up @@ -151,8 +151,8 @@ def with_evaluation_rules(lf: pl.LazyFrame, rules: dict[str, Rule]) -> pl.LazyFr

Returns:
The input lazy frame along with one boolean column for each rule with the name
of the rule. For each rule, a value of ``True`` indicates successful validation
while ``False`` indicates an issue.
of the rule. For each rule, a value of `True` indicates successful validation
while `False` indicates an issue.
"""
# Rules must be distinguished into two types of rules:
# 1. Simple rules can simply be selected on the data frame (this includes rules
Expand Down Expand Up @@ -239,11 +239,11 @@ def rule_from_dict(data: dict[str, Any]) -> Rule:

Args:
data: The dictionary obtained by calling :meth:`~Rule.asdict` on a rule object.
The dictionary must contain a key ``"rule_type"`` that indicates which rule
The dictionary must contain a key `"rule_type"` that indicates which rule
type to instantiate.

Returns:
The rule object as read from ``data``.
The rule object as read from `data`.
"""
name = data["rule_type"]
if name not in _TYPE_MAPPING:
Expand Down
6 changes: 3 additions & 3 deletions dataframely/_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class DataFrame(pl.DataFrame, Generic[S]):
"""Generic wrapper around a :class:`polars.DataFrame` to attach schema information.

This class is merely used for the type system and never actually instantiated. This
means that it won't exist at runtime and ``isinstance(PoalrsDataFrame, <var>)`` will
means that it won't exist at runtime and `isinstance(PoalrsDataFrame, <var>)` will
always fail. Accordingly, users should not try to create instances of this class.
"""

Expand Down Expand Up @@ -91,8 +91,8 @@ class LazyFrame(pl.LazyFrame, Generic[S]):
"""Generic wrapper around a :class:`polars.LazyFrame` to attach schema information.

This class is merely used for the type system and never actually instantiated. This
means that it won't exist at runtime and ``isinstance(LazyFrame, <var>)`` will
always fail. Accordingly, users should not try to create instances of this class.
means that it won't exist at runtime and `isinstance(LazyFrame, <var>)` will always
fail. Accordingly, users should not try to create instances of this class.
"""

# NOTE: Code in this class will never be executed.
Expand Down
2 changes: 1 addition & 1 deletion dataframely/collection/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class CollectionMember:

Members:
ignored_in_filters: Indicates that a member should be ignored in the
``@dy.filter`` methods of a collection. This also affects the computation
`@dy.filter` methods of a collection. This also affects the computation
of the shared primary key in the collection.

Example:
Expand Down
Loading
Loading