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

chore: Update links to API references #16843

Merged
merged 3 commits into from
Jun 10, 2024
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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ body:
label: Link
description: >
Provide a link to the existing documentation, if applicable.
placeholder: ex. https://docs.pola.rs/docs/python/dev/...
placeholder: ex. https://docs.pola.rs/api/python/dev/...
validations:
required: false
7 changes: 3 additions & 4 deletions .github/workflows/docs-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: py-polars/docs/build/html
target-folder: docs/python/dev
target-folder: api/python/dev
single-commit: true

- name: Parse the tag to find the major/minor version of Polars
Expand All @@ -74,14 +74,13 @@ jobs:
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: py-polars/docs/build/html
target-folder: docs/python/version/${{ steps.version.outputs.version }}
target-folder: api/python/version/${{ steps.version.outputs.version }}
single-commit: true

- name: Deploy Python docs for latest release version - stable
if: github.event_name == 'repository_dispatch'
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: py-polars/docs/build/html
# Keeping this folder for backwards compatibility
target-folder: py-polars/html
target-folder: api/python/stable
single-commit: true
2 changes: 1 addition & 1 deletion .github/workflows/docs-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: target/doc
target-folder: docs/rust/dev
target-folder: api/rust/dev
single-commit: true

# Make sure documentation artifacts are not cached
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<p align="center">
<b>Documentation</b>:
<a href="https://docs.pola.rs/py-polars/html/reference/index.html">Python</a>
<a href="https://docs.pola.rs/api/python/stable/reference/index.html">Python</a>
-
<a href="https://docs.rs/polars/latest/polars/">Rust</a>
-
Expand Down
410 changes: 205 additions & 205 deletions docs/_build/API_REFERENCE_LINKS.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ It's the best place to look if you need information on a specific function.
## Python

The Python API reference is built using Sphinx.
It's available in [our docs](https://docs.pola.rs/py-polars/html/reference/index.html).
It's available in [our docs](https://docs.pola.rs/api/python/stable/reference/index.html).

## Rust

Expand Down
2 changes: 1 addition & 1 deletion docs/development/contributing/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ Before committing, install `dprint` (see above) and run `dprint fmt` from the `d

### API reference

Polars has separate API references for [Rust](https://docs.pola.rs/docs/rust/dev/polars/) and [Python](https://docs.pola.rs/docs/python/dev/reference/index.html).
Polars has separate API references for [Rust](https://docs.pola.rs/api/rust/dev/polars/) and [Python](https://docs.pola.rs/api/python/dev/reference/index.html).
These are generated directly from the codebase, so in order to contribute, you will have to follow the steps outlined in [this section](#contributing-to-the-codebase) above.

#### Rust
Expand Down
2 changes: 1 addition & 1 deletion docs/development/versioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ We know it takes time and energy for our users to keep up with new releases but,

**A breaking change occurs when an existing component of the public API is changed or removed.**

A feature is part of the public API if it is documented in the [API reference](https://docs.pola.rs/py-polars/html/reference/index.html).
A feature is part of the public API if it is documented in the [API reference](https://docs.pola.rs/api/python/stable/reference/index.html).

Examples of breaking changes:

Expand Down
6 changes: 3 additions & 3 deletions docs/user-guide/expressions/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ You can change the output name of an expression by using the `alias` function
In case of multiple columns for example when using `all()` or `col(*)` you can apply a mapping function `name.map` to change the original column name into something else. In case you want to add a suffix (`name.suffix()`) or prefix (`name.prefix()`) these are also built in.

=== ":fontawesome-brands-python: Python"
[:material-api: `name.prefix`](https://docs.pola.rs/py-polars/html/reference/expressions/api/polars.Expr.name.prefix.html)
[:material-api: `name.suffix`](https://docs.pola.rs/py-polars/html/reference/expressions/api/polars.Expr.name.suffix.html)
[:material-api: `name.map`](https://docs.pola.rs/py-polars/html/reference/expressions/api/polars.Expr.name.map.html)
[:material-api: `name.prefix`](https://docs.pola.rs/api/python/stable/reference/expressions/api/polars.Expr.name.prefix.html)
[:material-api: `name.suffix`](https://docs.pola.rs/api/python/stable/reference/expressions/api/polars.Expr.name.suffix.html)
[:material-api: `name.map`](https://docs.pola.rs/api/python/stable/reference/expressions/api/polars.Expr.name.map.html)

## Count unique values

Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/expressions/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ df = pl.DataFrame(
out = df.with_columns(pig_latin=pig_latinnify("convert"))
```

