Skip to content

Commit 92f60ad

Browse files
nuno-fariamartin-g
andauthored
docs: Automatically update DataFusion version in docs (#20001)
## Which issue does this PR close? - N/A. ## Rationale for this change I was looking at the download page (https://datafusion.apache.org/download.html) when I noticed the version there was not updated in a while. Likewise, there are other places in the docs where the version is not updated. This PR changes the `update_datafusion_versions.py` script to automatically update those files, in addition to the Cargo files. ## What changes are included in this PR? - Updated `update_datafusion_versions.py` to check some doc files. - Updated the doc files to the current major version. ## Are these changes tested? Yes, script runs correctly. ## Are there any user-facing changes? No. --------- Co-authored-by: Martin Grigorov <martin-g@users.noreply.github.com>
1 parent 36c0cda commit 92f60ad

4 files changed

Lines changed: 9 additions & 5 deletions

File tree

dev/update_datafusion_versions.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
'datafusion-benchmarks': 'benchmarks/Cargo.toml',
4949
'datafusion-cli': 'datafusion-cli/Cargo.toml',
5050
'datafusion-examples': 'datafusion-examples/Cargo.toml',
51-
'datafusion-docs': 'docs/Cargo.toml',
5251
}
5352

5453
def update_workspace_version(new_version: str):
@@ -116,7 +115,9 @@ def update_docs(path: str, new_version: str):
116115
with open(path, 'r+') as fd:
117116
content = fd.read()
118117
fd.seek(0)
119-
content = re.sub(r'datafusion = "(.+)"', f'datafusion = "{new_version}"', content)
118+
content = re.sub(r'datafusion\s*=\s*"(.+?)"', f'datafusion = "{new_version}"', content)
119+
content = re.sub(r'datafusion\s*=\s*\{\s*version\s*=\s*"(.+?)"', f'datafusion = {{ version = "{new_version}"', content)
120+
fd.truncate()
120121
fd.write(content)
121122

122123

@@ -144,6 +145,9 @@ def main():
144145
update_downstream_versions(cargo_toml, new_version)
145146

146147
update_docs("README.md", new_version)
148+
update_docs("docs/source/download.md", new_version)
149+
update_docs("docs/source/user-guide/example-usage.md", new_version)
150+
update_docs("docs/source/user-guide/crate-configuration.md", new_version)
147151

148152

149153
if __name__ == "__main__":

docs/source/download.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ For example:
2626

2727
```toml
2828
[dependencies]
29-
datafusion = "41.0.0"
29+
datafusion = "52.0.0"
3030
```
3131

3232
While DataFusion is distributed via [crates.io] as a convenience, the

docs/source/user-guide/crate-configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ By default, Datafusion returns errors as a plain text message. You can enable mo
156156
such as backtraces by enabling the `backtrace` feature to your `Cargo.toml` file like this:
157157

158158
```toml
159-
datafusion = { version = "31.0.0", features = ["backtrace"]}
159+
datafusion = { version = "52.0.0", features = ["backtrace"]}
160160
```
161161

162162
Set environment [variables](https://doc.rust-lang.org/std/backtrace/index.html#environment-variables)

docs/source/user-guide/example-usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Find latest available Datafusion version on [DataFusion's
2929
crates.io] page. Add the dependency to your `Cargo.toml` file:
3030

3131
```toml
32-
datafusion = "latest_version"
32+
datafusion = "52.0.0"
3333
tokio = { version = "1.0", features = ["rt-multi-thread"] }
3434
```
3535

0 commit comments

Comments
 (0)