These are chat archives for getredash/redash

1st
Oct 2016
HenroRitchie
@HenroRitchie
Oct 01 2016 13:40
Hi All. Is it possible to open a txt file with JSON formatted data residing on the same server redash is running on?
HenroRitchie
@HenroRitchie
Oct 01 2016 14:40
Is there a limit to how big the table can be. It seems to be limited to 200 pages
orczyk
@orczyk
Oct 01 2016 19:30
@Arik, not sure how do you want me to share it but here it is:

import pandas as pd

def df_to_results(df):

data_types = {'object': 'text', 'float64':'float', 'int64': 'integer'}

result = {'rows' : [ x[1].to_dict() for x in df.iterrows() ], 
'columns' : [{u'friendly_name': x, u'type': data_types[df[x].dtypes.name], u'name': x} for x in df.columns]}    

return result

result = df_to_results(df)

Arik Fraimovich
@arikfr
Oct 01 2016 19:31
@HenroRitchie you can use the script data source for this. or write a new one that reads file, should be simple enough. as for size limit - it's mainly limited by the server memory & your browser.
@orczyk looks good (except that we don't have "text" type - it's string).
orczyk
@orczyk
Oct 01 2016 19:32
yes, I had some problems with types definition
Arik Fraimovich
@arikfr
Oct 01 2016 19:33
@biakaveron check the api_error.log when saving & the browser console.
Ivan Brotkin
@biakaveron
Oct 01 2016 19:35

@arikfr [2016-10-01 19:34:06,010][PID:10210][INFO][metrics] method=POST path=/api/events endpoint=events status=500 content_type=? content_length=-1 duration=26.48 query_count=3 query_duration=4.68

while accessing /destinations page

@arikfr [2016-10-01 19:35:28,103][PID:10221][INFO][metrics] method=POST path=/api/destinations endpoint=destinations status=500 content_type=application/json content_length=36 duration=55.52 query_count=5 query_duration=31.82
[2016-10-01 19:35:28,103][PID:10221][INFO][metrics] method=POST path=/api/destinations endpoint=destinations status=500 content_type=? content_length=-1 duration=56.47 query_count=5 query_duration=31.82

on saving

Arik Fraimovich
@arikfr
Oct 01 2016 19:36
no other messages?
Ivan Brotkin
@biakaveron
Oct 01 2016 19:36
nope
Arik Fraimovich
@arikfr
Oct 01 2016 19:36
strange
Ivan Brotkin
@biakaveron
Oct 01 2016 19:37
my bad
[2016-10-01 19:35:28,086][PID:10221][ERROR][peewee] INSERT INTO "notification_destinations" ("org_id", "user_id", "name", "type", "options", "created_at") VALUES (%s, %s, %s, %s, %s, %s) RETURNING "id" [1, 1, u'123test', u'email', '{"addresses": "biakaveron@gmail.com"}', datetime.datetime(2016, 10, 1, 19, 35, 28, 61611)]
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/playhouse/postgres_ext.py", line 360, in execute_sql
cursor.execute(sql, params or ())
ProgrammingError: relation "notification_destinations" does not exist
LINE 1: INSERT INTO "notification_destinations" ("org_id", "user_id"...
was above
Arik Fraimovich
@arikfr
Oct 01 2016 19:37
looks like you didn't run migrations.
Ivan Brotkin
@biakaveron
Oct 01 2016 19:39
hmmm, it was a fabfile.py and I saw migrations in console output... will try again, thanks
Arik Fraimovich
@arikfr
Oct 01 2016 19:39
on second try it won't run migrations
you will need to do it manually
Ivan Brotkin
@biakaveron
Oct 01 2016 19:48
0023_add_notification_destination.py was what I need. thank you for help :)
Arik Fraimovich
@arikfr
Oct 01 2016 19:50
:+1: