nuno-faria commented on code in PR #26007:
URL: https://github.com/apache/datafusion/pull/26007#discussion_r4174291709


##########
dev/update_datafusion_versions.py:
##########
@@ -64,47 +41,15 @@ def update_workspace_version(new_version: str):
 
     doc = tomlkit.parse(data)
 
-    for crate in crates.keys():
-        df_dep = doc.get('workspace').get('dependencies', {}).get(crate)
+    for crate, df_dep in doc['workspace']['dependencies'].items():
+        if not crate.startswith('datafusion'):
+            continue
         # skip crates that pin datafusion using git hash
         if df_dep is not None and df_dep.get('version') is not None:
             print(f'updating {crate} dependency in {cargo_toml}')
             df_dep['version'] = new_version
 
-    with open(cargo_toml, 'w') as f:
-        f.write(tomlkit.dumps(doc))
-
-
-def update_datafusion_version(cargo_toml: str, new_version: str):
-    print(f'updating {cargo_toml}')
-    with open(cargo_toml) as f:
-        data = f.read()
-
-    doc = tomlkit.parse(data)
-    pkg = doc.get('package')
-    if 'workspace' not in pkg['version']:
-        pkg['version'] = new_version
-
-    with open(cargo_toml, 'w') as f:
-        f.write(tomlkit.dumps(doc))
-
-def update_downstream_versions(cargo_toml: str, new_version: str):
-    with open(cargo_toml) as f:
-        data = f.read()
-
-    doc = tomlkit.parse(data)
-
-    for crate in crates.keys():
-        df_dep = doc.get('dependencies', {}).get(crate)
-        # skip crates that pin datafusion using git hash
-        if df_dep is not None and df_dep.get('version') is not None:
-            print(f'updating {crate} dependency in {cargo_toml}')
-            df_dep['version'] = new_version
-
-        df_dep = doc.get('dev-dependencies', {}).get(crate)
-        if df_dep is not None and df_dep.get('version') is not None:
-            print(f'updating {crate} dev-dependency in {cargo_toml}')
-            df_dep['version'] = new_version

Review Comment:
   The subcrates use the workspace version directly, so this is not needed 
anymore.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to