Skip to content

Commit

Permalink
Add blackdoc doctest formatter; closes: #1930 (#1934)
Browse files Browse the repository at this point in the history
  • Loading branch information
ghuls committed Nov 30, 2021
1 parent b15e462 commit d4c9e26
Show file tree
Hide file tree
Showing 12 changed files with 773 additions and 580 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
pip install -r py-polars/build.requirements.txt
- name: Run formatting checks
run: |
cd py-polars && black --check . && isort --check . && rustup override set nightly-2021-10-21 && cargo fmt --all -- --check && cd ..
cd py-polars && black --check . && blackdoc --check . && isort --check . && rustup override set nightly-2021-10-21 && cargo fmt --all -- --check && cd ..
- name: Run linting
run: |
cd py-polars && flake8 && cd ..
Expand Down
1 change: 1 addition & 0 deletions py-polars/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ SHELL=/bin/bash
pre-commit:
isort .
black .
blackdoc .
mypy
flake8 .
make -C .. fmt_toml
Expand Down
1 change: 1 addition & 0 deletions py-polars/build.requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ maturin==0.12.1
pytest==6.2.5
pytest-cov[toml]==3.0.0
black==21.6b0
blackdoc==0.3.4
isort~=5.9.2
mypy==0.910
ghp-import==2.0.1
Expand Down
10 changes: 5 additions & 5 deletions py-polars/polars/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def from_dict(
Examples
--------
>>> data = {'a': [1, 2], 'b': [3, 4]}
>>> data = {"a": [1, 2], "b": [3, 4]}
>>> df = pl.from_dict(data)
>>> df
shape: (2, 2)
Expand Down Expand Up @@ -86,7 +86,7 @@ def from_records(
--------
>>> data = [[1, 2, 3], [4, 5, 6]]
>>> df = pl.from_records(data, columns=['a', 'b'])
>>> df = pl.from_records(data, columns=["a", "b"])
>>> df
shape: (3, 2)
╭─────┬─────╮
Expand Down Expand Up @@ -162,7 +162,7 @@ def from_arrow(
--------
Constructing a DataFrame from an Arrow Table:
>>> data = pa.table({'a': [1, 2, 3], 'b': [4, 5, 6]})
>>> data = pa.table({"a": [1, 2, 3], "b": [4, 5, 6]})
>>> df = pl.from_arrow(data)
>>> df
shape: (3, 2)
Expand Down Expand Up @@ -230,7 +230,7 @@ def from_pandas(
--------
Constructing a DataFrame from a pandas DataFrame:
>>> pd_df = pd.DataFrame([[1, 2, 3], [4, 5, 6]], columns=['a', 'b', 'c'])
>>> pd_df = pd.DataFrame([[1, 2, 3], [4, 5, 6]], columns=["a", "b", "c"])
>>> df = pl.from_pandas(pd_df)
>>> df
shape: (2, 3)
Expand All @@ -246,7 +246,7 @@ def from_pandas(
Constructing a Series from a pandas Series:
>>> pd_series = pd.Series([1,2,3], name='pd')
>>> pd_series = pd.Series([1, 2, 3], name="pd")
>>> df = pl.from_pandas(pd_series)
>>> df
shape: (3,)
Expand Down

0 comments on commit d4c9e26

Please sign in to comment.