betodealmeida commented on a change in pull request #19228:
URL: https://github.com/apache/superset/pull/19228#discussion_r829559752
##########
File path: superset/connectors/sqla/models.py
##########
@@ -2089,21 +1981,24 @@ def after_update( # pylint: disable=too-many-branches,
too-many-locals, too-man
# set permissions
security_manager.set_perm(mapper, connection, target)
- dataset = (
-
session.query(NewDataset).filter_by(sqlatable_id=target.id).one_or_none()
- )
- if not dataset:
- return
-
# get DB-specific conditional quoter for expressions that point to
columns or
# table names
database = (
target.database
or session.query(Database).filter_by(id=target.database_id).one()
)
+
engine = database.get_sqla_engine(schema=target.schema)
conditional_quote = engine.dialect.identifier_preparer.quote
+ dataset = (
+
session.query(NewDataset).filter_by(sqlatable_id=target.id).one_or_none()
+ )
+
+ if not dataset:
+ dataset = SqlaTable.write_shadow_dataset(target, database, session)
Review comment:
Small nit for consistency:
```suggestion
SqlaTable.write_shadow_dataset(target, database, session)
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]