Skip to content

Commit

Permalink
feat: supprt properties as list
Browse files Browse the repository at this point in the history
  • Loading branch information
SlowMo24 committed Nov 16, 2023
1 parent a545361 commit 62690f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ohsome/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def format_bpolys(bpolys):

def format_list_parameters(parameters: dict) -> dict:
"""Converts parameters of type list to strings using ',' as seperator."""
list_parameters = ["groupByKeys", "groupByValues"]
list_parameters = ["groupByKeys", "groupByValues", "properties"]
for param in list_parameters:
if isinstance(parameters.get(param), list):
parameters[param] = ",".join(parameters[param])
Expand Down
2 changes: 2 additions & 0 deletions ohsome/test/test_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,14 @@ def test_format_list_parameters():
"groupByKeys": ["k1", "k2"],
"groupByValues": ["v1", "v2"],
"otherParam": ["l"],
"properties": ["p1"],
}

expected_output = {
"groupByKeys": "k1,k2",
"groupByValues": "v1,v2",
"otherParam": ["l"],
"properties": "p1",
}

output = format_list_parameters(method_input)
Expand Down

0 comments on commit 62690f6

Please sign in to comment.