Skip to content

Commit 89b8d7c

Browse files
committed
chore: deprecate add_all method
1 parent ed9dc74 commit 89b8d7c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tableauserverclient/server/endpoint/users_endpoint.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import itertools
66
import logging
77
from typing import Optional
8+
import warnings
89

910
from tableauserverclient.server.query import QuerySet
1011

@@ -349,6 +350,7 @@ def add(self, user_item: UserItem) -> UserItem:
349350
# Add new users to site. This does not actually perform a bulk action, it's syntactic sugar
350351
@api(version="2.0")
351352
def add_all(self, users: list[UserItem]):
353+
warnings.warn("This method is deprecated, use bulk_add instead", DeprecationWarning)
352354
created = []
353355
failed = []
354356
for user in users:
@@ -405,8 +407,6 @@ def bulk_remove(self, users: Iterable[UserItem]) -> None:
405407

406408
@api(version="2.0")
407409
def create_from_file(self, filepath: str) -> tuple[list[UserItem], list[tuple[UserItem, ServerResponseError]]]:
408-
import warnings
409-
410410
warnings.warn("This method is deprecated, use bulk_add instead", DeprecationWarning)
411411
created = []
412412
failed = []

0 commit comments

Comments
 (0)