These are chat archives for getredash/redash

19th
Mar 2015
michelecoleman
@michelecoleman
Mar 19 2015 02:47
Hi @arikfr . I've chatted with you some via email but I've found this chatroom now
We finally got a chance to update redash to the latest version this evening (I'm at GMT - 7). It is now at version 0.6.0+b731
michelecoleman
@michelecoleman
Mar 19 2015 02:57
Confirmed that queries with Redshift data are now displaying in my browser as M/D/YY. However, I did note that in the "Queries" view the "Created at" and "Last executed at" are still showing as DD/MM/YY. Not a problem, just not what I expected.
michelecoleman
@michelecoleman
Mar 19 2015 03:10
What @runa was talking about "but I've found something weird: sometimes, redash shows the column as empty" is also something that I've observed.
I now believe that that was behind my earlier bug report (in Google groups) about certain date formatting not working, but then it was working again, and later it was not working...very maddening non-reproducible bug.
Early on I thought the problem was that certain date formatting caused it to display blank results. However I can more reliably trigger the behavior this way:
Imagine I start with the following in a SELECT clause, in a query that is working perfectly:
TO_CHAR(c.start_date, 'MM-DD-YYYY' ) AS start_date,
Then I change it to
TO_CHAR(c.start_date, 'YYYY-MM-DD' ) AS start_date,
That gives me blanks in the start_date column
Then I change it to
TO_CHAR(c.start_date, 'YYYY-MM-DD' ) AS start_date1,
by just adding a 1 to the end of the column name. Now it works, no more blanks. Now I can change it back to
TO_CHAR(c.start_date, 'YYYY-MM-DD' ) AS start_date,
which is the exact same thing that failed a moment ago, and now it works.
This behavior was behind my original claim that the format string 'MM/DD/YYYY' was causing blank output. Now I don't think it was that at all. It was just that changing the formatting string at all, without making other changes, was causing blank output.
Still very weird.
I don't think that it's a question of certain weird characters triggering the problem. I'm using pretty vanilla ASCII. Also if it were weird characters then I'd think that adding a 1 to the end of the column name and then taking it off wouldn't fix it.
Another way I can fix it is to change the column name from "start_date" to "foo". Basically changing the column name makes it work.
As before if on the next iteration I change "foo" back to "start_date" then all is well.
Arik Fraimovich
@arikfr
Mar 19 2015 05:19
@michelecoleman about the "created at"/"last executed at" (and other dates) - I overlooked it, but will fix it too.
@michelecoleman as for the blank columns issue, I will try to reproduce it with your detailed report to try and understand what's going on.
@michelecoleman ok, managed to reproduce. expect a fix soon.
michelecoleman
@michelecoleman
Mar 19 2015 06:28
Cool. Glad my findings were helpful!
Arik Fraimovich
@arikfr
Mar 19 2015 07:00
@michelecoleman fixed. also fixed the dates issue in queries page (and another one I found). let me know if you still experince these issues after upgrading to latest version.
@runa latest version should fix the issues you had with columns going blank.
michelecoleman
@michelecoleman
Mar 19 2015 07:04
Great. Thanks! I can report back after we get that updated, though might not be right away.
Arik Fraimovich
@arikfr
Mar 19 2015 07:04
@michelecoleman no worries. when you get the chance.
martin sarsale
@runa
Mar 19 2015 14:15
@arikfr after updating master with the fabric task I had to install jsonschema manually
@arikfr now it's crashing with
==> /opt/redash/logs/celery_error.log <==
[2015-03-19 10:17:17,911: ERROR/MainProcess] Task redash.tasks.refresh_queries[8911aadd-9cd4-4d87-9953-16db158b5cba] raised unexpected: OperationalError('invalid connection option "register_hstore"\n',)
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 240, in trace_task
R = retval = fun(args, **kwargs)
File "/opt/redash/redash.0.6.0.b737/redash/tasks.py", line 23, in call
models.db.connect_db()
File "/opt/redash/redash.0.6.0.b737/redash/models.py", line 33, in connect_db
self.database.connect()
File "/usr/local/lib/python2.7/dist-packages/peewee.py", line 2250, in connect
self.local.closed = False
File "/usr/local/lib/python2.7/dist-packages/peewee.py", line 2186, in
exit
reraise(new_type, new_type(
exc_value.args), traceback)
File "/usr/local/lib/python2.7/dist-packages/peewee.py", line 2249, in connect
self.connect_kwargs)
File "/usr/local/lib/python2.7/dist-packages/playhouse/postgres_ext.py", line 256, in _connect
conn = super(PostgresqlExtDatabase, self)._connect(database,
kwargs)
File "/usr/local/lib/python2.7/dist-packages/peewee.py", line 2461, in _connect
conn = psycopg2.connect(database=database, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/psycopg2/init.py", line 164, in connect
conn = _connect(dsn, connection_factory=connection_factory, async=async)
OperationalError: invalid connection option "register_hstore"
@arikfr ok. pip -r did the trick
Arik Fraimovich
@arikfr
Mar 19 2015 14:36
@runa are you using a recent version of the fabric script? I've added installing all new requirements to it... (pip install -r requirements.txt)
martin sarsale
@runa
Mar 19 2015 15:01
@arikfr yep, yep. found it. it's working now
martin sarsale
@runa
Mar 19 2015 15:28
@arikfr umm.
==> logs/api_error.log <==
[2015-03-19 11:28:14,488][PID:898][INFO][root] [Manager][e2f561f82f4cf5aa340650c57d6df4bc] Inserting job
[2015-03-19 11:28:14,492][PID:898][INFO][root] [Manager][e2f561f82f4cf5aa340650c57d6df4bc] Created new job: 4260b6a1-6dcb-43f3-a3c7-05f9de4f8daf

==> logs/celery_error.log <==
[2015-03-19 11:28:14,501: ERROR/MainProcess] Task redash.tasks.execute_query[4260b6a1-6dcb-43f3-a3c7-05f9de4f8daf] raised unexpected: ValueError('No JSON object could be decoded',)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 240, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/opt/redash/redash.0.6.0.b737/redash/tasks.py", line 24, in __call__
    return super(BaseTask, self).__call__(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/celery/app/trace.py", line 437, in __protected_call__
    return self.run(*args, **kwargs)
  File "/opt/redash/redash.0.6.0.b737/redash/tasks.py", line 236, in execute_query
    query_runner = get_query_runner(data_source.type, data_source.options)
  File "/opt/redash/redash.0.6.0.b737/redash/query_runner/__init__.py", line 86, in get_query_runner
    return query_runner_class(json.loads(configuration_json))
  File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
@arikfr (it was a mysql query )
Arik Fraimovich
@arikfr
Mar 19 2015 16:10
@runa I assume you didn't, in this case you need to run the 3 new migrations manually:
sudo -u redash PYTHONPATH=. bin/run python migrations/0001_allow_delete_query.py
sudo -u redash PYTHONPATH=. bin/run python migrations/0002_...
sudo -u redash PYTHONPATH=. bin/run python migrations/0003_...
@runa actually you might have run 0001 already, so skip the ones you already did
martin sarsale
@runa
Mar 19 2015 16:17
@arikfr I like this kind of customer service; where you remember the migrations I've applied before :)
@arikfr it seems one of my datasources was wrongly defined. where can I manually edit those?
[DW-AR2] Old options: Server=dw-properati.local;User=properati;Pwd=x;Database=properati_dw_ar;
Traceback (most recent call last):
  File "migrations/0003_update_data_source_config.py", line 73, in <module>
    update(data_source)
  File "migrations/0003_update_data_source_config.py", line 36, in update
    k, v = value.split("=", 1)
ValueError: need more than 1 value to unpack
Arik Fraimovich
@arikfr
Mar 19 2015 16:23
@runa :-) in every thing I do, what I like most is helping people.
you can try: sudo -u redash psql rd -c "update data_sources set options='...' where name = 'DW-AR2';"
@runa I think the problem is the ';' at the end but I'm not sure
martin sarsale
@runa
Mar 19 2015 16:25
@arikfr there we go
Arik Fraimovich
@arikfr
Mar 19 2015 19:26
@runa is it working?
michelecoleman
@michelecoleman
Mar 19 2015 19:27
Are there any examples of pivot tables on the demo box?
Arik Fraimovich
@arikfr
Mar 19 2015 19:30
@michelecoleman no, because you can't save the pivots you create... I have to admit, it's a bit half baked feature.
martin sarsale
@runa
Mar 19 2015 19:31
@arikfr well, I've circumvented the old bug, so It was not happening anymore; so I cannot test it.
michelecoleman
@michelecoleman
Mar 19 2015 19:32
@arikfr : Okay, thanks
Arik Fraimovich
@arikfr
Mar 19 2015 19:33
@runa but did you manage to apply the migrations and get the queries to run again?
martin sarsale
@runa
Mar 19 2015 19:55
@arikfr ah. yes, yes. everything is great :)
Arik Fraimovich
@arikfr
Mar 19 2015 19:55
cool :)
martin sarsale
@runa
Mar 19 2015 20:43
@arikfr I suspect I'm missing features from redash; the pivots, I'm not sure how to use the cohorts. I would like more documentation :)
Arik Fraimovich
@arikfr
Mar 19 2015 21:05
@runa there are also filters, python query runners, query variables and more :-( I'm trying to improve documentation and add more information to the website (redash.io)... step by step.
martin sarsale
@runa
Mar 19 2015 21:06
@arikfr :)
Arik Fraimovich
@arikfr
Mar 19 2015 21:07
@runa re. cohorts, see example here: http://demo.redash.io/queries/67#84 cohorts don't have configuration (yet) so you need to provide columns with the names it expects (as in the example)
martin sarsale
@runa
Mar 19 2015 21:08
@arikfr thanks