grumlin 0.22.1 → 0.22.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8f91cc8f8b58fc3d72726e876dabac6a8f167e81bd524907eef4df7d72802e79
4
- data.tar.gz: 892fa89f75c999899ff0869c7c6f74c26526b9eb5a6da0b43bd4df8a1b64504a
3
+ metadata.gz: 512af99a3613024d7ea0a4837359fae0f54d0a8cbe1077b5084dc9f5b0136143
4
+ data.tar.gz: ef0ba0abdcc269b1873e81b30fd08fce1647b31856f75d6652af67151fc402f4
5
5
  SHA512:
6
- metadata.gz: 5d50c9b36f4a69a431620404b333b71c8fd9ca2fd8a6b2689c6ece3da57198de4cfa294adaf631238ca1186581eaa3b74a9ec8dea6e6f50f69a977a78ea71a79
7
- data.tar.gz: 3f201c437eee80beac09bb76f121542f7c611b68ce513545fb46d6c44790cf061527564e5f9c03e4f55e51c70c67e355802d0e63e64004d4db36de135f110750
6
+ metadata.gz: 881de04b1163b74f27a6b890d3a43e16deaa2ab05f553c5bb567af20c689dc78fc5fed4cd81a33803ab3ed37f19be721f71e49062bcb89fa318370c5926ed20f
7
+ data.tar.gz: e26aad07bc0e3f8f59ca06ed2bb0875b3cc499db7e3982e1617a28da4995a60c8b68dceb6666379fa36289cbe4fa3c7a621c8a72509e7e8fbe7c7f504fcc7ebc
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- grumlin (0.22.1)
4
+ grumlin (0.22.4)
5
5
  async-pool (~> 0.3)
6
- async-websocket (~> 0.19)
6
+ async-websocket (>= 0.19, < 0.20)
7
7
  oj (~> 3.13)
8
8
  retryable (~> 3.0)
9
9
  zeitwerk (~> 2.6)
@@ -11,7 +11,7 @@ PATH
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- activesupport (7.0.3)
14
+ activesupport (7.0.3.1)
15
15
  concurrent-ruby (~> 1.0, >= 1.0.2)
16
16
  i18n (>= 1.6, < 2)
17
17
  minitest (>= 5.1)
@@ -21,7 +21,7 @@ GEM
21
21
  console (~> 1.10)
22
22
  nio4r (~> 2.3)
23
23
  timers (~> 4.1)
24
- async-http (0.58.0)
24
+ async-http (0.59.1)
25
25
  async (>= 1.25)
26
26
  async-io (>= 1.28)
27
27
  async-pool (>= 0.2)
@@ -31,7 +31,7 @@ GEM
31
31
  traces (>= 0.4.0)
32
32
  async-io (1.33.0)
33
33
  async
34
- async-pool (0.3.10)
34
+ async-pool (0.3.11)
35
35
  async (>= 1.25)
36
36
  async-rspec (1.16.1)
37
37
  rspec (~> 3.0)
@@ -55,33 +55,30 @@ GEM
55
55
  factory_bot (6.2.1)
56
56
  activesupport (>= 5.0.0)
57
57
  fiber-local (1.0.0)
58
- i18n (1.10.0)
58
+ i18n (1.12.0)
59
59
  concurrent-ruby (~> 1.0)
60
60
  iniparse (1.5.0)
61
61
  jaro_winkler (1.5.4)
62
+ json (2.6.2)
62
63
  kramdown (2.4.0)
63
64
  rexml
64
65
  kramdown-parser-gfm (1.1.0)
65
66
  kramdown (~> 2.0)
66
67
  memory_profiler (1.0.0)
67
- mini_portile2 (2.8.0)
68
- minitest (5.15.0)
68
+ minitest (5.16.3)
69
69
  nio4r (2.5.8)
70
- nokogiri (1.13.6)
71
- mini_portile2 (~> 2.8.0)
70
+ nokogiri (1.13.8-x86_64-linux)
72
71
  racc (~> 1.4)
73
- nokogiri (1.13.6-x86_64-linux)
74
- racc (~> 1.4)
75
- oj (3.13.20)
72
+ oj (3.13.21)
76
73
  overcommit (0.59.1)
77
74
  childprocess (>= 0.6.3, < 5)
78
75
  iniparse (~> 1.4)
79
76
  rexml (~> 3.2)
80
77
  parallel (1.22.1)
81
- parser (3.1.2.0)
78
+ parser (3.1.2.1)
82
79
  ast (~> 2.4.1)
83
80
  protocol-hpack (1.4.2)
84
- protocol-http (0.23.4)
81
+ protocol-http (0.23.5)
85
82
  protocol-http1 (0.14.4)
86
83
  protocol-http (~> 0.22)
87
84
  protocol-http2 (0.14.2)
@@ -115,22 +112,23 @@ GEM
115
112
  diff-lcs (>= 1.2.0, < 2.0)
116
113
  rspec-support (~> 3.11.0)
117
114
  rspec-support (3.11.0)
118
- rubocop (1.30.1)
115
+ rubocop (1.35.1)
116
+ json (~> 2.3)
119
117
  parallel (~> 1.10)