Alternatively, you can [register a custom namespace](https://docs.pola.rs/py-polars/html/reference/api/polars.api.register_expr_namespace.html#polars.api.register_expr_namespace), which enables you to write:
Alternatively, you can [register a custom namespace](https://docs.pola.rs/api/python/stable/reference/api/polars.api.register_expr_namespace.html#polars.api.register_expr_namespace), which enables you to write:

```python
out = df.with_columns(
Expand Down
4 changes: 2 additions & 2 deletions docs/user-guide/expressions/user-defined-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Use cases for `map_batches` are for instance passing the `Series` in an expressi
we could use `map_batches` to pass an expression column to a neural network model.

=== ":fontawesome-brands-python: Python"
[:material-api: `map_batches`](https://docs.pola.rs/py-polars/html/reference/expressions/api/polars.Expr.map_batches.html)
[:material-api: `map_batches`](https://docs.pola.rs/api/python/stable/reference/expressions/api/polars.Expr.map_batches.html)

```python
df.with_columns([
Expand Down Expand Up @@ -90,7 +90,7 @@ That is:
So with `map_elements` we should be able to fix our example:

=== ":fontawesome-brands-python: Python"
[:material-api: `map_elements`](https://docs.pola.rs/py-polars/html/reference/expressions/api/polars.Expr.map_elements.html)
[:material-api: `map_elements`](https://docs.pola.rs/api/python/stable/reference/expressions/api/polars.Expr.map_elements.html)

{{code_block('user-guide/expressions/user-defined-functions','map_elements',[])}}

Expand Down
8 changes: 4 additions & 4 deletions py-polars/docs/source/_static/version_switcher.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
{
"name": "dev",
"version": "dev",
"url": "https://docs.pola.rs/docs/python/dev/"
"url": "https://docs.pola.rs/api/python/dev/"
},
{
"name": "0.20 (stable)",
"version": "0.20",
"url": "https://docs.pola.rs/py-polars/html/",
"url": "https://docs.pola.rs/api/python/stable/",
"preferred": true
},
{
"name": "0.19",
"version": "0.19",
"url": "https://docs.pola.rs/docs/python/version/0.19/"
"url": "https://docs.pola.rs/api/python/version/0.19/"
},
{
"name": "0.18",
"version": "0.18",
"url": "https://docs.pola.rs/docs/python/version/0.18/"
"url": "https://docs.pola.rs/api/python/version/0.18/"
}
]
2 changes: 1 addition & 1 deletion py-polars/docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
"image_dark": f"{static_assets_root}/logos/polars-logo-dimmed-medium.png",
},
"switcher": {
"json_url": f"{web_root}/docs/python/dev/_static/version_switcher.json",
"json_url": f"{web_root}/api/python/dev/_static/version_switcher.json",
"version_match": switcher_version,
},
"show_version_warning_banner": False,
Expand Down
2 changes: 1 addition & 1 deletion py-polars/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ classifiers = [

[project.urls]
Homepage = "https://www.pola.rs/"
Documentation = "https://docs.pola.rs/py-polars/html/reference/index.html"
Documentation = "https://docs.pola.rs/api/python/stable/reference/index.html"
Repository = "https://github.com/pola-rs/polars"
Changelog = "https://github.com/pola-rs/polars/releases"

Expand Down