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:
- Patch under the deprecation window so the last few callers get correct behavior until removal.
- 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).
Users.create_from_file(inusers_endpoint.py) validates the file with"csv" not in filepathbefore parsing. That test:csv(e.g.report.csv.bak,mycsv.txt,/home/csvuser/data.json)USERS.CSV)Neither matches the error message ("Only csv files are accepted").
Fix would be
Path(filepath).suffix.lower() == ".csv".Note:
create_from_fileis already deprecated (emitsDeprecationWarningand is being replaced bybulk_add). Two paths:Filed as follow-up to a review comment on PR #1812 (out of scope for that PR's refactor).