Skip to content

Commit

Permalink
allow pipe character in dimension values (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
jancervenka authored May 23, 2022
1 parent ffcac58 commit b3dd42b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = ep-stats
version = 1.2.0
version = 1.2.1
description = Statistical package to evaluate ab tests in experimentation platform.
long_description = file: README.md
long_description_content_type = text/markdown
Expand Down
2 changes: 1 addition & 1 deletion src/epstats/toolkit/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(self, nominator: str, denominator: str):
goal = Word(alphas + "_" + nums).setParseAction(Goal)
number = Word(nums).setParseAction(Number)
dimension = Word(alphas + "_").setParseAction(Dimension)
dimension_value = Word(alphanums + "_" + "-" + "." + "%" + " " + "/").setParseAction(DimensionValue)
dimension_value = Word(alphanums + "_" + "-" + "." + "%" + " " + "/" + "|").setParseAction(DimensionValue)
dimension_list = delimitedList(dimension + "=" + dimension_value)

ep_goal = (func + "(" + unit_type + "." + agg_type + "." + goal + ")").setParseAction(EpGoal)
Expand Down
10 changes: 10 additions & 0 deletions tests/epstats/toolkit/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,16 @@ def test_raise_if_duplicate_dimensions():
"test_unit_type.unit.conversion": {"x": "", "y": ""},
},
),
(
Parser(
"count(test_unit_type.global.conversion(x=A/ A|BB, y=X|Y|Z))",
"count(test_unit_type.unit.conversion)",
),
{
"test_unit_type.global.conversion[x=A/ A|BB, y=X|Y|Z]": {"x": "A/ A|BB", "y": "X|Y|Z"},
"test_unit_type.unit.conversion": {"x": "", "y": ""},
},
),
],
)
def test_get_goals_dimensional(parser, expected_goals):
Expand Down

0 comments on commit b3dd42b

Please sign in to comment.