Skip to content

Commit 3a96dac

Browse files
Handle default type name as str in param sources
With this commit our parameter sources handle the default type name as string by default and implement a fallback to treat it as a structured object (as in earlier versions of Rally) Relates #7
1 parent aff4786 commit 3a96dac

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

eventdata/parameter_sources/elasticlogs_bulk_source.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ def __init__(self, track, params, **kwargs):
6868
logger.debug("[bulk] Index pattern specified in parameters ({}) will be used".format(params['index']))
6969

7070
if 'type' not in params.keys():
71-
self._params['type'] = self._indices[0].types[0].name
71+
t = self._indices[0].types[0]
72+
self._params['type'] = t if isinstance(t, str) else t.name
7273

7374
def partition(self, partition_index, total_partitions):
7475
return self

eventdata/parameter_sources/sample_based_bulk_source.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ def __init__(self, track, params, **kwargs):
100100
logger.debug("[bulk] Index pattern specified in parameters ({}) will be used".format(params['index']))
101101

102102
if 'type' not in params.keys():
103-
self._params['type'] = self._indices[0].types[0].name
103+
t = self._indices[0].types[0]
104+
self._params['type'] = t if isinstance(t, str) else t.name
104105

105106
if 'timestamp_field' not in params.keys():
106107
self._params['timestamp_field'] = []

0 commit comments

Comments
 (0)