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

fix: Allow clickhouse dbs with timestamps to visualize queries #21446

Merged
merged 6 commits into from
Oct 3, 2022

Conversation

hughhhh
Copy link
Member

@hughhhh hughhhh commented Sep 12, 2022

SUMMARY

Clickhouse queries would fail with timestamps since we duck typing the columns types. This PR fixes this issue, but currently looking into a more robust solution for standardizing columns in side this ExploreMixin

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screen Shot 2022-09-12 at 3 09 16 PM

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@codecov
Copy link

codecov bot commented Sep 12, 2022

Codecov Report

Merging #21446 (75dc403) into master (18ec294) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

❗ Current head 75dc403 differs from pull request most recent head 19a0688. Consider uploading reports for the commit 19a0688 to get more accurate results

@@            Coverage Diff             @@
##           master   #21446      +/-   ##
==========================================
- Coverage   66.71%   66.70%   -0.01%     
==========================================
  Files        1796     1796              
  Lines       68716    68720       +4     
  Branches     7313     7313              
==========================================
  Hits        45843    45843              
- Misses      21011    21015       +4     
  Partials     1862     1862              
Flag Coverage Δ
hive 52.90% <0.00%> (-0.01%) ⬇️
mysql 78.20% <0.00%> (-0.01%) ⬇️
postgres 78.27% <0.00%> (-0.01%) ⬇️
presto 52.80% <0.00%> (-0.01%) ⬇️
python 81.39% <0.00%> (-0.01%) ⬇️
sqlite 76.76% <0.00%> (-0.01%) ⬇️
unit 50.91% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superset/models/helpers.py 39.04% <0.00%> (-0.18%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@zhaoyongjie
Copy link
Member

@hughhhh Could you post both SQL that changes before and after? Thanks!

@jinghua-qa jinghua-qa added the need:qa-review Requires QA review label Sep 26, 2022
@jinghua-qa
Copy link
Member

/testenv up

@github-actions
Copy link
Contributor

@jinghua-qa Ephemeral environment spinning up at http://34.220.56.32:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@jinghua-qa
Copy link
Member

Tested in preset workspace, able to see date column in chart-power query in explore. LGTM

@betodealmeida
Copy link
Member

Is the problem that the Clickhouse driver is returning columns that are dictionaries instead of ColumnTable objects? If so you can override the get_columns method of the Clickhouse DB engine spec to return and object instead of a dict.

@hughhhh
Copy link
Member Author

hughhhh commented Sep 28, 2022

@betodealmeida the implementation for columns in the Query model returns dict I'm working on another PR to standardize this for all Query.columns object in another PR that i'm currently working on. This is a patch to unblock people using clickhouse and want to explore using Query

@yousoph
Copy link
Member

yousoph commented Sep 30, 2022

/testenv up

@github-actions
Copy link
Contributor

@yousoph Ephemeral environment creation failed. Please check the Actions logs for details.

@yousoph
Copy link
Member

yousoph commented Sep 30, 2022

/testenv up

@github-actions
Copy link
Contributor

@yousoph Ephemeral environment spinning up at http://35.90.3.173:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@hughhhh hughhhh merged commit 4d0c2ba into master Oct 3, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2022

Ephemeral environment shutdown and build artifacts deleted.

sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Oct 3, 2022
@sadpandajoe
Copy link
Member

🏷️ preset:2022.39

@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 and removed 🚢 2.1.3 labels Mar 13, 2024
@mistercrunch mistercrunch deleted the fix-clickhouse-cpq branch March 26, 2024 16:11
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 need:qa-review Requires QA review size/M 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants