Closed Bug 1733395 Opened 4 years ago Closed 4 years ago

Don't include "OrderedDict" in schema validation error messages in glean_parser

Categories

(Data Platform and Tools :: Glean: SDK, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mdroettboom, Assigned: mdroettboom)

Details

(Whiteboard: [telemetry:glean-rs:m?])

Attachments

(1 file)

We currently use "OrderedDict" to load the schemas in glean_parser so the order of elements in the original file is preserved. Unfortunately, when the jsonschema library prints validation error messages, these messages have explicit OrderedDict([('foo', 'bar')]) reprs rather than the JSON-like {'foo': 'bar'} that our users would expect.

Besides being confusing, this bloats the error messages and makes our unit tests more susceptible to breakage across different versions of jsonschema.

This OrderedDict workaround is only required on Python 3.6 and earlier, since in Python 3.7, dicts are order-preserving by default. Since Python 3.6 is rather far in the past now, it probably makes sense to only do this workaround there, which would improve the error messages on newer Python versions.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: