Skip to content
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

Handling bigquery dialect when previewing data #5655

Merged
merged 3 commits into from
Aug 21, 2018

Conversation

sumedhsakdeo
Copy link
Contributor

BigQuery dialect does not like the use of backtick character in the column name when it is nested field/record type.

@sumedhsakdeo
Copy link
Contributor Author

PTAL @mistercrunch

@@ -1410,6 +1414,18 @@ def fetch_data(cls, cursor, limit):
data = [r.values() for r in data]
return data

"""
Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

"""
@classmethod
def _get_fields(cls, cols):
return [sqla.literal_column(c.get('name') + ' as ' + c.get('name').replace('.','__')) for c in cols]
Copy link
Member

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

Copy link
Member

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('.','__')))

Copy link
Contributor Author

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-io
Copy link

Codecov Report

Merging #5655 into master will decrease coverage by 14.15%.
The diff coverage is 80%.

Impacted file tree graph

@@             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
Impacted Files Coverage Δ
superset/db_engine_specs.py 54.42% <80%> (+0.12%) ⬆️
superset/views/core.py 73.93% <0%> (ø) ⬆️
...et/assets/src/dashboard/actions/dashboardLayout.js 97.59% <0%> (ø)
superset/assets/src/SqlLab/constants.js 100% <0%> (ø)
...re/components/controls/TimeSeriesColumnControl.jsx 88.46% <0%> (ø)
...et/assets/src/dashboard/components/SliceHeader.jsx 45.45% <0%> (ø)
.../assets/src/visualizations/parallel_coordinates.js 0% <0%> (ø)
...perset/assets/src/components/StackTraceMessage.jsx 58.33% <0%> (ø)
...dashboard/components/resizable/ResizableHandle.jsx 100% <0%> (ø)
...ts/src/dashboard/components/gridComponents/Row.jsx 94% <0%> (ø)
... and 306 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cc9324a...160bb22. Read the comment docs.

@mistercrunch mistercrunch merged commit 0fbda33 into apache:master Aug 21, 2018
mistercrunch pushed a commit to lyft/incubator-superset that referenced this pull request Aug 21, 2018
* Handling bigquery dialect when previewing data

* review comments

* lint

(cherry picked from commit 0fbda33)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Aug 22, 2018
* Handling bigquery dialect when previewing data

* review comments

* lint

(cherry picked from commit 0fbda33)
betodealmeida pushed a commit to lyft/incubator-superset that referenced this pull request Aug 22, 2018
* Handling bigquery dialect when previewing data

* review comments

* lint

(cherry picked from commit 0fbda33)
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
* Handling bigquery dialect when previewing data

* review comments

* lint
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.28.0 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.28.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants