From 36d7a62393acf77fe5de084a5a067b3cd063d370 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodrigo=20Gir=C3=A3o=20Serr=C3=A3o?= <5621605+rodrigogiraoserrao@users.noreply.github.com> Date: Mon, 16 Sep 2024 15:14:18 +0100 Subject: [PATCH] docs: Fix external links and formatting --- docs/docs/_build/scripts/macro.py | 10 +++++++--- docs/docs/_build/scripts/people.py | 4 ++-- docs/docs/development/contributing/ide.md | 2 +- .../src/python/user-guide/io/hugging-face.py | 16 ++++------------ .../getting-started/reading-writing.rs | 3 ++- docs/docs/user-guide/ecosystem.md | 2 +- docs/docs/user-guide/io/hugging-face.md | 16 ++++++++-------- docs/docs/user-guide/misc/comparison.md | 2 +- mkdocs.yml | 1 - 9 files changed, 26 insertions(+), 30 deletions(-) diff --git a/docs/docs/_build/scripts/macro.py b/docs/docs/_build/scripts/macro.py index d2cf8469d5e0..605d005005eb 100644 --- a/docs/docs/_build/scripts/macro.py +++ b/docs/docs/_build/scripts/macro.py @@ -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) @@ -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"] @@ -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']}\" diff --git a/docs/docs/_build/scripts/people.py b/docs/docs/_build/scripts/people.py index 13390b67bb81..12a86850cacb 100644 --- a/docs/docs/_build/scripts/people.py +++ b/docs/docs/_build/scripts/people.py @@ -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) diff --git a/docs/docs/development/contributing/ide.md b/docs/docs/development/contributing/ide.md index e5c10e523647..562216e9ff5e 100644 --- a/docs/docs/development/contributing/ide.md +++ b/docs/docs/development/contributing/ide.md @@ -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.
launch.json diff --git a/docs/docs/src/python/user-guide/io/hugging-face.py b/docs/docs/src/python/user-guide/io/hugging-face.py index 0b7631e359e1..cb7d21583682 100644 --- a/docs/docs/src/python/user-guide/io/hugging-face.py +++ b/docs/docs/src/python/user-guide/io/hugging-face.py @@ -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] @@ -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] @@ -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] diff --git a/docs/docs/src/rust/user-guide/getting-started/reading-writing.rs b/docs/docs/src/rust/user-guide/getting-started/reading-writing.rs index d916f77300a5..bb82b2b02407 100644 --- a/docs/docs/src/rust/user-guide/getting-started/reading-writing.rs +++ b/docs/docs/src/rust/user-guide/getting-started/reading-writing.rs @@ -60,7 +60,8 @@ fn main() -> Result<(), Box> { // --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()?; diff --git a/docs/docs/user-guide/ecosystem.md b/docs/docs/user-guide/ecosystem.md index f1b203705480..21f1dbc2ba60 100644 --- a/docs/docs/user-guide/ecosystem.md +++ b/docs/docs/user-guide/ecosystem.md @@ -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 diff --git a/docs/docs/user-guide/io/hugging-face.md b/docs/docs/user-guide/io/hugging-face.md index 5a563db893d8..16f705ae75fb 100644 --- a/docs/docs/user-guide/io/hugging-face.md +++ b/docs/docs/user-guide/io/hugging-face.md @@ -25,10 +25,10 @@ Example `hf://` paths: | Path | Path components | | ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| hf://datasets/nameexhaustion/polars-docs/docs/iris.csv | Bucket: datasets
Repository: nameexhaustion/polars-docs
Branch: main
Path: iris.csv
[Web URL](https://huggingface.co/datasets/nameexhaustion/polars-docs/docs/tree/main/) | -| hf://datasets/nameexhaustion/polars-docs@foods/\*.csv | Bucket: datasets
Repository: nameexhaustion/polars-docs
Branch: foods
Path: \*.csv
[Web URL](https://huggingface.co/datasets/nameexhaustion/polars-docs/docs/tree/foods/) | -| hf://datasets/nameexhaustion/polars-docs/docs/hive_dates/ | Bucket: datasets
Repository: nameexhaustion/polars-docs
Branch: main
Path: hive_dates/
[Web URL](https://huggingface.co/datasets/nameexhaustion/polars-docs/docs/tree/main/hive_dates/) | -| hf://spaces/nameexhaustion/polars-docs/docs/orders.feather | Bucket: spaces
Repository: nameexhaustion/polars-docs
Branch: main
Path: orders.feather
[Web URL](https://huggingface.co/spaces/nameexhaustion/polars-docs/docs/tree/main/) | +| hf://datasets/nameexhaustion/polars-docs/iris.csv | Bucket: datasets
Repository: nameexhaustion/polars-docs
Branch: main
Path: iris.csv
[Web URL](https://huggingface.co/datasets/nameexhaustion/polars-docs/tree/main/) | +| hf://datasets/nameexhaustion/polars-docs@foods/\*.csv | Bucket: datasets
Repository: nameexhaustion/polars-docs
Branch: foods
Path: \*.csv
[Web URL](https://huggingface.co/datasets/nameexhaustion/polars-docs/tree/foods/) | +| hf://datasets/nameexhaustion/polars-docs/hive_dates/ | Bucket: datasets
Repository: nameexhaustion/polars-docs
Branch: main
Path: hive_dates/
[Web URL](https://huggingface.co/datasets/nameexhaustion/polars-docs/tree/main/hive_dates/) | +| hf://spaces/nameexhaustion/polars-docs/orders.feather | Bucket: spaces
Repository: nameexhaustion/polars-docs
Branch: main
Path: orders.feather
[Web URL](https://huggingface.co/spaces/nameexhaustion/polars-docs/tree/main/) | ### Authentication @@ -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 @@ -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 @@ -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 @@ -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) diff --git a/docs/docs/user-guide/misc/comparison.md b/docs/docs/user-guide/misc/comparison.md index 79e6123e05c0..3ae31fe0077d 100644 --- a/docs/docs/user-guide/misc/comparison.md +++ b/docs/docs/user-guide/misc/comparison.md @@ -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). diff --git a/mkdocs.yml b/mkdocs.yml index dabd7351201a..ed1860f9f802 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -144,7 +144,6 @@ theme: - navigation.footer - navigation.indexes - content.tabs.link - - content.code.copy icon: repo: fontawesome/brands/github