Skip to content

Commit

Permalink
#141: Fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
MRichards99 committed Apr 13, 2021
1 parent 677424d commit 891f520
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
3 changes: 1 addition & 2 deletions datagateway_api/common/icat/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ def execute_query(self, client, return_json_formattable=False):
raise PythonICATError(e)

flat_query_includes = self.flatten_query_included_fields(self.query.includes)
mapped_distinct_fields = None

# If the query has a COUNT function applied to it, some of these steps can be
# skipped
Expand Down Expand Up @@ -262,7 +261,7 @@ def map_nested_attrs(self, nested_dict, split_attr_name, query_data):
else:
nested_dict[attr_name_pop] = {}
self.map_nested_attrs(
nested_dict[attr_name_pop], split_attr_name, query_data
nested_dict[attr_name_pop], split_attr_name, query_data,
)

return nested_dict
Expand Down
14 changes: 10 additions & 4 deletions test/icat/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,21 @@ class TestICATQuery:
id="Query with condition",
),
pytest.param(
None, "DISTINCT", None, {}, "DISTINCT", set(), id="Query with aggregate"
None,
"DISTINCT",
None,
{},
"DISTINCT",
set(),
id="Query with aggregate",
),
pytest.param(
None,
None,
["instrumentScientists"],
{},
None,
set(["instrumentScientists"]),
{"instrumentScientists"},
id="Query with included entity",
),
],
Expand Down Expand Up @@ -359,7 +365,7 @@ def test_valid_get_distinct_attributes(self, icat_client):
minute=1,
second=1,
tzinfo=timezone.utc,
)
),
],
{"startDate": "2020-01-04 01:01:01+00:00"},
id="Single date attribute",
Expand All @@ -382,7 +388,7 @@ def test_valid_get_distinct_attributes(self, icat_client):
{
"summary": "Summary 1",
"investigationUsers": {
"investigation": {"name": "Investigation Name 1"}
"investigation": {"name": "Investigation Name 1"},
},
},
id="Multiple attributes with 2-level nested related attribute",
Expand Down

0 comments on commit 891f520

Please sign in to comment.