-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Handling bigquery dialect when previewing data #5655
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
Conversation
PTAL @mistercrunch |
superset/db_engine_specs.py
Outdated
@@ -1410,6 +1414,18 @@ def fetch_data(cls, cursor, limit): | |||
data = [r.values() for r in data] | |||
return data | |||
|
|||
""" |
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: docstring goes inside the method
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.
done
superset/db_engine_specs.py
Outdated
""" | ||
@classmethod | ||
def _get_fields(cls, cols): | ||
return [sqla.literal_column(c.get('name') + ' as ' + c.get('name').replace('.','__')) for c in cols] |
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.
line too long, probably triggers the linter, we lie ~<80 and linter fires at 90
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.
how about literal_column(c.get('name')).label(c.get('name').replace('.','__')))
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.
Done. Is there a linter tool like yapf we can standardize on for this repo? So that folks can run it before publishing the PR.
Codecov Report
@@ Coverage Diff @@
## master #5655 +/- ##
===========================================
- Coverage 77.64% 63.49% -14.16%
===========================================
Files 46 360 +314
Lines 9208 22893 +13685
Branches 0 2549 +2549
===========================================
+ Hits 7150 14537 +7387
- Misses 2058 8341 +6283
- Partials 0 15 +15
Continue to review full report at Codecov.
|
* Handling bigquery dialect when previewing data * review comments * lint (cherry picked from commit 0fbda33)
* Handling bigquery dialect when previewing data * review comments * lint (cherry picked from commit 0fbda33)
* Handling bigquery dialect when previewing data * review comments * lint (cherry picked from commit 0fbda33)
* Handling bigquery dialect when previewing data * review comments * lint
BigQuery dialect does not like the use of backtick character in the column name when it is nested field/record type.