You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ho...@apache.org on 2021/08/13 00:07:05 UTC

[arrow-datafusion] branch master updated: automation to help update datafusion version in ballista dep (#865)

This is an automated email from the ASF dual-hosted git repository.

houqp pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git


The following commit(s) were added to refs/heads/master by this push:
     new 26c594f  automation to help update datafusion version in ballista dep (#865)
26c594f is described below

commit 26c594f88d67faec03822184e38819f411d9d76c
Author: QP Hou <qp...@scribd.com>
AuthorDate: Thu Aug 12 17:06:58 2021 -0700

    automation to help update datafusion version in ballista dep (#865)
---
 dev/update_ballista_versions.py | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/dev/update_ballista_versions.py b/dev/update_ballista_versions.py
index cb75a9a..4fa2fc7 100755
--- a/dev/update_ballista_versions.py
+++ b/dev/update_ballista_versions.py
@@ -28,7 +28,7 @@ from pathlib import Path
 import tomlkit
 
 
-def update_cargo_toml(cargo_toml: str, new_version: str):
+def update_cargo_toml(cargo_toml: str, new_version: str, datafusion_version: str):
     print(f'updating {cargo_toml}')
     with open(cargo_toml) as f:
         data = f.read()
@@ -36,6 +36,10 @@ def update_cargo_toml(cargo_toml: str, new_version: str):
     doc = tomlkit.parse(data)
     doc.get('package')['version'] = new_version
 
+    df_dep = doc.get('dependencies').get('datafusion')
+    if df_dep is not None:
+        df_dep['version'] = datafusion_version
+
     with open(cargo_toml, 'w') as f:
         f.write(tomlkit.dumps(doc))
 
@@ -43,6 +47,7 @@ def update_cargo_toml(cargo_toml: str, new_version: str):
 def main():
     parser = argparse.ArgumentParser(description='Update ballista crate versions.')
     parser.add_argument('new_version', type=str, help='new ballista version')
+    parser.add_argument('datafusion_version', type=str, help='new datafusion version')
     args = parser.parse_args()
 
     repo_root = Path(__file__).parent.parent.absolute()
@@ -57,11 +62,13 @@ def main():
         ]
     ])
     new_version = args.new_version
+    datafusion_version = args.datafusion_version
 
-    print(f'Updating ballista versions in {repo_root} to {new_version}')
+    print(f'Updating ballista versions in {repo_root} to {new_version} '
+          f'and datafusion dep version to {datafusion_version}')
 
     for cargo_toml in ballista_crates:
-        update_cargo_toml(cargo_toml, new_version)
+        update_cargo_toml(cargo_toml, new_version, datafusion_version)
 
 
 if __name__ == "__main__":