If I am not mistaken, the categories field of a file in a dataset cannot be set by dataset.add_file() at the moment and is not part of the File class.
https://guides.dataverse.org/en/latest/api/native-api.html#updating-file-metadata
|
def add_file(self, dv_path: str, local_path: str, description: str = ""): |
|
"""Adds a file to the dataset based on the provided path. |
|
|
|
Args: |
|
filename (str): Path to the file to be added. |
|
description (str, optional): Description of the file. Defaults to "". |
|
""" |
|
class File(BaseModel): |
|
|
|
filename: str |
|
description: Optional[str] = None |
|
file_pid: Optional[str] = None |
|
local_path: Optional[str] = None |
|
dv_dir: Optional[str] = None |
If I am not mistaken, the
categoriesfield of a file in a dataset cannot be set bydataset.add_file()at the moment and is not part of theFileclass.https://guides.dataverse.org/en/latest/api/native-api.html#updating-file-metadata
easyDataverse/easyDataverse/core/dataset.py
Lines 57 to 63 in e835795
easyDataverse/easyDataverse/core/file.py
Lines 7 to 13 in e835795