Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Add bulk_add_from_file(filepath, strict=False) as file-based user import successor to deprecated create_from_file

Aperta
#1,836 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
58/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
python

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

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.
  • strict mode gives callers the choice between fail-fast and gather-errors, matching tabcmd's existing --complete / --no-complete CLI flag.
Lingua principale
Python
Stelle
716
Fork
446
Merge medio
8g 8h
PR unite (30g)
2

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di tableau/server-client-python

Tutte le issue di tableau/server-client-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.