-
Notifications
You must be signed in to change notification settings - Fork 525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: support null value for gremlin test #2061
Conversation
@@ -430,9 +430,6 @@ public static final ElementKeys classifyKeys(Object... keyValues) { | |||
throw Element.Exceptions | |||
.providedKeyValuesMustHaveALegalKeyOnEvenIndices(); | |||
} | |||
if (val == null) { | |||
throw Property.Exceptions.propertyDoesNotExist(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems need to skip the null value here with continue
, also add the comment for why
|
||
this.owner = owner; | ||
this.pkey = pkey; | ||
this.value = pkey.validValueOrThrow(value); | ||
this.value = pkey.validValue(value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can keep the origin code if the null value is skipped?
hugegraph-core/src/main/java/org/apache/hugegraph/structure/HugeElement.java
Show resolved
Hide resolved
|
||
this.owner = owner; | ||
this.pkey = pkey; | ||
this.value = pkey.validValueOrThrow(value); | ||
this.value = pkey.validValue(value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note also need to update HugeEdge.property(String key, V value)
to add null value check (the same as HugeVertex.property(String key, V value)
):
if (value == null) {
this.removeProperty(propertyKey.id());
return EmptyProperty.instance();
}
Codecov Report
@@ Coverage Diff @@
## master #2061 +/- ##
============================================
- Coverage 68.67% 68.00% -0.68%
+ Complexity 979 676 -303
============================================
Files 479 479
Lines 39652 39655 +3
Branches 5576 5577 +1
============================================
- Hits 27231 26967 -264
- Misses 9778 10045 +267
Partials 2643 2643
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@@ -202,6 +204,11 @@ public <V> Property<V> property(String key, V value) { | |||
E.checkArgument(this.label.properties().contains(propertyKey.id()), | |||
"Invalid property '%s' for edge label '%s'", | |||
key, this.label()); | |||
if (value == null) { | |||
this.removeProperty(propertyKey.id()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if remove null value's property, may cause tinkerpop ut failed ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
follow the tinkerpop ci action tests with release-1.0.0
@@ -364,6 +369,7 @@ public void vertices(HugeVertex owner, HugeVertex other) { | |||
if (ownerLabel.equals(this.label.sourceLabel())) { | |||
this.vertices(true, owner, other); | |||
} else { | |||
// TODO: why when compare the label but ignore the result? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe missing assert
@@ -202,6 +204,11 @@ public <V> Property<V> property(String key, V value) { | |||
E.checkArgument(this.label.properties().contains(propertyKey.id()), | |||
"Invalid property '%s' for edge label '%s'", | |||
key, this.label()); | |||
if (value == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also update HugeVertex.property(String key, V value)
@imbajin please cherry pick changes from the release branch? |
I'm on it, soon Update: done |
fix sub-issue 4 #2058