Commit d0657d2
authored
[v0/v1 migration] /bulk/info/variable-group (#6199)
## Issue
[b/491885197] (https://b.corp.google.com/issues/491885197)
## Description
This PR implements the migration of `v1/bulk/info/variable-group` to
`v2`.
The change is gated behind the `use_v2_api` flag.
## Notes
The core of the migration is very simple: a flag-mediated gate that
determines which endpoint is called.
The complication comes (that makes up most of the diff) comes from the
fact that the `v2` endpoint is no longer able to provide a `definition`
along with each stat var. This definition is used (relatively rarely) in
the natural language search, in order to find sibling stat vars to
provide further exploration topics for the user.
Because this is no longer available in the `v2` endpoint, the
functionality had to be reconstructed via direct v2 calls.
A discussion of the methodology, testing, fidelity and latency
considerations of this can be found [at this
link](https://docs.google.com/document/d/1LEZI_6-2wkwpmv0ELYIKg28wqJJpsyZSZohl7CJ3-HE/edit?resourcekey=0-_UcPAttv9jeT4qas_rIGhw&tab=t.0).
(Message if access is required).
This document describes how the `definition` functionality is used and
analyses the latency and fidelity implications of moving that
functionality to Flask and `v2`.
## Testing
There are two aspects of the NL search that are affected by the
"definitions". These are described in the document as Flow 1 and Flow2.
Flow 1 is rarely invoked, but can be seen in the following query (which
should produce the same results for "Related" charts populated at the
bottom of the results section).
*
[V2](http://localhost:8080/explore#q=population+of+people+aged+85+and+over+in+Seattle&client=ui_query)
*
[V1](http://localhost:8080/explore?disable_feature=use_v2_api#q=population+of+people+aged+85+and+over+in+Seattle&client=ui_query)
Flow 2 is much more common, and is the primary driver of latency
discrepancies between `v1` and `v2`.
This flow is invoked on a standard query such as:
[Query]()
## Goldens
This PR also includes explicit directives to the integration tests to
use v1. The goldens would have to be regenerated for v2 at some point
before the feature flag is dropped.1 parent 6c73eb0 commit d0657d2
8 files changed
Lines changed: 487 additions & 35 deletions
File tree
- server
- integration_tests
- lib/nl/common
- services
- tests/lib/nl
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| |||
1003 | 1005 | | |
1004 | 1006 | | |
1005 | 1007 | | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
| |||
57 | 60 | | |
58 | 61 | | |
59 | 62 | | |
60 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
61 | 66 | | |
62 | 67 | | |
63 | 68 | | |
| |||
98 | 103 | | |
99 | 104 | | |
100 | 105 | | |
101 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
102 | 109 | | |
103 | 110 | | |
104 | 111 | | |
| |||
121 | 128 | | |
122 | 129 | | |
123 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
124 | 199 | | |
125 | 200 | | |
126 | 201 | | |
| |||
151 | 226 | | |
152 | 227 | | |
153 | 228 | | |
154 | | - | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
155 | 243 | | |
156 | 244 | | |
157 | 245 | | |
158 | 246 | | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
159 | 256 | | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | 257 | | |
| 258 | + | |
| 259 | + | |
165 | 260 | | |
166 | | - | |
| 261 | + | |
167 | 262 | | |
168 | 263 | | |
169 | 264 | | |
170 | 265 | | |
171 | 266 | | |
172 | 267 | | |
| 268 | + | |
| 269 | + | |
173 | 270 | | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
183 | 293 | | |
184 | | - | |
185 | | - | |
186 | | - | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
187 | 297 | | |
188 | 298 | | |
189 | 299 | | |
190 | 300 | | |
191 | 301 | | |
192 | | - | |
| 302 | + | |
193 | 303 | | |
194 | 304 | | |
195 | 305 | | |
| |||
0 commit comments