Skip to content
Permalink
Browse files

changed comparison for aggregator to match unicode (#546)

changed from 'is' to '==' for aggregation name comparison as it would
not match unicode in python2.7
  • Loading branch information
rbizos committed Mar 25, 2020
1 parent a56d8a3 commit 136fbe33c071ae4a45db887089adf42e91103d2e
Showing with 9 additions and 1 deletion.
  1. +1 −1 biggraphite/metric.py
  2. +8 −0 tests/test_metric.py
@@ -310,7 +310,7 @@ def from_carbon_name(cls, name):
return None

for agg in cls:
if agg.value is name:
if agg.value == name:
return agg

raise InvalidArgumentError("Unknown carbon aggregation: %s" % name)
@@ -165,6 +165,14 @@ def test_from_dict_string(self):
},
bg_metric.Aggregator.total,
),
(
{
"aggregator": u"sum",
"retention": "86400*1s:10080*60s",
"carbon_xfilesfactor": 0.5,
},
bg_metric.Aggregator.total,
),
(
{
"aggregator": "total",

0 comments on commit 136fbe3

Please sign in to comment.
You can’t perform that action at this time.