Apache DataFusion SQL Query Engine
docs: Automatically update DataFusion version in docs (#20001)
Nuno Faria92f60ad51371
diff --git a/dev/update_datafusion_versions.py b/dev/update_datafusion_versions.pyindex cf72e5a415..df1aeb8d53 100755--- a/dev/update_datafusion_versions.py+++ b/dev/update_datafusion_versions.py@@ -48,7 +48,6 @@ crates = {'datafusion-benchmarks': 'benchmarks/Cargo.toml','datafusion-cli': 'datafusion-cli/Cargo.toml','datafusion-examples': 'datafusion-examples/Cargo.toml',- 'datafusion-docs': 'docs/Cargo.toml',}def update_workspace_version(new_version: str):@@ -116,7 +115,9 @@ def update_docs(path: str, new_version: str):with open(path, 'r+') as fd:content = fd.read()fd.seek(0)- content = re.sub(r'datafusion = "(.+)"', f'datafusion = "{new_version}"', content)+ content = re.sub(r'datafusion\s*=\s*"(.+?)"', f'datafusion = "{new_version}"', content)+ content = re.sub(r'datafusion\s*=\s*\{\s*version\s*=\s*"(.+?)"', f'datafusion = {{ version = "{new_version}"', content)+ fd.truncate()fd.write(content)@@ -144,6 +145,9 @@ def main():update_downstream_versions(cargo_toml, new_version)update_docs("README.md", new_version)+ update_docs("docs/source/download.md", new_version)+ update_docs("docs/source/user-guide/example-usage.md", new_version)+ update_docs("docs/source/user-guide/crate-configuration.md", new_version)if __name__ == "__main__":diff --git a/docs/source/download.md b/docs/source/download.mdindex 7a62e398c0..e358f39940 100644--- a/docs/source/download.md+++ b/docs/source/download.md@@ -26,7 +26,7 @@ For example:```toml[dependencies]-datafusion = "41.0.0"+datafusion = "52.0.0"```While DataFusion is distributed via [crates.io] as a convenience, thediff --git a/docs/source/user-guide/crate-configuration.md b/docs/source/user-guide/crate-configuration.mdindex 87c8ecfebc..14827a8c2c 100644--- a/docs/source/user-guide/crate-configuration.md+++ b/docs/source/user-guide/crate-configuration.md@@ -156,7 +156,7 @@ By default, Datafusion returns errors as a plain text message. You can enable mosuch as backtraces by enabling the `backtrace` feature to your `Cargo.toml` file like this:```toml-datafusion = { version = "31.0.0", features = ["backtrace"]}+datafusion = { version = "52.0.0", features = ["backtrace"]}```Set environment [variables](https://doc.rust-lang.org/std/backtrace/index.html#environment-variables)diff --git a/docs/source/user-guide/example-usage.md b/docs/source/user-guide/example-usage.mdindex 34feec5238..46006c6224 100644--- a/docs/source/user-guide/example-usage.md+++ b/docs/source/user-guide/example-usage.md@@ -29,7 +29,7 @@ Find latest available Datafusion version on [DataFusion'scrates.io] page. Add the dependency to your `Cargo.toml` file:```toml-datafusion = "latest_version"+datafusion = "52.0.0"tokio = { version = "1.0", features = ["rt-multi-thread"] }```