You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "villebro (via GitHub)" <gi...@apache.org> on 2024/07/02 17:08:59 UTC

Re: [PR] chore(key-value): convert command to dao [superset]

villebro commented on code in PR #29344:
URL: https://github.com/apache/superset/pull/29344#discussion_r1661105552


##########
superset/commands/explore/permalink/create.py:
##########
@@ -65,15 +66,13 @@ def run(self) -> str:
             "datasource": self.datasource,
             "state": self.state,
         }
-        command = CreateKeyValueCommand(
-            resource=self.resource,
-            value=value,
-            codec=self.codec,
-        )
-        key = command.run()
-        if key.id is None:
+        entry = KeyValueDAO.create_entry(self.resource, value, self.codec)
+        db.session.flush()
+        key = entry.id
+        if key is None:
             raise ExplorePermalinkCreateFailedError("Unexpected missing key id")
-        return encode_permalink_key(key=key.id, salt=self.salt)
+        db.session.commit()  # pylint: disable=consider-using-transaction

Review Comment:
   Whoops, that wasn't meant to be there



-- 
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