120
- parser (>= 3.1.0.0)
118
+ parser (>= 3.1.2.1)
121
119
  rainbow (>= 2.2.2, < 4.0)
122
120
  regexp_parser (>= 1.8, < 3.0)
123
121
  rexml (>= 3.2.5, < 4.0)
124
- rubocop-ast (>= 1.18.0, < 2.0)
122
+ rubocop-ast (>= 1.20.1, < 2.0)
125
123
  ruby-progressbar (~> 1.7)
126
124
  unicode-display_width (>= 1.4.0, < 3.0)
127
- rubocop-ast (1.18.0)
125
+ rubocop-ast (1.21.0)
128
126
  parser (>= 3.1.1.0)
129
- rubocop-performance (1.14.2)
127
+ rubocop-performance (1.14.3)
130
128
  rubocop (>= 1.7.0, < 2.0)
131
129
  rubocop-ast (>= 0.4.0)
132
- rubocop-rspec (2.11.1)
133
- rubocop (~> 1.19)
130
+ rubocop-rspec (2.12.1)
131
+ rubocop (~> 1.31)
134
132
  ruby-prof (1.4.3)
135
133
  ruby-progressbar (1.11.0)
136
134
  simplecov (0.21.2)
@@ -139,7 +137,7 @@ GEM
139
137
  simplecov_json_formatter (~> 0.1)
140
138
  simplecov-html (0.12.3)
141
139
  simplecov_json_formatter (0.1.4)
142
- solargraph (0.45.0)
140
+ solargraph (0.46.0)
143
141
  backport (~> 1.2)
144
142
  benchmark
145
143
  bundler (>= 1.17.2)
@@ -155,19 +153,18 @@ GEM
155
153
  tilt (~> 2.0)
156
154
  yard (~> 0.9, >= 0.9.24)
157
155
  thor (1.2.1)
158
- tilt (2.0.10)
156
+ tilt (2.0.11)
159
157
  timers (4.3.3)
160
- traces (0.6.0)
161
- tzinfo (2.0.4)
158
+ traces (0.6.1)
159
+ tzinfo (2.0.5)
162
160
  concurrent-ruby (~> 1.0)
163
- unicode-display_width (2.1.0)
161
+ unicode-display_width (2.2.0)
164
162
  webrick (1.7.0)
165
163
  yard (0.9.28)
166
164
  webrick (~> 1.7.0)
167
165
  zeitwerk (2.6.0)
168
166
 
169
167
  PLATFORMS
170
- ruby
171
168
  x86_64-linux
172
169
 
173
170
  DEPENDENCIES
data/grumlin.gemspec CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
  spec.require_paths = ["lib"]
30
30
 
31
31
  spec.add_dependency "async-pool", "~> 0.3"
32
- spec.add_dependency "async-websocket", "~> 0.19"
32
+ spec.add_dependency "async-websocket", ">= 0.19", "< 0.20"
33
33
  spec.add_dependency "oj", "~> 3.13"
34
34
  spec.add_dependency "retryable", "~> 3.0"
35
35
  spec.add_dependency "zeitwerk", "~> 2.6"
data/lib/definitions.yml CHANGED
@@ -69,6 +69,7 @@ steps:
69
69
  - unfold
70
70
  - union
71
71
  - until
72
+ - value
72
73
  - valueMap
73
74
  - values
74
75
  - where
@@ -10,7 +10,7 @@ module Grumlin
10
10
  UPSERT_RETRY_PARAMS = {
11
11
  on: [Grumlin::AlreadyExistsError, Grumlin::ConcurrentModificationError],
12
12
  sleep_method: ->(n) { Async::Task.current.sleep(n) },
13
- tries: 3,
13
+ tries: 5,
14
14
  sleep: ->(n) { (n**2) + 1 + rand }
15
15
  }.freeze
16
16
 
@@ -18,11 +18,19 @@ module Grumlin
18
18
  # {"detailedMessage":"",
19
19
  # "requestId":"UUID",
20
20
  # "code":"ConcurrentModificationException"}
21
- # Currencly we simply search for substings to identify the exact error
21
+ # Currently we simply search for substrings to identify the exact error
22
22
  # TODO: parse json and use `code` instead
23
+
23
24
  VERTEX_ALREADY_EXISTS = "Vertex with id already exists:"
24
25
  EDGE_ALREADY_EXISTS = "Edge with id already exists:"
26
+
25
27
  CONCURRENT_VERTEX_INSERT_FAILED = "Failed to complete Insert operation for a Vertex due to conflicting concurrent"
28
+
29
+ CONCURRENT_VERTEX_PROPERTY_INSERT_FAILED =
30
+ "Failed to complete Insert operation for a VertexProperty due to conflicting concurrent"
31
+ CONCURRENT_EDGE_PROPERTY_INSERT_FAILED =
32
+ "Failed to complete Insert operation for a EdgeProperty due to conflicting concurrent"
33
+
26
34
  CONCURRENT_EDGE_INSERT_FAILED = "Failed to complete Insert operation for an Edge due to conflicting concurrent"
27
35
  CONCURRENCT_MODIFICATION_FAILED = "Failed to complete operation due to conflicting concurrent"
