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

WIP: Registry to datasourcedao #19811

Closed
wants to merge 6 commits into from

Conversation

pkdotson
Copy link
Member

SUMMARY

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

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

@@ -19,7 +19,6 @@
from werkzeug.local import LocalProxy

from superset.app import create_app
from superset.connectors.connector_registry import ConnectorRegistry
from superset.extensions import (
Copy link
Member

@eschutho eschutho May 3, 2022

Choose a reason for hiding this comment

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

you're going to want to add the datasourceDao in here so that you can reference it later like from superset import DatasourceDAO

@@ -21,25 +21,25 @@

from superset.common.chart_data import ChartDataResultType
from superset.common.query_object import QueryObject
from superset.dao.datasource import DatasourceDAO
Copy link
Member

@eschutho eschutho May 3, 2022

Choose a reason for hiding this comment

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

use from superset import DatasourceDAO here like ConnectorRegistry was below in the type_checking

@@ -21,25 +21,25 @@

from superset.common.chart_data import ChartDataResultType
from superset.common.query_object import QueryObject
from superset.dao.datasource import DatasourceDAO
from superset.utils.core import apply_max_row_limit, DatasourceDict
from superset.utils.date_parser import get_since_until

if TYPE_CHECKING:
from sqlalchemy.orm import sessionmaker

Copy link
Member

Choose a reason for hiding this comment

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

put the new import here

from superset.commands.base import BaseCommand
from superset.connectors.sqla.models import SqlaTable, SqlMetric, TableColumn
from superset.dao.datasource import DatasourceDAO
Copy link
Member

Choose a reason for hiding this comment

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

use from superset import DatasourceDAO

from superset.common.request_contexed_based import is_user_admin
from superset.connectors.base.models import BaseDatasource
from superset.connectors.druid.models import DruidColumn, DruidMetric
from superset.connectors.sqla.models import SqlMetric, TableColumn
from superset.dao.datasource import DatasourceDAO
Copy link
Member

Choose a reason for hiding this comment

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

use from superset import DatasourceDAO

@@ -39,7 +39,8 @@
from sqlalchemy.orm import relationship
from sqlalchemy.orm.mapper import Mapper

from superset import ConnectorRegistry, db, is_feature_enabled, security_manager
from superset import db, is_feature_enabled, security_manager
from superset.dao.datasource import DatasourceDAO
Copy link
Member

Choose a reason for hiding this comment

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

use from superset import DatasourceDAO

@pkdotson pkdotson force-pushed the registry-to-datasourcedao branch from 3786e29 to e5c1479 Compare May 5, 2022 04:41
@pkdotson pkdotson closed this May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants