Skip to content
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

refact(core): support Infinity & NaN number in float/double property #1578

Merged
merged 4 commits into from
Sep 16, 2021

Conversation

imbajin
Copy link
Member

@imbajin imbajin commented Aug 18, 2021

Fix #1575 :

  1. due to this, float can support the value > Float.MAX (treat as Infinity), so as the double
  2. add test case in client (later)

PS: Shall we delete old test cases directly

1. due to this, float support the value > Float.MAX (trate as Infinity), so as the double
2. add test case in client (later)

PS: Shall we delete old test cases directly
@codecov
Copy link

codecov bot commented Aug 18, 2021

Codecov Report

Merging #1578 (2d41cf7) into master (0dc7b27) will increase coverage by 0.02%.
The diff coverage is 76.92%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1578      +/-   ##
============================================
+ Coverage     63.26%   63.28%   +0.02%     
- Complexity     6703     6704       +1     
============================================
  Files           418      418              
  Lines         34449    34449              
  Branches       4765     4764       -1     
============================================
+ Hits          21793    21800       +7     
+ Misses        10407    10402       -5     
+ Partials       2249     2247       -2     
Impacted Files Coverage Δ
...java/com/baidu/hugegraph/structure/HugeVertex.java 78.57% <ø> (ø)
...java/com/baidu/hugegraph/type/define/DataType.java 87.12% <60.00%> (+0.72%) ⬆️
...c/main/java/com/baidu/hugegraph/util/JsonUtil.java 69.23% <87.50%> (-0.77%) ⬇️
...com/baidu/hugegraph/api/schema/PropertyKeyAPI.java 43.47% <0.00%> (ø)
...ugegraph/backend/store/rocksdb/RocksDBOptions.java 99.25% <0.00%> (ø)
...du/hugegraph/backend/tx/GraphIndexTransaction.java 84.18% <0.00%> (+0.53%) ⬆️
...va/com/baidu/hugegraph/task/ServerInfoManager.java 71.34% <0.00%> (+0.56%) ⬆️
...va/com/baidu/hugegraph/backend/cache/RamCache.java 73.03% <0.00%> (+0.56%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0dc7b27...2d41cf7. Read the comment docs.

@imbajin imbajin changed the title refact: support Infinity & NaN number in float/double refact(core): support Infinity & NaN number in float/double property Aug 18, 2021
@@ -462,13 +467,13 @@ public void testTypeFloat() {
1f, 3f, 3f, 127f, 128f));

Assert.assertThrows(IllegalArgumentException.class, () -> {
property("float", Double.MAX_VALUE);
property("float", 'a');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the behavior of property("float", Double.MAX_VALUE)? can also test it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

treat as Infinity. add a assertEquals for it

javeme
javeme previously approved these changes Aug 20, 2021
@javeme javeme merged commit 2a95f9f into master Sep 16, 2021
@javeme javeme deleted the support-infinite-nan branch September 16, 2021 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] HugeGraph could not process Inifnity/NaN value in float/double
3 participants