Skip to content

Updated versions of pandas error on empty CSV names #37

Description

@anna-stacey

For example, we have this line in lexicon.py:
der_csv = pd.read_csv(pjoin(self.source_path, self.conf["derivational_csv_file"]))

But with derivational_csv_file set to "" (which should be permitted), then you can get an "IsADirectoryError" on "./".
Basically, it's trying to read "./" as a CSV, which it isn't, and we want it to do nothing rather than complaining that it's not a CSV. Something like:
der_csv = pd.read_csv(pjoin(self.source_path, self.conf["derivational_csv_file"])) if self.conf["derivational_csv_file"] else pd.DataFrame()

This wasn't happening on my version of pandas (2.3.3), but I saw it on a version 3.something.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions