Add bulk_add_from_file(filepath, strict=False) as file-based user import successor to deprecated create_from_file
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 58/100
- Type d'issue
- Fonctionnalité
- Clarté
- Plutôt claire
- Activité
- Calme
- Stack technique
- python
- Domaine
- api, backend-api-design
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
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.
- Langage dominant
- Python
- Étoiles
- 716
- Forks
- 445
- Merge moyen
- 1 j 2 h
- PR mergées (30 j)
- 1
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de tableau/server-client-python
-
WorkbookItem.update() always sends an empty <dataAccelerationConfig/> even when never setPeut-être pris @jacalata l’a pris il y a 9 jours. Ouvertein-progress
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
tableau/server-client-python#1884 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
tableau/server-client-python#1865 ·
-
security: _validate_import_line_or_throw logs credential fields at DEBUG levelPeut-être pris @jacalata l’a pris il y a 49 jours. Ouvertein-progress
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
tableau/server-client-python#1829 · 1 commentaire ·
-
enhancement gap needs investigation stale
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
tableau/server-client-python#1322 · 2 commentaires ·
-
[Type2] Allow Incremental Refresh type schedules to be added via `server.schedules.add_to_schedule`Ouvertehelp wanted Server-Side Enhancement ui-exists
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
tableau/server-client-python#1101 · 3 commentaires ·
Toutes les issues de tableau/server-client-python
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
NousResearch/hermes-agent#133181 ·
Les mainteneurs répondent en général sous 1 jour
-
[oblt-aw][security] SEC-022 — findings (2026-10-05)Peut-être pris @elastic-vault-github-plugin-prod l’a pris aujourd’hui. Ouverteoblt-aw/ai/fix-ready oblt-aw/detector/security oblt-aw/triage/security-secrets
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
elastic/oblt-aw#2304 · 2 commentaires · 1 réaction ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 Moins d'une heure Accessibilité débutants 90/100
huggingface/huggingface_hub#5083 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100
deepset-ai/haystack#13107 ·
Les mainteneurs répondent en général sous 1 jour
-
[Bug]: index worker dies on LOG_LEVEL=info / empty / numeric before it can report a missing bootstrapPeut-être pris @sxh313 l’a pris aujourd’hui. Ouvertetriage/confirmed
Difficulté 2/5 1-3 heures Accessibilité débutants 90/100
agentscope-ai/agentscope#3130 ·
Les mainteneurs répondent en général sous 1 jour