Repository: RPing/influx-prompt

Issue:
Empty values bug
influx-prompt
```
root> SHOW CONTINUOUS QUERIES
Traceback (most recent call last):
  File "/home/rpchen1228/.pyenv/versions/3.6.4/bin/influx-prompt", line 8, in <module>
    sys.exit(cli())
  File "/home/rpchen1228/.pyenv/versions/3.6.4/lib/python3.6/site-packages/influx_prompt/main.py", line 176, in cli
    influx_prompt.run_cli()
  File "/home/rpchen1228/.pyenv/versions/3.6.4/lib/python3.6/site-packages/influx_prompt/main.py", line 95, in run_cli
    arr = json_to_tabular_result(result)
  File "/home/rpchen1228/.pyenv/versions/3.6.4/lib/python3.6/site-packages/influx_prompt/tabular.py", line 27, in json_to_tabular_result
    values = series['values']
KeyError: 'values'
```

Official cli
```
> SHOW CONTINUOUS QUERIES
name: _internal
name query
---- -----

name: NOAA_water_database
name query
---- -----
> 
```

Discussion:

Patch:
diff --git a/influx_prompt/main.py b/influx_prompt/main.py
index 302b02b..4e95b6f 100644
--- a/influx_prompt/main.py
+++ b/influx_prompt/main.py
@@ -34,17 +34,17 @@ class InfluxPrompt(object):
             ('blue', 'o'),
             ('indigo', 'm'),
             ('purple', 'e'),
-            ('', '!')
+            ('', '! ')
         ]), end='')
         print_formatted_text(FormattedText([
-            ('', 'Any issue please post to '),
+            ('', 'Open an issue here: '),
             ('ansibrightgreen', 'https://github.com/RPing/influx-prompt/issues'),
         ]))
         if self.args['database'] is None:
             print_formatted_text(FormattedText([
                 ('ansibrightyellow', '[Warning] '),
             ]), end='')
-            print('You havn\'t set database. '
+            print('You haven\'t set database. '
                   'use "use <database>" to specify database.')
 
         session = PromptSession(
diff --git a/influx_prompt/tabular.py b/influx_prompt/tabular.py
index 149f2fc..aadfcd9 100644
--- a/influx_prompt/tabular.py
+++ b/influx_prompt/tabular.py
@@ -20,9 +20,9 @@ def json_to_tabular_result(j):
         series_list = rr.series.r(default=None)
 
         for series in series_list:
-            name = series['name']
-            columns = series['columns']
-            values = series['values']
+            name = series.get('name')
+            columns = series.get('columns')
+            values = series.get('values', [])
 
             column_amount = len(columns)
             longest_value_len = [0] * column_amount


Test patch:
diff --git a/tests/test_tabular.py b/tests/test_tabular.py
index 74445c8..57d4bae 100644
--- a/tests/test_tabular.py
+++ b/tests/test_tabular.py
@@ -16,6 +16,41 @@ def test_error_in_json():
     ]
 
 
+def test_no_value_key():
+    j = {
+        'results': [{
+            'statement_id': 0,
+            'series': [
+                {'name': '_internal', 'columns': ['name', 'query']},
+                {'name': 'NOAA_water_database', 'columns': ['name', 'query']},
+            ]
+        }]
+    }
+    result = json_to_tabular_result(j)
+    assert result == [
+        ('', 'name: '),
+        ('ansibrightgreen', '_internal'),
+        ('', '\n'),
+        ('orange', 'name  '),
+        ('orange', 'query  '),
+        ('', '\n'),
+        ('orange', '---   '),
+        ('orange', '---    '),
+        ('', '\n'),
+        ('', '\n'),
+        ('', 'name: '),
+        ('ansibrightgreen', 'NOAA_water_database'),
+        ('', '\n'),
+        ('orange', 'name  '),
+        ('orange', 'query  '),
+        ('', '\n'),
+        ('orange', '---   '),
+        ('orange', '---    '),
+        ('', '\n'),
+        ('', '\n'),
+    ]
+
+
 def test_ordinary_json():
     j = {
         'results': [{