Page MenuHomePhabricator

Inconsistent JSON structure in ORES responses
Closed, ResolvedPublic

Description

I noticed ScoredRevisions was having some errors like

TypeError: scoreData[models[m]].probability is undefined

and while I investigated I found out that ores API returns data in an inconsistent format. In the example below, notice how the scores for a few revisions (45196071, 45196078) are inside arrays, instead of objects:

"damaging": [ { "prediction": ...}, null ]

instead of

"damaging": { "prediction": ... }

1{
2 "45162241": {
3 "damaging": {
4 "prediction": false,
5 "probability": {
6 "false": 0.9019621183854281,
7 "true": 0.09803788161457233
8 }
9 },
10 "reverted": {
11 "prediction": false,
12 "probability": {
13 "false": 0.9030966266025562,
14 "true": 0.09690337339744365
15 }
16 }
17 },
18 "45184349": {
19 "damaging": {
20 "prediction": false,
21 "probability": {
22 "false": 0.9097819966553254,
23 "true": 0.09021800334467456
24 }
25 },
26 "reverted": {
27 "prediction": false,
28 "probability": {
29 "false": 0.9076207791028394,
30 "true": 0.09237922089716077
31 }
32 }
33 },
34 "45196071": {
35 "damaging": [
36 {
37 "prediction": false,
38 "probability": {
39 "false": 0.9035356865498224,
40 "true": 0.09646431345017766
41 }
42 },
43 null
44 ],
45 "reverted": [
46 {
47 "prediction": false,
48 "probability": {
49 "false": 0.9031500000378354,
50 "true": 0.09684999996216435
51 }
52 },
53 null
54 ]
55 },
56 "45196078": {
57 "damaging": [
58 {
59 "prediction": false,
60 "probability": {
61 "false": 0.9010211761542022,
62 "true": 0.09897882384579784
63 }
64 },
65 null
66 ],
67 "reverted": [
68 {
69 "prediction": false,
70 "probability": {
71 "false": 0.9002397776150146,
72 "true": 0.09976022238498528
73 }
74 },
75 null
76 ]
77 },
78 "45219560": {
79 "damaging": {
80 "prediction": false,
81 "probability": {
82 "false": 0.8129260180770256,
83 "true": 0.18707398192297456
84 }
85 },
86 "reverted": {
87 "prediction": false,
88 "probability": {
89 "false": 0.9087357975225774,
90 "true": 0.09126420247742248
91 }
92 }
93 }
94}

(data copied from https://ores.wmflabs.org/scores/ptwiki/?models=damaging|reverted&revids=45162241|45184349|45196071|45196078|45219560 )

Related Objects

Event Timeline

He7d3r created this task.Apr 2 2016, 2:02 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 2 2016, 2:02 PM
Halfak added a subscriber: Halfak.Apr 2 2016, 8:25 PM

This is an old bug that is caught in the cache still. New scores shouldn't suffer from the problem. A good solution would be to invalidate the cache. We can do that with a deploy of new models.

Halfak added a comment.Apr 2 2016, 8:25 PM

We're looking to do a deploy within the next week. See announcement posted soon.

Halfak closed this task as Resolved.May 18 2016, 1:02 PM
Halfak moved this task from Active to Done on the Scoring-platform-team (Current) board.