Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add CI for docs #1798

Merged
merged 3 commits into from
Nov 4, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
64 changes: 64 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build documentation

on:
pull_request:
paths:
- python/**
- docs/**
- mkdocs.yml
- .github/workflows/docs.yml
jobs:
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
config-file: docs/mlc-config.json
folder-path: docs

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
with:
src: docs/src/python

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy

- uses: Swatinem/rust-cache@v2

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'

- name: Build and install deltalake
run: |
cd python
pip install virtualenv
virtualenv venv
source venv/bin/activate
make develop
cd ..

- name: Install dependencies
run: |
source python/venv/bin/activate
pip install -r docs/requirements.txt

- name: Build documentation
run: |
source python/venv/bin/activate
mkdocs build
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ Cargo.lock
!/proofs/Cargo.lock

justfile
site
site
__pycache__
7 changes: 7 additions & 0 deletions docs/mlc_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"ignorePatterns": [
{
"pattern": "^https://crates.io/"
}
]
}
10 changes: 7 additions & 3 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
mkdocs
mkdocstrings[python]
mkdocs-autorefs
mkdocs==1.5.3
mkdocstrings[python]==0.23.0
mkdocs-autorefs==0.5.0
mkdocs-material==9.4.5
mkdocs-macros-plugin==1.0.4
markdown-exec[ansi]==1.7.0
mkdocs-simple-hooks==0.1.5
2 changes: 1 addition & 1 deletion docs/src/python/delta_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ def get_table_info():
dt = DeltaTable("../rust/tests/data/delta-0.2.0")
print(f"Version: {dt.version()}")
print(f"Files: {dt.files()}")
# --8<-- [end:get_table_info]
# --8<-- [end:get_table_info]
2 changes: 1 addition & 1 deletion docs/usage/querying-delta-tables.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ scanning operation.
```

PyArrow datasets may also be passed to compatible query engines, such as
[DuckDB](https://duckdb.org/docs/api/python).
[DuckDB](https://duckdb.org/docs/api/python/overview.html)

``` python
>>> import duckdb
Expand Down
8 changes: 8 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ nav:
- api/storage.md
not_in_nav: |
/_build/

exclude_docs: |
/_build/
/mlc_config.json
/src
/requirements.txt
*.py

plugins:
- autorefs
- mkdocstrings:
Expand Down
14 changes: 10 additions & 4 deletions python/deltalake/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -835,18 +835,24 @@ def repair(self, dry_run: bool = False) -> Dict[str, Any]:
or corrupted files.

Args:
dry_run(bool): when activated, list only the files, otherwise add remove actions to transaction log. Defaults to False.
dry_run: when activated, list only the files, otherwise add remove actions to transaction log. Defaults to False.
Returns:
The metrics from repair (FSCK) action.

Examples:

>>> from deltalake import DeltaTable
>>> dt = DeltaTable('TEST')
>>> dt.repair(dry_run=False)
```
from deltalake import DeltaTable

dt = DeltaTable('TEST')
dt.repair(dry_run=False)
```
Results in
```
{'dry_run': False,
'files_removed': ['6-0d084325-6885-4847-b008-82c1cf30674c-0.parquet',
'5-4fba1d3e-3e20-4de1-933d-a8e13ac59f53-0.parquet']}
```
"""
metrics = self._table.repair(dry_run)
return json.loads(metrics)
Expand Down
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pyspark = [
]

[project.urls]
documentation = "https://delta-io.github.io/delta-rs/python/"
documentation = "https://delta-io.github.io/delta-rs/"
repository = "https://github.com/delta-io/delta-rs/tree/main/python/"

[tool.mypy]
Expand Down
Loading