Skip to content

Commit 8fa250a

Browse files
committed
Enforce strict type checking on docs
1 parent aad00e4 commit 8fa250a

26 files changed

+104
-50
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ repos:
3333
rev: v1.17.1
3434
hooks:
3535
- id: jupytext
36-
types: ["python"]
37-
args: ["--sync", "--quiet"]
36+
files: "^docs/"
37+
args: ["--sync"]

docs/apps/html.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ kernelspec:
1212
name: itables
1313
---
1414

15+
```{code-cell} ipython3
16+
:tags: [remove-cell]
17+
18+
# pyright: reportUnknownVariableType=false
19+
```
20+
1521
# HTML export
1622

1723
To get the HTML representation of a Pandas DataFrame `df` as an interactive [DataTable](https://datatables.net/), you can use `to_html_datatable` as below:

docs/changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ITables ChangeLog
55
----------------------
66

77
**Added**
8-
- We now enforce `pyright` on the ITables documentation
8+
- We now enforce `pyright` on the ITables documentation ([#395](https://github.com/mwouts/itables/issues/395))
99

1010
**Changed**
1111
- The `warn_on_undocumented_option` option now defaults to `True` and only check the option names

docs/contributing.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ kernelspec:
1212
name: itables
1313
---
1414

15+
```{code-cell} ipython3
16+
:tags: [remove-cell]
17+
18+
# pyright: reportUnknownVariableType=false
19+
```
20+
1521
# Contributing
1622

1723
Thanks for considering making a contribution to ITables. There are

docs/css.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ kernelspec:
1616
:tags: [remove-cell]
1717
1818
# ruff: noqa: E402
19+
# pyright: reportUnknownVariableType=false
1920
```
2021

2122
# CSS

docs/options/allow_html.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ kernelspec:
1212
name: itables
1313
---
1414

15+
```{code-cell} ipython3
16+
:tags: [remove-cell]
17+
18+
# pyright: reportUnknownVariableType=false
19+
# pyright: reportUnknownArgumentType=false
20+
# pyright: reportUnknownMemberType=false
21+
```
22+
1523
# Allow HTML
1624

1725
Since v2.4.0, the HTML content in your tables is escaped by default. You can change this by passing `allow_html=True`.

docs/options/order.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ import itables
2525
2626
itables.init_notebook_mode()
2727
28-
sorted_df = pd.DataFrame({"i": [1, 2], "a": [2, 1]}).set_index(["i"])
28+
sorted_df = pd.DataFrame({"a": [2, 1]}, index=pd.Index([1, 2], name="i"))
2929
itables.show(sorted_df, order=[[1, "asc"]])
3030
```

docs/options/row_group.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ kernelspec:
1212
name: itables
1313
---
1414

15+
```{code-cell} ipython3
16+
:tags: [remove-cell]
17+
18+
# pyright: reportUnknownMemberType=false
19+
```
20+
1521
# RowGroup
1622

1723
Use the [RowGroup](https://datatables.net/extensions/rowgroup/) extension to group

docs/pandas_style.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ kernelspec:
1616
:tags: [remove-cell]
1717
1818
# pyright: reportUnusedExpression=false
19+
# pyright: reportUnknownMemberType=false
1920
```
2021

2122
# Pandas Style

docs/polars_dataframes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ dataframes are displayed nicely with the default `itables` settings.
2020
```{code-cell} ipython3
2121
import itables
2222
23-
dict_of_test_dfs = itables.sample_dfs.get_dict_of_test_dfs(polars=True)
23+
dict_of_test_dfs = itables.sample_dfs.get_dict_of_polars_test_dfs()
2424
itables.init_notebook_mode()
2525
```
2626

0 commit comments

Comments
 (0)