28
36
 
@@ -49,9 +57,15 @@ module Grumlin
49
57
  return EdgeAlreadyExistsError if status[:message]&.include?(EDGE_ALREADY_EXISTS)
50
58
  end
51
59
 
52
- def concurrent_modification_error(status)
60
+ def concurrent_modification_error(status) # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
53
61
  return ConcurrentVertexInsertFailedError if status[:message]&.include?(CONCURRENT_VERTEX_INSERT_FAILED)
62
+ if status[:message]&.include?(CONCURRENT_VERTEX_PROPERTY_INSERT_FAILED)
63
+ return ConcurrentVertexPropertyInsertFailedError
64
+ end
54
65
  return ConcurrentEdgeInsertFailedError if status[:message]&.include?(CONCURRENT_EDGE_INSERT_FAILED)
66
+ if status[:message]&.include?(CONCURRENT_EDGE_PROPERTY_INSERT_FAILED)
67
+ return ConcurrentEdgePropertyInsertFailedError
68
+ end
55
69
  return ConcurrentModificationError if status[:message]&.include?(CONCURRENCT_MODIFICATION_FAILED)
56
70
  end
57
71
  end
@@ -9,13 +9,13 @@ module Grumlin
9
9
  "g:Vertex" => ->(value) { cast_entity(Grumlin::Vertex, value) },
10
10
  "g:Edge" => ->(value) { cast_entity(Grumlin::Edge, value) },
11
11
  "g:Path" => ->(value) { cast_entity(Grumlin::Path, value) },
12
- "g:Traverser" => ->(value) { cast_entity(Traverser, value) },
13
- "g:Property" => ->(value) { cast_entity(Property, value) },
12
+ "g:Traverser" => ->(value) { cast_entity(Grumlin::Traverser, value) },
13
+ "g:Property" => ->(value) { cast_entity(Grumlin::Property, value) },
14
14
  "g:Int64" => ->(value) { cast_int(value) },
15
15
  "g:Int32" => ->(value) { cast_int(value) },
16
16
  "g:Double" => ->(value) { cast_double(value) },
17
17
  "g:Direction" => ->(value) { value },
18
- # "g:VertexProperty"=> ->(value) { value }, # TODO: implement me
18
+ "g:VertexProperty" => ->(value) { cast_entity(Grumlin::VertexProperty, value) },
19
19
  "g:TraversalMetrics" => ->(value) { cast_map(value[:@value]) },
20
20
  "g:Metrics" => ->(value) { cast_map(value[:@value]) },
21
21
  "g:T" => ->(value) { Grumlin::Expressions::T.public_send(value) }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Grumlin
4
- VERSION = "0.22.1"
4
+ VERSION = "0.22.4"
5
5
  end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Grumlin
4
+ class VertexProperty
5
+ attr_reader :label, :value
6
+
7
+ def initialize(value)
8
+ @label = value[:label]
9
+ @value = Typing.cast(value[:value])
10
+ end
11
+
12
+ def inspect
13
+ "vp[#{label}->#{value}]"
14
+ end
15
+
16
+ def to_s
17
+ inspect
18
+ end
19
+
20
+ def ==(other)
21
+ self.class == other.class && @label == other.label && @value == other.value
22
+ end
23
+ end
24
+ end
data/lib/grumlin.rb CHANGED
@@ -107,6 +107,9 @@ module Grumlin
107
107
  class ConcurrentVertexInsertFailedError < ConcurrentInsertFailedError; end
108
108
  class ConcurrentEdgeInsertFailedError < ConcurrentInsertFailedError; end
109
109
 
110
+ class ConcurrentVertexPropertyInsertFailedError < ConcurrentInsertFailedError; end
111
+ class ConcurrentEdgePropertyInsertFailedError < ConcurrentInsertFailedError; end
112
+
110
113
  class ServerSerializationError < ServerSideError; end
111
114
 
112
115
  class ServerTimeoutError < ServerSideError; end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grumlin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.22.1
4
+ version: 0.22.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gleb Sinyavskiy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-15 00:00:00.000000000 Z
11
+ date: 2022-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async-pool
@@ -28,16 +28,22 @@ dependencies:
28
28
  name: async-websocket
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0.19'
34
+ - - "<"
35
+ - !ruby/object:Gem::Version
36
+ version: '0.20'
34
37
  type: :runtime
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
37
40
  requirements:
38
- - - "~>"
41
+ - - ">="
39
42
  - !ruby/object:Gem::Version
40
43
  version: '0.19'
44
+ - - "<"
45
+ - !ruby/object:Gem::Version
46
+ version: '0.20'
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: oj
43
49
  requirement: !ruby/object:Gem::Requirement
@@ -167,6 +173,7 @@ files:
167
173
  - lib/grumlin/typing.rb
168
174
  - lib/grumlin/version.rb
169
175
  - lib/grumlin/vertex.rb
176
+ - lib/grumlin/vertex_property.rb
170
177
  - lib/grumlin/with_extension.rb
171
178
  - lib/tasks/benchmark.rake
172
179
  homepage: https://github.com/zhulik/grumlin