hughhhh commented on a change in pull request #16859:
URL: https://github.com/apache/superset/pull/16859#discussion_r717045472
##########
File path: superset/connectors/sqla/models.py
##########
@@ -1673,7 +1673,7 @@ def before_update(
if not DatasetDAO.validate_uniqueness(
target.database_id, target.schema, target.table_name
- ):
+ ) and hasattr(target, "columns"):
Review comment:
So looked into the `state` whenever we break the if condition, and are
getting the following state:
```
{'_instance_dict': <weakref at 0x12dccc1d0; to 'WeakInstanceDict' at
0x12dc9f2e0>,
'_strong_obj': public.hmiles.test_dataset,
'class_': <class 'superset.connectors.sqla.models.SqlaTable'>,
'committed_state': {'database_id': symbol('NO_VALUE')},
'expired': False,
'expired_attributes': set(),
'identity_token': None,
'key': (<class 'superset.connectors.sqla.models.SqlaTable'>, (29,), None),
'load_options': set(),
'load_path': CachingEntityRegistry((<Mapper at 0x12ccec700; SqlaTable>,)),
'manager': {'cache_timeout':
<sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x12ccfa680>,
'changed_by': <sqlalchemy.orm.attributes.InstrumentedAttribute
object at 0x12ccfa040>,
'changed_by_fk':
<sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x12ccfaf40>,
'changed_on': <sqlalchemy.orm.attributes.InstrumentedAttribute
object at 0x12ccfa220>,
'columns': <sqlalchemy.orm.attributes.InstrumentedAttribute
object at 0x12d0da770>,
'created_by': <sqlalchemy.orm.attributes.InstrumentedAttribute
object at 0x12ccf0ef0>,
'created_by_fk':
<sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x12ccfaea0>,
'created_on': <sqlalchemy.orm.attributes.InstrumentedAttribute
object at 0x12ccfa180>,
'database': <sqlalchemy.orm.attributes.InstrumentedAttribute
object at 0x12ccf0d10>,
'database_id': <sqlalchemy.orm.attributes.InstrumentedAttribute
object at 0x12ccfaa40>,
'default_endpoint':
<sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x12ccfa400>,
'description': <sqlalchemy.orm.attributes.InstrumentedAttribute
object at 0x12ccfa360>,
'extra': <sqlalchemy.orm.attributes.InstrumentedAttribute
object at 0x12ccfae00>,
'fetch_values_predicate':
<sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x12ccfaae0>,
'filter_select_enabled':
<sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x12ccfa540>,
'id': <sqlalchemy.orm.attributes.InstrumentedAttribute object
at 0x12ccfa2c0>,
'is_featured': <sqlalchemy.orm.attributes.InstrumentedAttribute
object at 0x12ccfa4a0>,
'is_sqllab_view':
<sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x12ccfacc0>,
'main_dttm_col':
<sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x12ccfa9a0>,
'metrics': <sqlalchemy.orm.attributes.InstrumentedAttribute
object at 0x12d0f64a0>,
'offset': <sqlalchemy.orm.attributes.InstrumentedAttribute
object at 0x12ccfa5e0>,
'owners': <sqlalchemy.orm.attributes.InstrumentedAttribute
object at 0x12ccf0c20>,
'params': <sqlalchemy.orm.attributes.InstrumentedAttribute
object at 0x12ccfa720>,
'perm': <sqlalchemy.orm.attributes.InstrumentedAttribute object
at 0x12ccfa7c0>,
'row_level_security_filters':
<sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x12d147130>,
'schema': <sqlalchemy.orm.attributes.InstrumentedAttribute
object at 0x12ccfab80>,
'schema_perm': <sqlalchemy.orm.attributes.InstrumentedAttribute
object at 0x12ccfa860>,
'slices': <sqlalchemy.orm.attributes.InstrumentedAttribute
object at 0x12ccf0e00>,
'sql': <sqlalchemy.orm.attributes.InstrumentedAttribute object
at 0x12ccfac20>,
'table_name': <sqlalchemy.orm.attributes.InstrumentedAttribute
object at 0x12ccfa900>,
'template_params':
<sqlalchemy.orm.attributes.InstrumentedAttribute object at 0x12ccfad60>,
'uuid': <sqlalchemy.orm.attributes.InstrumentedAttribute object
at 0x12ccfa0e0>},
'modified': True,
'obj': <weakref at 0x12dd36950; to 'SqlaTable' at 0x12dd37790>,
'parents': {},
'runid': 2037,
'session_id': 2}
```
--
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]