bito-code-review[bot] commented on code in PR #40671:
URL: https://github.com/apache/superset/pull/40671#discussion_r3350315774
##########
superset/key_value/shared_entries.py:
##########
@@ -86,6 +86,19 @@ def set_shared_value(key: SharedKey, value: Any) -> None:
KeyValueDAO.create_entry(RESOURCE, value, CODEC, uuid_key)
+@transaction()
+def upsert_shared_value(key: SharedKey, value: Any) -> None:
+ """
+ Create or update a shared value by key, using the current hash algorithm.
+
+ Unlike :func:`set_shared_value`, this is idempotent and may be called
+ repeatedly to overwrite an existing entry.
+ """
+ namespace = get_uuid_namespace("")
+ uuid_key = uuid3(namespace, key)
+ KeyValueDAO.upsert_entry(RESOURCE, value, CODEC, uuid_key)
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Missing unit tests for new function</b></div>
<div id="fix">
Rule [11730] requires comprehensive unit tests for new tools.
`upsert_shared_value` is used in `guest_token.py` but lacks dedicated tests
covering create/update paths and error scenarios.
</div>
</div>
<small><i>Code Review Run #698b8d</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
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]