GumpacG opened a new pull request, #3520:
URL: https://github.com/apache/tinkerpop/pull/3520
# gremlin-python bug fixes (TinkerPop 4.0.0-beta.1 regressions)
Two bugs introduced in `4.0.0-beta.1` during the Bytecode-to-GremlinLang
migration.
## 1. `GremlinLang.__eq__` ignores the query
File: `gremlin_python/process/traversal.py`
`__eq__` compared `self.gremlin` to itself instead of to `other.gremlin`, so
equality depended only on the parameters and ignored the actual steps.
### Problem use case
```python
a = g.V().count().gremlin_lang
b = g.V().drop().gremlin_lang
a == b
```
### Behaviour
| | Result |
|---|---|
| Before | `True` - two completely different queries (with equal/empty
parameters) compare equal |
| After | `False` - equality now considers the query steps as well as the
parameters |
## 2. `DriverRemoteConnection.submitAsync` is broken
File: `gremlin_python/driver/driver_remote_connection.py`
The deprecated `submitAsync` alias forwarded three positional arguments to
`submit_async`, which had been narrowed to a single `gremlin_lang` argument
in
4.x. It also never returned the future.
### Problem use case
```python
conn = DriverRemoteConnection('http://localhost:8182/gremlin', 'g')
future = conn.submitAsync(gremlin_lang)
result = future.result()
```
### Behaviour
| | Result |
|---|---|
| Before | Raises `TypeError: submit_async() takes 2 positional arguments
but 4 were given`; even setting that aside it returned `None` instead of a
future |
| After | Emits the deprecation warning, forwards the single `gremlin_lang`,
and returns the `Future` (resolving to a `RemoteTraversal`) |
## Tests
- `tests/unit/process/test_gremlin_lang.py`: equality of traversals with
different steps / equal params, equal objects, differing params, and
non-GremlinLang comparison.
- `tests/unit/driver/test_remote_connection.py`: `submitAsync` emits the
deprecation warning, forwards a single argument, returns a `Future`
resolving
to a `RemoteTraversal`, and no longer raises `TypeError`.
Assisted-by: Kiro: Claude Opus 4.8
--
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]