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

Add support for Cockroach DB #9043

Merged
merged 3 commits into from Feb 8, 2020
Merged

Add support for Cockroach DB #9043

merged 3 commits into from Feb 8, 2020

Conversation

derari
Copy link
Contributor

@derari derari commented Jan 29, 2020

CATEGORY

Choose one

  • Bug Fix
  • Enhancement (new features, refinement)
  • Refactor
  • Add tests
  • Build / Development Environment
  • Documentation

SUMMARY

Adds support for Cockroach DB.

I could not test the change becaues the container always fails with

superset_1         | standard_init_linux.go:211: exec user process caused "no such file or directory"

but this seems unrelated to my change.

So far I could use Cockroach DB in superset even without explicit support, only the time grain options were missing.

I verified that the time grain options declared by PostgresEngineSpec work with Cockroach DB.

TEST PLAN

Add a Cockroach DB datasource, add tables and test charts.

ADDITIONAL INFORMATION

  • Has associated issue: Fixes Add support for cockroach db #9032
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

REVIEWERS

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

First pass comments. Please also add a note that CockroachDB is supported both in /docs/index.rst (in the bullet list) and /docs/installation.rst (in the table). You also need to run black to make sure the code is uniformly formatted.

@@ -16,6 +16,7 @@
#
black==19.3b0
coverage==4.5.3
cockroachdb==0.3.3
Copy link
Member

Choose a reason for hiding this comment

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

This needs to be moved to extras_require in setup.py.

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

Comment on lines 17 to 28
from datetime import datetime
from typing import List, Optional, Tuple, TYPE_CHECKING

from pytz import _FixedOffset # type: ignore
from sqlalchemy.dialects.postgresql.base import PGInspector

from superset.db_engine_specs.base import LimitMethod
from superset.db_engine_specs.postgres import PostgresEngineSpec

if TYPE_CHECKING:
# prevent circular imports
from superset.models.core import Database # pylint: disable=unused-import
Copy link
Member

Choose a reason for hiding this comment

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

You seem to be importing lots of things that aren't being used in this file. If you check CI logs you will see that this is failing builds.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

file is cleaned

@codecov-io
Copy link

Codecov Report

Merging #9043 into master will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9043      +/-   ##
==========================================
+ Coverage   59.43%   59.45%   +0.01%     
==========================================
  Files         369      369              
  Lines       11743    11747       +4     
  Branches     2884     2888       +4     
==========================================
+ Hits         6980     6984       +4     
  Misses       4584     4584              
  Partials      179      179
Impacted Files Coverage Δ
superset/assets/src/components/TableSelector.jsx 78.35% <0%> (+0.32%) ⬆️
...uperset/assets/src/dashboard/components/Header.jsx 42.06% <0%> (+0.93%) ⬆️

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 a4ed075...1eb114d. Read the comment docs.

@derari derari requested a review from villebro January 30, 2020 11:02
Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

LGTM; did you get everything to work, or are there any caveats?

@ynohat
Copy link

ynohat commented Feb 7, 2020

@derari thanks a lot for your work on this!

I tried to apply the changes in this PR manually, and it didn't work OOTB with docker-compose. It seems like adding the cockroach dep to setup.py is not sufficient, it also needs to be added to docker/requirements-extra.txt.

This is first contact with superset for me, so forgive me if this comment is incorrect or misguided!

@villebro villebro merged commit 0cf354c into apache:master Feb 8, 2020
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.36.0 labels Feb 28, 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 size/M 🚢 0.36.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for cockroach db
6 participants