Skip to content

Commit

Permalink
Handle default type name as str in param sources
Browse files Browse the repository at this point in the history
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
  • Loading branch information
danielmitterdorfer committed Apr 16, 2018
1 parent aff4786 commit 3a96dac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion eventdata/parameter_sources/elasticlogs_bulk_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ def __init__(self, track, params, **kwargs):
logger.debug("[bulk] Index pattern specified in parameters ({}) will be used".format(params['index']))

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

def partition(self, partition_index, total_partitions):
return self
Expand Down
3 changes: 2 additions & 1 deletion eventdata/parameter_sources/sample_based_bulk_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ def __init__(self, track, params, **kwargs):
logger.debug("[bulk] Index pattern specified in parameters ({}) will be used".format(params['index']))

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

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

0 comments on commit 3a96dac

Please sign in to comment.