betodealmeida commented on a change in pull request #14451:
URL: https://github.com/apache/superset/pull/14451#discussion_r631446528
##########
File path: superset/databases/commands/update.py
##########
@@ -32,7 +32,7 @@
)
from superset.databases.dao import DatabaseDAO
from superset.extensions import db, security_manager
-from superset.models.core import Database
+from superset.models.core import ConfigurationMethod, Database
Review comment:
```suggestion
from superset.models.core import Database
```
##########
File path:
superset/migrations/versions/453530256cea_add_save_option_column_to_db_model.py
##########
@@ -0,0 +1,48 @@
+# Licensed to the Apache Software Foundation (ASF) under one
Review comment:
This is in a separate PR, right?
##########
File path: superset/databases/commands/update.py
##########
@@ -75,6 +75,9 @@ def validate(self) -> None:
if not self._model:
raise DatabaseNotFoundError()
database_name: Optional[str] = self._properties.get("database_name")
+ configuration_method: Optional[str] = self._properties.get(
+ "configuration_method"
+ )
Review comment:
This is no longer used:
```suggestion
```
##########
File path: tests/databases/api_tests.py
##########
@@ -228,6 +228,7 @@ def test_create_database(self):
database_data = {
"database_name": "test-create-database",
"sqlalchemy_uri": example_db.sqlalchemy_uri_decrypted,
+ "configuration_method": ConfigurationMethod.SQLALCHEMY_URI,
Review comment:
Can you add an assert below in this test verifying that the attribute
was set correctly?
For example, between lines 241-242:
```python
assert model.configuration_method == ConfigurationMethod.SQLALCHEMY_URI
```
##########
File path: superset/databases/schemas.py
##########
@@ -70,6 +71,11 @@
"all database schemas. For large data warehouse with thousands of "
"tables, this can be expensive and put strain on the system."
) # pylint: disable=invalid-name
+configuration_method_description = (
+ "configuration_method is used on the frontend to"
Review comment:
```suggestion
"Configuration_method is used on the frontend to"
```
##########
File path: superset/models/core.py
##########
@@ -207,6 +215,7 @@ def data(self) -> Dict[str, Any]:
"id": self.id,
"name": self.database_name,
"backend": self.backend,
+ "configurationMethod": self.configuration_method,
Review comment:
The columns are return in snake_case:
```suggestion
"configuration_method": self.configuration_method,
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]