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
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@

## myst_parser
myst_parser_config = {"myst_enable_extensions": ["rst_eval_roles"]}
nitpick_ignore = [("myst", "group-rules")]

## numpydoc
numpydoc_class_members_toctree = False
Expand Down
15 changes: 1 addition & 14 deletions docs/guides/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,4 @@ class UserSchema(dy.Schema):

## How do I fix the ruff error `First argument of a method should be named self`?

If you are using [`ruff`](https://docs.astral.sh/ruff/) and introduce custom rules for your schemas, `ruff` will create
the following linting error:

```
N805 First argument of a method should be named `self`
```

To fix this, you'll need to let `ruff` know that the `@dy.rule` decorator is applied to classmethods. This can easily
be done by adding the following to your `pyproject.toml`:

```toml
[tool.ruff.lint.pep8-naming]
classmethod-decorators = ["dataframely.rule"]
```
See our documentation on [group rules](./quickstart.md#group-rules).
7 changes: 3 additions & 4 deletions docs/guides/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,11 @@ in order to produce exactly one value per group:
in group rules, the "input" that the expression is evaluated on is a set of rows.

````{note}
If you are using `mypy` to type check your code, the usage of rules requires you to use the dataframely `mypy` plugin.
In order to use it, add the following to your `pyproject.toml`:
If you are using [`ruff`](https://docs.astral.sh/ruff/) to lint your code, you'll need to tell `ruff` to treat rules like classmethods. To this end, you can add the following to your `pyproject.toml`:

```toml
[tool.mypy]
plugins = ["dataframely.mypy"]
[tool.ruff.lint.pep8-naming]
classmethod-decorators = ["dataframely.rule"]
```

````
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ markers = [
testpaths = ["tests"]

[tool.coverage.run]
omit = ["dataframely/mypy.py", "dataframely/testing/generate.py"]
omit = ["dataframely/testing/generate.py"]
Loading