Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
V1NAY8 committed Mar 31, 2022
1 parent ba97ee4 commit 9c9a8fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions eland/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ def _metric_aggs(
fields=fields,
es_aggs=es_aggs,
pd_aggs=pd_aggs,
response=response,
response=response, # type: ignore
numeric_only=numeric_only,
is_dataframe_agg=is_dataframe_agg,
percentiles=percentiles,
Expand Down Expand Up @@ -453,7 +453,7 @@ def _terms_aggs(
body.terms_aggs(field, func, field, es_size=es_size)

response = query_compiler._client.search(
index=query_compiler._index_pattern, size=0, body=body.to_search_body()
index=query_compiler._index_pattern, size=0, **body.to_search_body()
)

results = {}
Expand Down Expand Up @@ -499,7 +499,7 @@ def _hist_aggs(
body.hist_aggs(field, field, min_aggs[field], max_aggs[field], num_bins)

response = query_compiler._client.search(
index=query_compiler._index_pattern, size=0, body=body.to_search_body()
index=query_compiler._index_pattern, size=0, **body.to_search_body()
)
# results are like
# "aggregations" : {
Expand Down Expand Up @@ -1040,7 +1040,7 @@ def bucket_generator(
res = query_compiler._client.search(
index=query_compiler._index_pattern,
size=0,
body=body.to_search_body(),
**body.to_search_body(),
)

# Pagination Logic
Expand Down Expand Up @@ -1539,7 +1539,7 @@ def _search_yield_hits(

try:
pit_id = client.open_point_in_time(
index=query_compiler._index_pattern, keep_alive=DEFAULT_PIT_KEEP_ALIVE
index=query_compiler._index_pattern, keep_alive=DEFAULT_PIT_KEEP_ALIVE # type: ignore
)["id"]

# Modify the search with the new point in time ID and keep-alive time.
Expand Down
4 changes: 2 additions & 2 deletions eland/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,11 @@ def to_search_body(self) -> Dict[str, Any]:
body["query"] = self._query.build()
return body

def to_count_body(self) -> Optional[Dict[str, Any]]:
def to_count_body(self) -> Dict[str, Any]:
if len(self._aggs) > 0:
warnings.warn(f"Requesting count for agg query {self}")
if self._query.empty():
return None
return {}
else:
return {"query": self._query.build()}

Expand Down

0 comments on commit 9c9a8fc

Please sign in to comment.