andreachild commented on code in PR #3231:
URL: https://github.com/apache/tinkerpop/pull/3231#discussion_r2414353032
##########
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:
I had another thought - ideally these examples stay in sync with the root
level examples as much as possible so to achieve this we could:
1. extract the label used for the examples into a variable which by default
is `person` but can be overridden by environment variable set in the docker
config (similar to how the URL is set)
2. do not add dropping of the added nodes at the end of the example (unless
the original example had done so) - since we are using an isolated node label
for the development examples and the examples are executed after the
integration tests and do not assert any counts it should be OK to not clean up
the data
--
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]