Add bulk_add_from_file(filepath, strict=False) as file-based user import successor to deprecated create_from_file
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 58/100
- Tipo de issue
- Funcionalidade
- Clareza
- Razoavelmente clara
- Status de atividade
- Pouca atividade
- Stack de tecnologia
- python
- Domínio
- api, backend-api-design
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Python
- Estrelas
- 716
- Forks
- 446
- Merge médio
- 8d 8h
- PRs com merge (30d)
- 2
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de tableau/server-client-python
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
tableau/server-client-python#1865 ·
-
in-progress
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
tableau/server-client-python#1829 · 1 comentário ·
-
enhancement gap needs investigation
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
tableau/server-client-python#1322 · 1 comentário ·
-
[Type2] Allow Incremental Refresh type schedules to be added via `server.schedules.add_to_schedule` Abertahelp wanted Server-Side Enhancement ui-exists
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
tableau/server-client-python#1101 · 3 comentários ·
-
enhancement good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
tableau/server-client-python#783 · 5 comentários ·
Todas as issues de tableau/server-client-python
Issues semelhantes
-
bug confirmed issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
open-webui/open-webui#30750 · 1 comentário ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · 1 comentário ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
-
good first issue
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100