From ba18670d5b6a01917ef4b1bb80cab636ae5eab14 Mon Sep 17 00:00:00 2001 From: Deep Ganguli Date: Thu, 13 Feb 2014 13:48:53 -0800 Subject: [PATCH] export_tsv raises NotImplementedError if necessary --- .gitignore | 2 ++ pydruid/client.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index e00065f6..ddbbf9a0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ *.pyc test.py +pydruid/bard.py +.idea/ \ No newline at end of file diff --git a/pydruid/client.py b/pydruid/client.py index 8c64b962..827af09c 100755 --- a/pydruid/client.py +++ b/pydruid/client.py @@ -80,6 +80,8 @@ def export_tsv(self, dest_path): header = self.result[0]['event'].keys() header.append('timestamp') header.append('version') + else: + raise NotImplementedError('TSV export not implemented for query type: {0}'.format(self.query_type)) tsv_file.writerow(header) @@ -123,9 +125,7 @@ def export_pandas(self): for v in self.result] nres = [dict(v) for v in nres] else: - raise NotImplementedError( - 'Pandas export not implemented for query type: {0}' - .format(self.query_type)) + raise NotImplementedError('Pandas export not implemented for query type: {0}'.format(self.query_type)) df = pandas.DataFrame(nres) return df