caltechlibrary / caltechdata_api

Python library for using the CaltechDATA API
Other
10 stars 2 forks source link

adding files to a published data set #15

Closed caseyjlaw closed 1 year ago

caseyjlaw commented 1 year ago

I'm using caltechdata_api to create and then edit entries. In one case, I created and published a data set without any files (just metadata). Afterwards, I wanted to use the edit interface to add files. However, the caltechdata_edit function tries to create a new entry in this case. The logic is in this line: https://github.com/caltechlibrary/caltechdata_api/blob/main/caltechdata_api/caltechdata_edit.py#L110.

Am I misunderstanding the purpose of this function or the rules for editing an existing entry? I expected some programmatic access to editing in order to add a file after publication.

caseyjlaw commented 1 year ago

I see on the web interface (data.caltech.edu), I have the option of creating a new version and adding a file there. However, clicking on the "New Version" button under the "Files" field does nothing (using Chrome and Firefox). From what I can tell, I can't interact with the web page to add a file to the entry.

caseyjlaw commented 1 year ago

The record in question is https://data.caltech.edu/records/6jbbd-p8572.

tmorrell commented 1 year ago

The API behavior of CaltechDATA does not allow editing of files on published records. The idea is that published files shouldn't be changed, and instead new versions should be created. I can administratively add/modify files to published records, but that shouldn't be part of an automated workflow.

There is an issue with 6jbbd-p8572, and it's not generating a new version as it should. I'm investigating this and will get back to you once I figure out why that's not working.

tmorrell commented 1 year ago

I've done a refresh of CaltechDATA, and you should be able to add a new version to 6jbbd-p8572. I can also add files to the existing published records if you attach them here or send them via email.

Also let me know if you'd like to talk through your workflow-there are different options including the big data pilot storage for files that will change.

caseyjlaw commented 1 year ago

I tried to create a new version in two ways, but it does not work. There is a "New Version" button near the "Edit" button. Clicking on that one produces a "Not found" error. Or I can first "Edit" then go under "Files" and click "New version", but that produces no response (as before). Incidentally, I have two entries that I'd like to update. They are:

The first should have this file: 220914aabz

The second should have this file: 220426aaaw

tmorrell commented 1 year ago

Thanks for your patience-I've added the files to those records. Let me know if you want to chat about your workflow so the files get attached as expected.