You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by hu...@apache.org on 2021/05/19 17:51:14 UTC

[superset] 01/01: fix merge conflict

This is an automated email from the ASF dual-hosted git repository.

hugh pushed a commit to branch hugh/bg-form
in repository https://gitbox.apache.org/repos/asf/superset.git

commit a77bf2c955f886ebd90c634f0a350dc320306058
Merge: 3a05e98 4160e45
Author: hughhhh <hu...@gmail.com>
AuthorDate: Wed May 19 13:48:39 2021 -0400

    fix merge conflict

 CONTRIBUTING.md                                    |   2 +-
 docs/installation.rst                              |   2 +-
 .../cypress/integration/database/modal.test.ts     |   7 +-
 superset-frontend/package-lock.json                | 791 ++++++++-------------
 superset-frontend/package.json                     |  59 +-
 .../dashboard/components/SliceAdder_spec.jsx       |   4 +-
 .../components/ControlPanelsContainer_spec.tsx     |   7 +-
 ...n_spec.jsx => ExploreAdditionalActionsMenu.jsx} |  14 +-
 .../spec/javascripts/sqllab/QuerySearch_spec.jsx   |   5 +-
 .../spec/javascripts/sqllab/QueryTable_spec.jsx    |  25 +-
 .../spec/javascripts/sqllab/ResultSet_spec.jsx     |   5 +-
 .../spec/javascripts/sqllab/fixtures.ts            |  14 +
 .../src/SqlLab/components/QueryTable.jsx           |  13 +-
 .../src/SqlLab/components/ResultSet.tsx            | 150 +++-
 .../src/SqlLab/components/SouthPane/SouthPane.tsx  |  22 +-
 .../src/SqlLab/components/SouthPane/state.ts       |   1 +
 .../src/SqlLab/components/SqlEditor.jsx            |   1 +
 .../src/SqlLab/components/TableElement.jsx         |   2 +-
 superset-frontend/src/SqlLab/main.less             |   6 +-
 superset-frontend/src/assets/staticPages/404.html  |   2 +-
 superset-frontend/src/common/components/index.tsx  |  31 +-
 .../components/FilterableTable/FilterableTable.tsx |   4 +-
 superset-frontend/src/components/Label/index.tsx   |   1 +
 .../src/components/ListView/Filters/Search.tsx     |  10 +-
 .../src/components/Menu/LanguagePicker.test.tsx    |  25 +-
 .../src/components/Menu/LanguagePicker.tsx         |  97 +--
 .../src/components/Menu/Menu.test.tsx              |   2 +-
 superset-frontend/src/components/Menu/Menu.tsx     |  21 +-
 .../src/components/Menu/MenuRight.tsx              |  12 +-
 superset-frontend/src/components/Select/styles.tsx |   2 +-
 .../src/dashboard/components/AddSliceCard.jsx      |  69 +-
 .../src/dashboard/components/SliceAdder.jsx        |  66 +-
 .../components/SliceHeader/SliceHeader.test.tsx    |   1 +
 .../src/dashboard/components/SliceHeader/index.tsx |  15 +-
 .../components/SliceHeaderControls/index.jsx       |  19 +
 .../dashboard/components/gridComponents/Chart.jsx  |   1 +
 .../dashboard/stylesheets/builder-sidepane.less    |  57 --
 .../src/explore/components/ControlHeader.jsx       |  21 +-
 .../explore/components/ControlPanelsContainer.tsx  |  20 +-
 .../src/explore/components/ControlRow.tsx          |  16 +-
 .../src/explore/components/EmbedCodeButton.jsx     |   6 +-
 .../explore/components/ExploreActionButtons.tsx    |  38 +-
 .../ExploreAdditionalActionsMenu.test.tsx}         |  26 +-
 .../index.jsx                                      | 109 +--
 .../src/explore/components/ExploreChartPanel.jsx   |   6 +-
 .../explore/components/ExploreViewContainer.jsx    |  25 +-
 .../DndColumnSelectControl/DndSelectLabel.test.tsx |  12 +-
 .../DndColumnSelectControl/DndSelectLabel.tsx      |   4 +-
 .../controls/DndColumnSelectControl/Option.tsx     |   4 +-
 .../controls/FilterControl/AdhocFilter/index.js    |  13 +-
 .../FilterControl/AdhocFilterControl/index.jsx     |  15 +-
 ...AdhocFilterEditPopoverSimpleTabContent.test.jsx |  78 ++
 .../index.jsx                                      |  23 +-
 .../AdhocFilterOption/AdhocFilterOption.test.tsx   |  24 +-
 .../controls/MetricControl/MetricsControl.jsx      |  15 +-
 .../OptionControls/OptionControls.test.tsx         |  34 +-
 .../components/controls/OptionControls/index.tsx   |  34 +-
 .../explore/components/controls/ViewQueryModal.tsx | 112 +++
 .../src/explore/components/optionRenderers.tsx     |   5 +-
 superset-frontend/src/explore/constants.ts         |   5 +
 superset-frontend/src/explore/main.less            |  24 -
 .../components/SyntaxHighlighterCopy/index.tsx     |  10 +-
 .../CRUD/data/database/DatabaseModal/index.tsx     |  58 +-
 .../CRUD/data/database/DatabaseModal/styles.ts     |  77 +-
 superset-frontend/stylesheets/superset.less        |  21 -
 superset-frontend/webpack.config.js                |   1 -
 superset/app.py                                    |  20 +-
 .../sqllab/ExploreCtasResultsButton_spec.jsx       |  78 --
 .../SqlLab/components/ExploreCtasResultsButton.jsx | 131 ----
 superset/assets/version_info.json                  |   0
 superset/connectors/sqla/models.py                 |   4 +
 superset/databases/api.py                          |   2 +
 superset/databases/schemas.py                      |   4 +-
 superset/datasets/commands/export.py               |   2 +-
 superset/datasets/commands/importers/v1/utils.py   |   2 +-
 superset/datasets/schemas.py                       |   2 +-
 superset/db_engine_specs/base.py                   |  24 +-
 superset/db_engine_specs/mysql.py                  |  19 +-
 superset/db_engine_specs/postgres.py               |   2 +
 superset/models/core.py                            |  13 +
 superset/utils/core.py                             |   2 +
 superset/views/base.py                             |  30 +-
 superset/views/core.py                             |   2 +-
 superset/views/dynamic_plugins.py                  |  12 +
 tests/databases/api_tests.py                       | 139 +++-
 tests/datasets/commands_tests.py                   |   2 +-
 tests/db_engine_specs/mysql_tests.py               |   6 +
 tests/db_engine_specs/postgres_tests.py            |  11 +-
 tests/dynamic_plugins_tests.py                     |  40 ++
 tests/fixtures/importexport.py                     |   2 +-
 tests/sqla_models_tests.py                         |  12 +-
 91 files changed, 1636 insertions(+), 1326 deletions(-)

