Skip to content

Commit

Permalink
Merge pull request #34 from onesuper/feature/removel_mapping_using_co…
Browse files Browse the repository at this point in the history
…mpat

Feature/removel mapping using compat
  • Loading branch information
onesuper authored Jul 15, 2019
2 parents 1f6f399 + 39658a3 commit 590cf71
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pandasticsearch/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ def _build_query(self):

if self._filter:
assert isinstance(self._filter, BooleanFilter)
if self._compat == 5:
if self._compat >= 5:
query['query'] = {'bool': {'filter': self._filter.build()}}
else:
query['query'] = {'filtered': {'filter': self._filter.build()}}
Expand All @@ -507,7 +507,7 @@ def _get_cols(self, mapping):
cols = self._get_mappings(mapping, index)

if len(cols) == 0:
raise Exception('0 columns found in mapping')
raise DataFrameException('0 columns found in mapping')
return cols

@classmethod
Expand All @@ -531,4 +531,4 @@ def _get_mappings(self, json_map, index_name):
if self._doc_type is not None:
return DataFrame.resolve_mappings(json_map[index_name]["mappings"][self._doc_type]["properties"])
else:
raise Exception('Please specify mapping for ES version under 7')
raise DataFrameException('Please specify mapping for ES version under 7')

0 comments on commit 590cf71

Please sign in to comment.