Skip to content

Commit

Permalink
Merge pull request #126 from brizental/reproducible-docs
Browse files Browse the repository at this point in the history
Use lists instead of sets in Labeled types labels
  • Loading branch information
brizental authored Oct 16, 2019
2 parents c21043e + 655278f commit 2e2d34f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
8 changes: 8 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ History
Unreleased
----------

1.9.4 (2019-10-16)
------------------

* Use lists instead of sets in Labeled types labels to ensure that
the order of the labels passed to the `metrics.yaml` is kept.

* `glinter` will now check for duplicate labels and error if there are any.

1.9.3 (2019-10-09)
------------------

Expand Down
2 changes: 1 addition & 1 deletion glean_parser/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ class Uuid(Metric):

@dataclass
class Labeled(Metric):
labels: Set[str] = None
labels: List[str] = None
labeled = True


Expand Down
1 change: 1 addition & 0 deletions glean_parser/schemas/metrics.1-0-0.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ definitions:
Valid with any of the labeled metric types.
anyOf:
- type: array
uniqueItems: true
items:
$ref: "#/definitions/labeled_metric_id"
maxItems: 16
Expand Down
2 changes: 1 addition & 1 deletion tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_parser():
assert isinstance(metric_val, metrics.Metric)
assert isinstance(metric_val.lifetime, metrics.Lifetime)
if getattr(metric_val, "labels", None) is not None:
assert isinstance(metric_val.labels, set)
assert isinstance(metric_val.labels, list)

pings = all_metrics.value["pings"]
assert pings["custom_ping"].name == "custom_ping"
Expand Down

0 comments on commit 2e2d34f

Please sign in to comment.