bito-code-review[bot] commented on code in PR #40358:
URL: https://github.com/apache/superset/pull/40358#discussion_r3328071315
##########
superset/commands/tag/update.py:
##########
@@ -31,10 +31,11 @@
class UpdateTagCommand(UpdateMixin, BaseCommand):
- def __init__(self, model_id: int, data: dict[str, Any]):
+ def __init__(self, model_id: int, data: dict[str, Any], bulk_create: bool
= False):
self._model_id = model_id
self._properties = data.copy()
self._model: Optional[Tag] = None
+ self._bulk_create = bulk_create
Review Comment:
<!-- Bito Reply -->
The suggestion in the comment is valid and should be applied. It correctly
identifies a missing test case for the `bulk_create` parameter in the
`UpdateTagCommand` class. The new test should verify that passing
`bulk_create=True` preserves pre-existing relationships not in the
`objects_to_tag` list, ensuring the non-destructive mode works as intended.
**superset/commands/tag/update.py**
```
class UpdateTagCommand(UpdateMixin, BaseCommand):
- def __init__(self, model_id: int, data: dict[str, Any]):
+ def __init__(self, model_id: int, data: dict[str, Any], bulk_create:
bool = False):
self._model_id = model_id
self._properties = data.copy()
self._model: Optional[Tag] = None
+ self._bulk_create = bulk_create
```
--
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]