Skip to content

Commit

Permalink
Fix flake8 issues
Browse files Browse the repository at this point in the history
  • Loading branch information
emptyflash committed Jul 18, 2019
1 parent f02632e commit 3c44b31
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions luqum/elasticsearch/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def json(self):
field = self.field
inner_json = dict(self.field_options.get(field, {}))
result = inner_json.pop('match_type', None) # remove "match_type" key
if not result: # only pop the type key if match_type wasn't used (for backward compatibility)
if not result: # conditionally remove "type" (for backward compatibility)
inner_json.pop('type', None)
if self.method in ['query_string', 'multi_match']:
json = {self.method: inner_json}
Expand Down Expand Up @@ -96,9 +96,9 @@ def method(self):
if self._value_has_wildcard_char():
return 'query_string'
elif self._method.startswith("match"):
options = self.field_options.get(self.field, {})
# Support the type opiton for backward compatibility
return options.get("match_type", options.get("type", self._method))
options = self.field_options.get(self.field, {})
# Support the type opiton for backward compatibility
return options.get("match_type", options.get("type", self._method))
return self._method


Expand Down

0 comments on commit 3c44b31

Please sign in to comment.