UserItem.CSVImport.create_from_file: wrong file-extension check

Open Beginner friendly
#1,865 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
70/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python
Domain
api

Research direction

Start in users_endpoint.py at Users.create_from_file and review its deprecation behavior and current callers. Verify the listed lowercase, uppercase, substring, and non-CSV paths, then confirm the chosen approach—fixing validation during the deprecation window or leaving it until removal—matches the project decision.

Written by the indexing model from the issue text.

Description

Users.create_from_file (in users_endpoint.py) validates the file with "csv" not in filepath before parsing. That test:

  • accepts non-CSV files whose path merely contains the substring csv (e.g. report.csv.bak, mycsv.txt, /home/csvuser/data.json)
  • rejects valid files whose extension is uppercase (e.g. USERS.CSV)

Neither matches the error message ("Only csv files are accepted").

Fix would be Path(filepath).suffix.lower() == ".csv".

Note: create_from_file is already deprecated (emits DeprecationWarning and is being replaced by bulk_add). Two paths:

  1. Patch under the deprecation window so the last few callers get correct behavior until removal.
  2. Just delete the method when the deprecation window closes and don't touch it in the meantime.

Filed as follow-up to a review comment on PR #1812 (out of scope for that PR's refactor).

Dominant language
Python
Stars
716
Forks
446
Avg merge
8d 8h
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from tableau/server-client-python

All issues in tableau/server-client-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.