Skip to content

Commit e0e79c5

Browse files
committed
Merge branch '3.7-dev'
2 parents ab2628d + 634aafc commit e0e79c5

File tree

3 files changed

+22
-8
lines changed

3 files changed

+22
-8
lines changed

CHANGELOG.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
111111
* Fixed issue in `gremlin-console` where it couldn't accept plugin files that included empty lines or invalid plugin names.
112112
* Modified grammar to make `none()` usage more consistent as a filter step where it can now be used to chain additional traversal steps and be used anonymously.
113113
* Added missing anonymous support for `disjunct()` in Python and Javascript.
114+
* Deprecated gremlin_python.process.__.has_key_ in favor of gremlin_python.process.__.has_key.
114115
115116
[[release-3-7-3]]
116117
=== TinkerPop 3.7.3 (October 23, 2024)

docs/src/reference/gremlin-variants.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2554,7 +2554,7 @@ In situations where Python reserved words and global functions overlap with stan
25542554
bits of conflicting Gremlin get an underscore appended as a suffix:
25552555
25562556
*Steps* - <<all-step,all_()>>, <<and-step,and_()>>, <<any-step,any_()>>, <<as-step,as_()>>, <<filter-step,filter_()>>, <<from-step,from_()>>,
2557-
<<has-step,has_key_>>, <<id-step,id_()>>, <<is-step,is_()>>, <<in-step,in_()>>, <<max-step,max_()>>,
2557+
<<id-step,id_()>>, <<is-step,is_()>>, <<in-step,in_()>>, <<max-step,max_()>>,
25582558
<<min-step,min_()>>, <<not-step,not_()>>, <<or-step,or_()>>, <<range-step,range_()>>, <<sum-step,sum_()>>,
25592559
<<with-step,with_()>>
25602560

gremlin-python/src/main/python/gremlin_python/process/graph_traversal.py

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -536,11 +536,14 @@ def hasKey(self, *args):
536536
"gremlin_python.process.GraphTraversalSource.hasKey will be replaced by "
537537
"gremlin_python.process.GraphTraversalSource.has_key.",
538538
DeprecationWarning)
539-
return self.has_key_(*args)
539+
return self.has_key(*args)
540540

541541
def has_key_(self, *args):
542-
self.gremlin_lang.add_step("hasKey", *args)
543-
return self
542+
warnings.warn(
543+
"gremlin_python.process.GraphTraversalSource.has_key_ will be replaced by "
544+
"gremlin_python.process.GraphTraversalSource.has_key.",
545+
DeprecationWarning)
546+
return self.has_key(*args)
544547

545548
def has_key(self, *args):
546549
self.gremlin_lang.add_step("hasKey", *args)
@@ -1303,10 +1306,18 @@ def hasKey(cls, *args):
13031306
"gremlin_python.process.__.hasKey will be replaced by "
13041307
"gremlin_python.process.__.has_key.",
13051308
DeprecationWarning)
1306-
return cls.has_key_(*args)
1309+
return cls.has_key(*args)
13071310

13081311
@classmethod
13091312
def has_key_(cls, *args):
1313+
warnings.warn(
1314+
"gremlin_python.process.__.has_key_ will be replaced by "
1315+
"gremlin_python.process.__.has_key.",
1316+
DeprecationWarning)
1317+
return cls.has_key(*args)
1318+
1319+
@classmethod
1320+
def has_key (cls, *args):
13101321
return cls.graph_traversal(None, None, GremlinLang()).has_key_(*args)
13111322

13121323
@classmethod
@@ -2026,12 +2037,14 @@ def has_id(*args):
20262037

20272038

20282039
def hasKey(*args):
2029-
return __.has_key_(*args)
2040+
return __.has_key(*args)
20302041

20312042

20322043
def has_key_(*args):
2033-
return __.has_key_(*args)
2044+
return __.has_key(*args)
20342045

2046+
def has_key(*args):
2047+
return __.has_key(*args)
20352048

20362049
def hasLabel(*args):
20372050
return __.has_label(*args)
@@ -2493,7 +2506,7 @@ def where(*args):
24932506

24942507
statics.add_static('hasKey', hasKey)
24952508

2496-
statics.add_static('has_key', has_key_)
2509+
statics.add_static('has_key', has_key)
24972510

24982511
statics.add_static('hasLabel', hasLabel)
24992512

0 commit comments

Comments
 (0)