refactor: modernize UserItem.CSVImport - use csv module for parsing
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start with UserItem.CSVImport, validate_file_for_import, _validate_import_line_or_throw, and create_user_from_line, then inspect test_password_with_comma_partially_masks. Done means parsing and username extraction use csv handling, and empty-input and too-many-column errors follow one convention.
Written by the indexing model from the issue text.
Description
UserItem.CSVImport has some internal design smells worth cleaning up.
1. Use the csv module for parsing. Today the code does line.split(","), which misaligns whenever a field contains a comma - a password like "my,pa\$\$w0rd", a display name like "Smith, John". The column-1 mask added in #1829 only covers what lands in column 1; bytes that spill into column 2+ still leak (see test_password_with_comma_partially_masks). csv.reader also handles quoted values, CRLF, and BOM deliberately rather than coincidentally.
2. Consolidate two username extractions. validate_file_for_import uses line.partition(",")[0].strip(), while _validate_import_line_or_throw uses list(map(str.strip, line.split(",")))[USERNAME]. Same result today, but a maintenance hazard. A csv.reader migration collapses both.
3. Align error handling in create_user_from_line. It returns None for empty input but raises ValueError for too many columns. Pick one convention.
🤖 Generated with Claude Code
- 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 ·