Skip to content

Commit

Permalink
docs: Fix external links and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigogiraoserrao committed Sep 20, 2024
1 parent cd12eec commit 36d7a62
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 30 deletions.
10 changes: 7 additions & 3 deletions docs/docs/_build/scripts/macro.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
)

# Load all links to reference docs
with open("docs/docs/_build//API_REFERENCE_LINKS.yml", "r") as f:
with open("docs/docs/_build/API_REFERENCE_LINKS.yml", "r") as f:
API_REFERENCE_LINKS = yaml.load(f, Loader=yaml.CLoader)


Expand Down Expand Up @@ -132,7 +132,9 @@ def code_tab(

def define_env(env):
@env.macro
def code_header(language: str, section: str = [], api_functions: List[str] = []) -> str:
def code_header(
language: str, section: str = [], api_functions: List[str] = []
) -> str:
language_info = LANGUAGES[language]

language = language_info["code_name"]
Expand All @@ -142,7 +144,9 @@ def code_header(language: str, section: str = [], api_functions: List[str] = [])

# Create API Links if they are defined in the YAML
api_functions = [
link for f in api_functions if (link := create_api_function_link(language, f))
link
for f in api_functions
if (link := create_api_function_link(language, f))
]
language_headers = " ·".join(api_functions + feature_flags_links)
return f"""=== \":fontawesome-brands-{language_info['icon_name']}: {language_info['display_name']}\"
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/_build/scripts/people.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ def get_people_md():


def on_startup(command, dirty):
"""Mkdocs hook to autogenerate docs/docs/people.md on startup"""
"""Mkdocs hook to autogenerate docs/docs-res/people.md on startup"""
try:
get_people_md()
except Exception as e:
msg = f"WARNING:{__file__}: Could not generate docs/docs/people.md. Got error: {str(e)}"
msg = f"WARNING:{__file__}: Could not generate docs/docs-res/people.md. Got error: {str(e)}"
print(msg)


Expand Down
2 changes: 1 addition & 1 deletion docs/docs/development/contributing/ide.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ This guide shows how to set up a debugging environment that makes debugging Rust
Start by installing the CodeLLDB extension (see above).
Then add the following two configurations to your `launch.json` file.
This file is usually found in the `.vscode` folder of your project root.
See the [official VSCode documentation](https://code.visualstudio.com/docs/docs/editor/debugging#_launch-configurations) for more information about the `launch.json` file.
See the [official VSCode documentation](https://code.visualstudio.com/docs/editor/debugging#_launch-configurations) for more information about the `launch.json` file.

<details><summary><code><b>launch.json</b></code></summary>

Expand Down
16 changes: 4 additions & 12 deletions docs/docs/src/python/user-guide/io/hugging-face.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@
# --8<-- [end:setup]

# --8<-- [start:scan_iris_csv]
print(pl.scan_csv("hf://datasets/nameexhaustion/polars-docs/docs/iris.csv").collect())
print(pl.scan_csv("hf://datasets/nameexhaustion/polars-docs/iris.csv").collect())
# --8<-- [end:scan_iris_csv]

# --8<-- [start:scan_iris_ndjson]
print(
pl.scan_ndjson("hf://datasets/nameexhaustion/polars-docs/docs/iris.jsonl").collect()
)
print(pl.scan_ndjson("hf://datasets/nameexhaustion/polars-docs/iris.jsonl").collect())
# --8<-- [end:scan_iris_ndjson]

# --8<-- [start:scan_iris_repr]
Expand Down Expand Up @@ -39,11 +37,7 @@
# --8<-- [end:scan_iris_repr]

# --8<-- [start:scan_parquet_hive]
print(
pl.scan_parquet(
"hf://datasets/nameexhaustion/polars-docs/docs/hive_dates/"
).collect()
)
print(pl.scan_parquet("hf://datasets/nameexhaustion/polars-docs/hive_dates/").collect())
# --8<-- [end:scan_parquet_hive]

# --8<-- [start:scan_parquet_hive_repr]
Expand All @@ -65,9 +59,7 @@
# --8<-- [end:scan_parquet_hive_repr]

# --8<-- [start:scan_ipc]
print(
pl.scan_ipc("hf://spaces/nameexhaustion/polars-docs/docs/orders.feather").collect()
)
print(pl.scan_ipc("hf://spaces/nameexhaustion/polars-docs/orders.feather").collect())
# --8<-- [end:scan_ipc]

# --8<-- [start:scan_ipc_repr]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
// --8<-- [end:json]

// --8<-- [start:parquet]
let mut file = File::create("docs/docs-res/data/output.parquet").expect("could not create file");
let mut file =
File::create("docs/docs-res/data/output.parquet").expect("could not create file");
ParquetWriter::new(&mut file).finish(&mut df)?;
let f = File::open("docs/docs-res/data/output.parquet")?;
let df_parquet = ParquetReader::new(f).finish()?;
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/user-guide/ecosystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Since [Scikit Learn](https://scikit-learn.org/stable/) 1.4, all transformers sup

#### DuckDB

[DuckDB](https://duckdb.org) is a high-performance analytical database system. It is designed to be fast, reliable, portable, and easy to use. DuckDB provides a rich SQL dialect, with support far beyond basic SQL. DuckDB supports arbitrary and nested correlated subqueries, window functions, collations, complex types (arrays, structs), and more. Read about integration with Polars [on the DuckDB website](https://duckdb.org/docs/docs/guides/python/polars).
[DuckDB](https://duckdb.org) is a high-performance analytical database system. It is designed to be fast, reliable, portable, and easy to use. DuckDB provides a rich SQL dialect, with support far beyond basic SQL. DuckDB supports arbitrary and nested correlated subqueries, window functions, collations, complex types (arrays, structs), and more. Read about integration with Polars [on the DuckDB website](https://duckdb.org/docs/guides/python/polars).

#### Great Tables

Expand Down
16 changes: 8 additions & 8 deletions docs/docs/user-guide/io/hugging-face.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ Example `hf://` paths:

| Path | Path components |
| ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| hf://datasets/nameexhaustion/polars-docs/docs/iris.csv | Bucket: datasets<br>Repository: nameexhaustion/polars-docs<br>Branch: main<br>Path: iris.csv<br> [Web URL](https://huggingface.co/datasets/nameexhaustion/polars-docs/docs/tree/main/) |
| hf://datasets/nameexhaustion/polars-docs@foods/\*.csv | Bucket: datasets<br>Repository: nameexhaustion/polars-docs<br>Branch: foods<br>Path: \*.csv<br> [Web URL](https://huggingface.co/datasets/nameexhaustion/polars-docs/docs/tree/foods/) |
| hf://datasets/nameexhaustion/polars-docs/docs/hive_dates/ | Bucket: datasets<br>Repository: nameexhaustion/polars-docs<br>Branch: main<br>Path: hive_dates/<br> [Web URL](https://huggingface.co/datasets/nameexhaustion/polars-docs/docs/tree/main/hive_dates/) |
| hf://spaces/nameexhaustion/polars-docs/docs/orders.feather | Bucket: spaces<br>Repository: nameexhaustion/polars-docs<br>Branch: main<br>Path: orders.feather<br> [Web URL](https://huggingface.co/spaces/nameexhaustion/polars-docs/docs/tree/main/) |
| hf://datasets/nameexhaustion/polars-docs/iris.csv | Bucket: datasets<br>Repository: nameexhaustion/polars-docs<br>Branch: main<br>Path: iris.csv<br> [Web URL](https://huggingface.co/datasets/nameexhaustion/polars-docs/tree/main/) |
| hf://datasets/nameexhaustion/polars-docs@foods/\*.csv | Bucket: datasets<br>Repository: nameexhaustion/polars-docs<br>Branch: foods<br>Path: \*.csv<br> [Web URL](https://huggingface.co/datasets/nameexhaustion/polars-docs/tree/foods/) |
| hf://datasets/nameexhaustion/polars-docs/hive_dates/ | Bucket: datasets<br>Repository: nameexhaustion/polars-docs<br>Branch: main<br>Path: hive_dates/<br> [Web URL](https://huggingface.co/datasets/nameexhaustion/polars-docs/tree/main/hive_dates/) |
| hf://spaces/nameexhaustion/polars-docs/orders.feather | Bucket: spaces<br>Repository: nameexhaustion/polars-docs<br>Branch: main<br>Path: orders.feather<br> [Web URL](https://huggingface.co/spaces/nameexhaustion/polars-docs/tree/main/) |

### Authentication

Expand All @@ -51,7 +51,7 @@ A Hugging Face API key can be passed to Polars to access private locations using
--8<-- "python/user-guide/io/hugging-face.py:scan_iris_repr"
```

See this file at [https://huggingface.co/datasets/nameexhaustion/polars-docs/docs/blob/main/iris.csv](https://huggingface.co/datasets/nameexhaustion/polars-docs/docs/blob/main/iris.csv)
See this file at [https://huggingface.co/datasets/nameexhaustion/polars-docs/blob/main/iris.csv](https://huggingface.co/datasets/nameexhaustion/polars-docs/blob/main/iris.csv)

#### NDJSON

Expand All @@ -61,7 +61,7 @@ See this file at [https://huggingface.co/datasets/nameexhaustion/polars-docs/doc
--8<-- "python/user-guide/io/hugging-face.py:scan_iris_repr"
```

See this file at [https://huggingface.co/datasets/nameexhaustion/polars-docs/docs/blob/main/iris.jsonl](https://huggingface.co/datasets/nameexhaustion/polars-docs/docs/blob/main/iris.jsonl)
See this file at [https://huggingface.co/datasets/nameexhaustion/polars-docs/blob/main/iris.jsonl](https://huggingface.co/datasets/nameexhaustion/polars-docs/blob/main/iris.jsonl)

#### Parquet

Expand All @@ -71,7 +71,7 @@ See this file at [https://huggingface.co/datasets/nameexhaustion/polars-docs/doc
--8<-- "python/user-guide/io/hugging-face.py:scan_parquet_hive_repr"
```

See this folder at [https://huggingface.co/datasets/nameexhaustion/polars-docs/docs/tree/main/hive_dates/](https://huggingface.co/datasets/nameexhaustion/polars-docs/docs/tree/main/hive_dates/)
See this folder at [https://huggingface.co/datasets/nameexhaustion/polars-docs/tree/main/hive_dates/](https://huggingface.co/datasets/nameexhaustion/polars-docs/tree/main/hive_dates/)

#### IPC

Expand All @@ -81,4 +81,4 @@ See this folder at [https://huggingface.co/datasets/nameexhaustion/polars-docs/d
--8<-- "python/user-guide/io/hugging-face.py:scan_ipc_repr"
```

See this file at [https://huggingface.co/spaces/nameexhaustion/polars-docs/docs/blob/main/orders.feather](https://huggingface.co/spaces/nameexhaustion/polars-docs/docs/blob/main/orders.feather)
See this file at [https://huggingface.co/spaces/nameexhaustion/polars-docs/blob/main/orders.feather](https://huggingface.co/spaces/nameexhaustion/polars-docs/blob/main/orders.feather)
2 changes: 1 addition & 1 deletion docs/docs/user-guide/misc/comparison.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ The choice between Polars and Spark often depends on the scale of data and the s

### DuckDB

Polars and DuckDB have many similarities. However, DuckDB is focused on providing an in-process SQL OLAP database management system, while Polars is focused on providing a scalable `DataFrame` interface to many languages. The different front-ends lead to different optimisation strategies and different algorithm prioritisation. The interoperability between both is zero-copy. DuckDB offers a guide on [how to integrate with Polars](https://duckdb.org/docs/docs/guides/python/polars.html).
Polars and DuckDB have many similarities. However, DuckDB is focused on providing an in-process SQL OLAP database management system, while Polars is focused on providing a scalable `DataFrame` interface to many languages. The different front-ends lead to different optimisation strategies and different algorithm prioritisation. The interoperability between both is zero-copy. DuckDB offers a guide on [how to integrate with Polars](https://duckdb.org/docs/guides/python/polars.html).
1 change: 0 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ theme:
- navigation.footer
- navigation.indexes
- content.tabs.link
- content.code.copy
icon:
repo: fontawesome/brands/github

Expand Down

0 comments on commit 36d7a62

Please sign in to comment.