bito-code-review[bot] commented on PR #42222:
URL: https://github.com/apache/superset/pull/42222#issuecomment-5017652293
<!-- Bito Reply -->
The flagged issue is correct. Disabling `cascade_backrefs` on the
`TableColumn.table` relationship prevents SQLAlchemy from automatically adding
new `TableColumn` objects to the session when they are associated with a
`SqlaTable` via the `table` attribute. To resolve this, you should either
remove `cascade_backrefs=False` to restore default behavior, or ensure that
every newly created `TableColumn` is explicitly added to the session using
`session.add(column)` before flushing.
**superset/connectors/sqla/models.py**
```
table: Mapped["SqlaTable"] = relationship(
"SqlaTable",
back_populates="columns",
# cascade_backrefs=False, <-- Remove this line to restore default
behavior
)
```
--
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]