diff --git a/syngenta_digital_dta/elasticsearch/es_mapper.py b/syngenta_digital_dta/elasticsearch/es_mapper.py index 44c7608..102ba1d 100644 --- a/syngenta_digital_dta/elasticsearch/es_mapper.py +++ b/syngenta_digital_dta/elasticsearch/es_mapper.py @@ -42,7 +42,10 @@ def __translate_simple_type(property_value): elif property_value.get('type') == 'number': mapping_type = {'type': 'long'} elif property_value.get('type') == 'string': - mapping_type = {'type': 'text'} + if property_value.get('format', '') == 'byte': + mapping_type = {'type': 'binary'} + else: + mapping_type = {'type': 'text'} elif property_value.get('type') == 'array': mapping_type = None else: diff --git a/tests/syngenta_digital_dta/s3/test_s3.py b/tests/syngenta_digital_dta/s3/test_s3.py index ca90589..f753627 100644 --- a/tests/syngenta_digital_dta/s3/test_s3.py +++ b/tests/syngenta_digital_dta/s3/test_s3.py @@ -28,8 +28,17 @@ def setUp(self, *args, **kwargs): def __create_unit_test_bucket(self): try: - s3_client = boto3.client('s3', endpoint_url=self.endpoint) - s3_client.create_bucket(Bucket=self.bucket) + s3_client = boto3.client( + "s3", + endpoint_url=self.endpoint, + region_name="us-east-2", + ) + s3_client.create_bucket( + Bucket=self.bucket, + CreateBucketConfiguration={ + 'LocationConstraint': 'us-east-2' + } + ) except: pass