andreachild commented on code in PR #3231:
URL: https://github.com/apache/tinkerpop/pull/3231#discussion_r2411733199
##########
gremlin-python/src/main/python/examples/basic_gremlin.py:
##########
@@ -25,28 +26,33 @@
def main():
- rc = DriverRemoteConnection('ws://localhost:8182/gremlin', 'g')
+ # if there is a port placeholder in the env var then we are running with
docker so set appropriate port
+ server_url = os.getenv('GREMLIN_SERVER_URL',
'ws://localhost:8182/gremlin').format(45940)
+ rc = DriverRemoteConnection(server_url, 'g')
g = traversal().with_remote(rc)
# basic Gremlin: adding and retrieving data
- v1 = g.add_v('person').property('name', 'marko').next()
- v2 = g.add_v('person').property('name', 'stephen').next()
- v3 = g.add_v('person').property('name', 'vadas').next()
+ v1 = g.add_v('person-py-ex').property('name', 'marko').next()
Review Comment:
Suggest to extract the label name to a constant so that it can be easily
changed in one line instead of multiple
--
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]