Add bulk_add_from_file(filepath, strict=False) as file-based user import successor to deprecated create_from_file
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 58/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- python
- Domain
- api, backend-api-design
Research direction
Start by reading users.bulk_add, the deprecated create_from_file, and UserItem.CSVImport.validate_file_for_import to understand the existing import flow and POST /users/import integration. Confirm the behavior for strict and non-strict validation, including the JobItem and SkippedLine results, and consider how tabcmd issue #1809 would use the method.
Written by the indexing model from the issue text.
Description
Summary
Add users.bulk_add_from_file(filepath, strict=False) -> tuple[JobItem, list[SkippedLine]] as the modern file-based user import convenience. The existing users.create_from_file is deprecated (v0.41.0) in favor of bulk_add, but bulk_add takes Iterable[UserItem] and has no file-reading equivalent. Callers who want "read this CSV, import users, tell me what happened" today have to hand-roll validation + iteration + error accumulation.
Proposed shape
def bulk_add_from_file(
self,
filepath: str,
strict: bool = False,
) -> tuple[JobItem, list[SkippedLine]]:
"""
Import users from a CSV file.
- Reads the file
- Validates each line via UserItem.CSVImport.validate_file_for_import
- If strict=True: raises ValueError on the first invalid line
- If strict=False: skips invalid lines, returns them in the second tuple element
- Calls POST /users/import (via bulk_add) with the valid users
- Returns the JobItem plus any client-side-rejected lines
"""
SkippedLine would be a small dataclass carrying the raw line, line number, and validation error.
Motivation
- tabcmd (
createsiteusers,createusers,addusers, etc.) currently duplicates ~100 lines of CSV parsing and validation logic client-side because there's no TSC method that spans file → server. #1809 tracks bringing tabcmd onto the shared TSC implementation; this method is what tabcmd would call. - Direct TSC users get the same convenience.
strictmode gives callers the choice between fail-fast and gather-errors, matching tabcmd's existing--complete/--no-completeCLI flag.
- Dominant language
- Python
- Stars
- 716
- Forks
- 446
- Avg merge
- 8d 8h
- Merged PRs (30d)
- 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tableau/server-client-python
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
tableau/server-client-python#1865 ·
-
in-progress
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
tableau/server-client-python#1829 · 1 comment ·
-
enhancement gap needs investigation
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
tableau/server-client-python#1322 · 1 comment ·
-
[Type2] Allow Incremental Refresh type schedules to be added via `server.schedules.add_to_schedule` Openhelp wanted Server-Side Enhancement ui-exists
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
tableau/server-client-python#1101 · 3 comments ·
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
tableau/server-client-python#783 · 5 comments ·
All issues in tableau/server-client-python
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
zostera/django-bootstrap4#894 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
use-agent-os/agent-os#3276 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
NousResearch/hermes-agent#117848 ·