Skip to content

Commit

Permalink
Move new arguments to the end in case it is already used
Browse files Browse the repository at this point in the history
  • Loading branch information
JokeWaumans committed Aug 23, 2024
1 parent 1a141f4 commit 72a6cb1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion mlx/coverity.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def get_filtered_defects(self, node):
column_names = set(node["col"])
if "chart_attribute" in node and node["chart_attribute"].upper() in node.column_map:
column_names.add(node["chart_attribute"])
defects = self.coverity_service.get_defects(self.stream, self.snaphsot, node["filters"], column_names)
defects = self.coverity_service.get_defects(self.stream, node["filters"], column_names, self.snaphsot)
report_info("%d received" % (defects["totalRows"]))
report_info("building defects table and/or chart... ", True)
return defects
Expand Down
4 changes: 2 additions & 2 deletions mlx/coverity_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def assemble_query_filter(self, column_name, filter_values, matcher_type):
"matchers": matchers
}

def get_defects(self, stream, snapshot, filters, column_names):
def get_defects(self, stream, filters, column_names, snapshot):
"""Gets a list of defects for given stream, snapshot ID, filters and column names.
If the snapshot is empty, the last snapshot is taken.
If a column name does not match the name of the `columns` property, the column can not be obtained because
Expand All @@ -255,9 +255,9 @@ def get_defects(self, stream, snapshot, filters, column_names):
Args:
stream (str): Name of the stream to query
snapshot (str): The snapshot ID; If empty the last snapshot is taken.
filters (dict): Dictionary with attribute names as keys and CSV lists of attribute values to query as values
column_names (list[str]): The column names
snapshot (str): The snapshot ID; If empty the last snapshot is taken.
Returns:
dict: The content of the request. This has a structure like:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_coverity.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def test_get_defects(self, filters, column_names, request_data):
coverity_service.retrieve_column_keys()
# Get defects
with patch.object(CoverityDefectService, "retrieve_issues") as mock_method:
coverity_service.get_defects(self.fake_stream, "", filters, column_names)
coverity_service.get_defects(self.fake_stream, filters, column_names, "")
data = mock_method.call_args[0][0]
mock_method.assert_called_once()
assert ordered(data) == ordered(request_data)
Expand Down Expand Up @@ -199,7 +199,7 @@ def test_get_defects_with_snapshot(self):
coverity_service.retrieve_column_keys()
# Get defects
with patch.object(CoverityDefectService, "retrieve_issues") as mock_method:
coverity_service.get_defects(self.fake_stream, "123", test_snapshot.filters, test_snapshot.column_names)
coverity_service.get_defects(self.fake_stream, test_snapshot.filters, test_snapshot.column_names, "123")
data = mock_method.call_args[0][0]
mock_method.assert_called_once()
assert ordered(data) == ordered(test_snapshot.request_data)
Expand Down

0 comments on commit 72a6cb1

Please sign in to comment.