diff --cc tests/databases/api_tests.py
index 2e1d9f7,7f53c57..4af5830
--- a/tests/databases/api_tests.py
+++ b/tests/databases/api_tests.py
@@@ -36,7 -36,7 +36,8 @@@ from superset import db, security_manag
  from superset.connectors.sqla.models import SqlaTable
  from superset.db_engine_specs.mysql import MySQLEngineSpec
  from superset.db_engine_specs.postgres import PostgresEngineSpec
 +from superset.db_engine_specs.bigquery import BigQueryEngineSpec
+ from superset.db_engine_specs.hana import HanaEngineSpec
  from superset.errors import SupersetError
  from superset.models.core import Database, ConfigurationMethod
  from superset.models.reports import ReportSchedule, ReportScheduleType
@@@ -1368,11 -1370,10 +1371,11 @@@ class TestDatabaseApi(SupersetTestCase)
      @mock.patch("superset.databases.api.get_available_engine_specs")
      @mock.patch("superset.databases.api.app")
      def test_available(self, app, get_available_engine_specs):
 -        app.config = {"PREFERRED_DATABASES": ["postgresql"]}
 +        app.config = {"PREFERRED_DATABASES": ["postgresql", "bigquery"]}
          get_available_engine_specs.return_value = [
-             MySQLEngineSpec,
              PostgresEngineSpec,
 +            BigQueryEngineSpec,
+             HanaEngineSpec,
          ]
  
          self.login(username="admin")
@@@ -1424,23 -1428,73 +1430,90 @@@
                      "preferred": True,
                      "sqlalchemy_uri_placeholder": "postgresql+psycopg2://user:password@host:port/dbname[?key=value&key=value...]",
                  },
 +                {
 +                    "engine": "bigquery",
 +                    "name": "Google BigQuery",
 +                    "parameters": {
 +                        "properties": {
 +                            "credentials_json": {
 +                                "additionalProperties": {},
 +                                "description": "credentials for bigquery",
 +                                "type": "object",
 +                            }
 +                        },
 +                        "type": "object",
 +                    },
 +                    "preferred": true,
 +                    "sqlalchemy_uri_placeholder": "bigquery://{project_id}",
 +                },
 +                {"engine": "mysql", "name": "MySQL", "preferred": False},
+                 {"engine": "hana", "name": "SAP HANA", "preferred": False},
+             ]
+         }
+ 
+     @mock.patch("superset.databases.api.get_available_engine_specs")
+     @mock.patch("superset.databases.api.app")
+     def test_available_with_mysql(self, app, get_available_engine_specs):
+         app.config = {"PREFERRED_DATABASES": ["mysql"]}
+         get_available_engine_specs.return_value = [
+             MySQLEngineSpec,
+             HanaEngineSpec,
+         ]
+ 
+         self.login(username="admin")
+         uri = "api/v1/database/available/"
+ 
+         rv = self.client.get(uri)
+         response = json.loads(rv.data.decode("utf-8"))
+         print(response)
+         assert rv.status_code == 200
+         assert response == {
+             "databases": [
+                 {
+                     "engine": "mysql",
+                     "name": "MySQL",
+                     "parameters": {
+                         "properties": {
+                             "database": {
+                                 "description": "Database name",
+                                 "type": "string",
+                             },
+                             "encryption": {
+                                 "description": "Use an encrypted connection to the database",
+                                 "type": "boolean",
+                             },
+                             "host": {
+                                 "description": "Hostname or IP address",
+                                 "type": "string",
+                             },
+                             "password": {
+                                 "description": "Password",
+                                 "nullable": True,
+                                 "type": "string",
+                             },
+                             "port": {
+                                 "description": "Database port",
+                                 "format": "int32",
+                                 "type": "integer",
+                             },
+                             "query": {
+                                 "additionalProperties": {},
+                                 "description": "Additional parameters",
+                                 "type": "object",
+                             },
+                             "username": {
+                                 "description": "Username",
+                                 "nullable": True,
+                                 "type": "string",
+                             },
+                         },
+                         "required": ["database", "host", "port", "username"],
+                         "type": "object",
+                     },
+                     "preferred": True,
+                     "sqlalchemy_uri_placeholder": "mysql://user:password@host:port/dbname[?key=value&key=value...]",
+                 },
+                 {"engine": "hana", "name": "SAP HANA", "preferred": False},
              ]
          }