rhunwicks commented on issue #3302: Create a PandasDatasource
URL: 
https://github.com/apache/incubator-superset/issues/3302#issuecomment-329776023
 
 
   One approach that might be relevant for writing custom connectors is 
https://github.com/yhat/pandasql.
   
   That project allows you to use SQLite-compatible SQL to query a Pandas 
Dataframe. It does it (AFAIK) by automatically serializing the dataframe to a 
temporary SQLite DB and then executing the query against it and reading back 
the result.
   
   In theory, that would allow us to create a new connector that inherited from 
`SqlaTable` and forced the database dialect to SQLite and then the existing 
`query()` method could be reused entirely. I don't know how functional it would 
be, but in theory if it serializes to a SQLite table and then executes the 
query using the real engine, then any valid SQLite query should work.
   
   I am not planning on using that approach myself, because I think that the 
overhead of serializing and then deserializing the rows will be too much, but 
it does solve some of the other problems, and so I am mentioning it here in 
case it is relevant for anyone else.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to