You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "john-bodley (via GitHub)" <gi...@apache.org> on 2023/06/22 06:38:49 UTC

[GitHub] [superset] john-bodley commented on a diff in pull request #24467: chore(dao): Replace save/overwrite with create/update respectively

john-bodley commented on code in PR #24467:
URL: https://github.com/apache/superset/pull/24467#discussion_r1238063901


##########
superset/daos/base.py:
##########
@@ -127,57 +128,72 @@ def find_one_or_none(cls, **filter_by: Any) -> Optional[T]:
         return query.filter_by(**filter_by).one_or_none()
 
     @classmethod
-    def create(cls, properties: dict[str, Any], commit: bool = True) -> T:
-        """
-        Generic for creating models
-        :raises: DAOCreateFailedError
+    def create(
+        cls,
+        item: T | None = None,

Review Comment:
   A accommodate the `save` functionality I extended the `create` method to accept a predefined object.



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org