Skip to content

Commit

Permalink
Code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathieu Martin committed Oct 1, 2020
1 parent cd16747 commit 1bb60b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions scripts/schema/oss.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
'version': 'keyword'
}


def fallback(fields):
"""Verify all fields for basic data type usage, and fallback to an OSS equivalent if appropriate."""
visitor.visit_fields(fields, field_func=perform_fallback)
Expand Down
8 changes: 4 additions & 4 deletions scripts/tests/unit/test_schema_oss.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ def setUp(self):
self.maxDiff = None

def test_wildcard_fallback(self):
field = { 'field_details': { 'name': 'myfield', 'type': 'wildcard' } }
field = {'field_details': {'name': 'myfield', 'type': 'wildcard'}}
oss.perform_fallback(field)
self.assertEqual('keyword', field['field_details']['type'])

def test_version_fallback(self):
field = { 'field_details': { 'name': 'myfield', 'type': 'version' } }
field = {'field_details': {'name': 'myfield', 'type': 'version'}}
oss.perform_fallback(field)
self.assertEqual('keyword', field['field_details']['type'])

def test_basic_without_fallback(self):
field = { 'field_details': { 'name': 'myfield', 'type': 'histogram' } }
field = {'field_details': {'name': 'myfield', 'type': 'histogram'}}
oss.perform_fallback(field)
self.assertEqual('histogram', field['field_details']['type'])

def test_oss_no_fallback(self):
field = { 'field_details': { 'name': 'myfield', 'type': 'keyword' } }
field = {'field_details': {'name': 'myfield', 'type': 'keyword'}}
oss.perform_fallback(field)
self.assertEqual('keyword', field['field_details']['type'])

0 comments on commit 1bb60b8

Please sign in to comment.