FrancescoCastaldi commented on PR #44358: URL: https://github.com/apache/superset/pull/44358#issuecomment-5953014243
@rusackas @sadpandajoe pushed commit b5f05eaf to address this! In \ ouch_dashboards\, when running in a no-user context (\g.user\ is \None\), we now explicitly retain the pre-existing \changed_by_fk\ / \changed_by\ and flag \changed_by_fk\ as modified via \sqlalchemy.orm.attributes.flag_modified\. This ensures SQLAlchemy emits the existing foreign key in the \UPDATE\ statement and prevents the column's \onupdate=get_user_id\ trigger from resetting \changed_by_fk\ to \NULL\. I also added regression tests covering this behavior: - Unit tests asserting that pre-existing attribution is preserved during chart creation and update/removal when \g.user\ is \None\. - A persisted SQLAlchemy model test with a live session and SQLite in-memory database verifying that column \onupdate=get_user_id\ does not clear attribution on commit. -- 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]
