Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinblack committed Dec 15, 2023
1 parent be9a2d7 commit 2857f0a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions arcaflow_plugin_opensearch/opensearch_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ def convert_to_supported_type(value) -> typing.Dict:
elif type_of_val == dict:
result = {}
for k in value:
result[convert_to_supported_type(k)] = convert_to_supported_type(
value[k]
)
result[convert_to_supported_type(k)] = convert_to_supported_type(value[k])
return result
elif type_of_val in (float, int, str, bool):
return value
Expand All @@ -33,6 +31,7 @@ def convert_to_supported_type(value) -> typing.Dict:
print("Unknown type", type_of_val, "with val", str(value))
return str(value)


def convert_to_homogenous_list(input_list: list):
# To make all types in list homogeneous, we upconvert them
# to the least commom type.
Expand All @@ -49,6 +48,7 @@ def convert_to_homogenous_list(input_list: list):
list_type = int()
return list(map(type(list_type), input_list))


@plugin.step(
id="opensearch",
name="OpenSearch",
Expand Down
3 changes: 1 addition & 2 deletions tests/unit/test_arcaflow_plugin_opensearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_serialization():
" 'mapper_parsing_exception','failed to parse')"
)
)

def test_convert_to_homogeneous_list(self):
test_cases = [
["a", "b", "c"], # all str
Expand Down Expand Up @@ -73,6 +73,5 @@ def validate_list_items_homogeous_type(t, input_list):
t.assertEqual(type(item), expected_type)



if __name__ == "__main__":
unittest.main()

0 comments on commit 2857f0a

Please sign in to comment.