Skip to content

Commit 172b07c

Browse files
committed
fix(python): correct gremlin labels and robust JVM arg parsing
1 parent 284b529 commit 172b07c

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

bindings/python/examples/02_social_network_graph.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -663,18 +663,18 @@ def demonstrate_opencypher_queries(db):
663663
print(f" 🌐 {name} from {city}")
664664
print(f" ⏱️ Time: {time.time() - query_start:.3f}s")
665665

666-
print(f" ⏱️ OpenCypher section: {time.time() - section_start:.3f}s")
667-
print("\n 💡 OpenCypher features demonstrated:")
668-
print(" • Pattern matching with MATCH")
669-
print(" • Filtering with WHERE")
670-
print(" • DISTINCT for deduplication")
666+
print(f" ⏱️ Gremlin section: {time.time() - section_start:.3f}s")
667+
print("\n 💡 Gremlin features demonstrated:")
668+
print(" • Graph traversal with g.V()")
669+
print(" • Filtering with has() and where()")
670+
print(" • Projections with project() and by()")
671671
print(" • Aggregations with count()")
672-
print(" • Variable-length paths with *1..3")
673-
print(" • Sorting with ORDER BY")
672+
print(" • Variable-length paths with repeat()")
673+
print(" • Sorting with order()")
674674

675675
except Exception as e:
676-
print(f" ❌ Error in OpenCypher queries: {e}")
677-
print(" 💡 Note: OpenCypher support depends on your ArcadeDB build")
676+
print(f" ❌ Error in Gremlin queries: {e}")
677+
print(" 💡 Note: Gremlin support depends on your ArcadeDB build")
678678
import traceback
679679

680680
traceback.print_exc()

bindings/python/src/arcadedb_embedded/jvm.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import glob
88
import os
99
import platform
10+
import shlex
1011
from pathlib import Path
1112
from typing import Iterable, Optional, Union
1213

@@ -184,7 +185,7 @@ def _normalize_jvm_args(jvm_args: Optional[Union[Iterable[str], str]]) -> list[s
184185
if not jvm_args:
185186
return []
186187
if isinstance(jvm_args, str):
187-
return jvm_args.split()
188+
return shlex.split(jvm_args)
188189
return list(jvm_args)
189190

190191

@@ -241,7 +242,7 @@ def _build_jvm_args(
241242
# JVM arguments: start from env, then merge explicit args
242243
jvm_args_str = os.environ.get("ARCADEDB_JVM_ARGS")
243244
if jvm_args_str:
244-
merged_args = jvm_args_str.split()
245+
merged_args = shlex.split(jvm_args_str)
245246
else:
246247
merged_args = []
247248

0 commit comments

Comments
 (0)