Add bulk_add_from_file(filepath, strict=False) as file-based user import successor to deprecated create_from_file
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 58/100
- Issue 類型
- 功能
- 描述清晰度
- 基本清楚
- 活躍度
- 冷清
- 技術堆疊
- python
研究方向
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.
由索引模型根據 Issue 內容生成。
描述
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.
- 主要語言
- Python
- 星號
- 716
- 分支
- 444
- 平均合併
- 1 天 2 小時
- 30 天內合併 PR
- 1
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
tableau/server-client-python 的其他 Issue
-
WorkbookItem.update() always sends an empty <dataAccelerationConfig/> even when never set可能已有人在做 @jacalata 於 14 天前認領。 未關閉in-progress
難度 2/5 1-3 小時 新手友好度 78/100
tableau/server-client-python#1884 ·
-
難度 2/5 1-3 小時 新手友好度 70/100
tableau/server-client-python#1865 ·
-
security: _validate_import_line_or_throw logs credential fields at DEBUG level可能已有人在做 @jacalata 於 55 天前認領。 未關閉in-progress
難度 2/5 1-3 小時 新手友好度 78/100
tableau/server-client-python#1829 · 1 則留言 ·
-
enhancement gap needs investigation stale
難度 2/5 1-3 小時 新手友好度 68/100
tableau/server-client-python#1322 · 2 則留言 ·
-
[Type2] Allow Incremental Refresh type schedules to be added via `server.schedules.add_to_schedule`未關閉help wanted Server-Side Enhancement ui-exists
難度 2/5 1-3 小時 新手友好度 68/100
tableau/server-client-python#1101 · 3 則留言 ·
查看 tableau/server-client-python 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 82/100
aicell-lab/bioengine#232 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 74/100
modelscope/evalscope#1836 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
-
bug
難度 1/5 1 小時以內 新手友好度 78/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
jbaruch/speaker-toolkit#480 ·
維護者通常 1 天內回覆