-
Notifications
You must be signed in to change notification settings - Fork 14.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Google spreadsheets #5915
Google spreadsheets #5915
Conversation
this.setState({ tableName }); | ||
this.props.actions.queryEditorSetSchema(this.props.queryEditor, schemaName); | ||
this.fetchTables(this.props.queryEditor.dbId, schemaName); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current code allows switching schema by typing new_schema.some_table
in the table selector. The code breaks when the table name has a period in it, since it does naive splitting. I opted for removing it here, since it seems a bit unintuitive as well.
@@ -159,11 +159,12 @@ class ExploreResultsButton extends React.PureComponent { | |||
</div>); | |||
} | |||
render() { | |||
const allowsSubquery = this.props.database && this.props.database.allows_subquery; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: deconstruct props on the line before then you can just use allows_subquery
in disabled
param
const {
database: {
allows_subquery
} } = this.props
https://github.com/lyft/marketdx/blob/master/src/components/Diagnosis/index.jsx#L55
@@ -2223,10 +2223,11 @@ def sqllab_viz(self): | |||
})) | |||
|
|||
@has_access | |||
@expose('/table/<database_id>/<table_name>/<schema>/') | |||
@expose('/table/<database_id>/<path:table_name>/<schema>/') | |||
@log_this | |||
def table(self, database_id, table_name, schema): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the path
doing for us here? is it a reference the param in the URI?
superset/db_engine_specs.py
Outdated
} | ||
|
||
@classmethod | ||
def select_star(cls, my_db, table_name, engine, schema=None, limit=100, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would put the limit
var as a class var at the top as DEFAULT_LIMIT = 100
Codecov Report
@@ Coverage Diff @@
## master #5915 +/- ##
==========================================
+ Coverage 73.31% 73.33% +0.01%
==========================================
Files 67 67
Lines 9594 9600 +6
==========================================
+ Hits 7034 7040 +6
Misses 2560 2560
Continue to review full report at Codecov.
|
LGTM |
* Google spreadsheets * Fetch table metadata in SQL Lab * Show full URL for spreadsheet * Fix version * Remove sqllab changes (cherry picked from commit f366bbe)
* Google spreadsheets * Fetch table metadata in SQL Lab * Show full URL for spreadsheet * Fix version * Remove sqllab changes (cherry picked from commit f366bbe)
* Google spreadsheets * Fetch table metadata in SQL Lab * Show full URL for spreadsheet * Fix version * Remove sqllab changes (cherry picked from commit f366bbe)
* Google spreadsheets * Fetch table metadata in SQL Lab * Show full URL for spreadsheet * Fix version * Remove sqllab changes (cherry picked from commit f366bbe)
* Google spreadsheets * Fetch table metadata in SQL Lab * Show full URL for spreadsheet * Fix version * Remove sqllab changes (cherry picked from commit f366bbe)
* Google spreadsheets * Fetch table metadata in SQL Lab * Show full URL for spreadsheet * Fix version * Remove sqllab changes (cherry picked from commit f366bbe)
* Google spreadsheets * Fetch table metadata in SQL Lab * Show full URL for spreadsheet * Fix version * Remove sqllab changes (cherry picked from commit f366bbe)
* Google spreadsheets * Fetch table metadata in SQL Lab * Show full URL for spreadsheet * Fix version * Remove sqllab changes (cherry picked from commit f366bbe)
* Google spreadsheets * Fetch table metadata in SQL Lab * Show full URL for spreadsheet * Fix version * Remove sqllab changes (cherry picked from commit f366bbe)
* Google spreadsheets * Fetch table metadata in SQL Lab * Show full URL for spreadsheet * Fix version * Remove sqllab changes (cherry picked from commit f366bbe)
* Google spreadsheets * Fetch table metadata in SQL Lab * Show full URL for spreadsheet * Fix version * Remove sqllab changes (cherry picked from commit f366bbe)
* Google spreadsheets * Fetch table metadata in SQL Lab * Show full URL for spreadsheet * Fix version * Remove sqllab changes (cherry picked from commit f366bbe)
Can anyone point to an example of setting up the datasource? I can setup the connection and test it fine, but once I save it raises an error. |
@neildunlop : Are you able to setup organization google sheet as datasource? |
@betodealmeida ping. I'd like some help setting this up as well. I tried setting up a datasource with a URL such as:
But I get the following error:
I haven't found any documentation that shows how to setup GSheets a data source, even though this PR shows it's possible. |
In data source put only "gsheets://" instead of full link. If you test it may give error but just save the data source and query the google sheet in SQL editor using full sheet link. But sheet should be public. |
Can you explain a bit about the workaround for private and org-based gSheets? |
This PR allow querying Google spreadsheets via SQL Alchemy, using a new module called gsheetsdb.
It works, but requires pushing some fixes upstream to
moz-sql-parser
.SQL Lab also works: