GithubHelp home page GithubHelp logo

Comments (5)

skasberger avatar skasberger commented on June 19, 2024

This would be an easy first PR to pyDataverse, what do you think @pdurbin ?

Just take the upload_file() function in api.py, copy it and change the query_str and related stuff. :)

from pydataverse.

pdurbin avatar pdurbin commented on June 19, 2024

@skasberger sure, I'll try to make a pull request. Please go ahead an assign this issue to me if you like.

Instead of "upload file" I planned on using "delete dataset" as a starting point:

https://github.com/AUSSDA/pyDataverse/blob/v0.2.1/src/pyDataverse/api.py#L744

from pydataverse.

pdurbin avatar pdurbin commented on June 19, 2024

@skasberger huh. I'm surprised by the Dataverse API behavior. I tried using the pyDataverse "delete dataset" method with a superuser API token on a published dataset and to my surprise the dataset was destroyed!

Here's the code in question: https://github.com/IQSS/dataverse/blob/v4.15/src/main/java/edu/harvard/iq/dataverse/api/Datasets.java#L296

I guess this means that I don't really need a "destroy dataset" method in pyDataverse. I can just use the regular "delete dataset" method as a superuser.

@sekmiller seems to agree with me that the behavior I'm seeing is probably a bug in the Dataverse API. When I use "delete dataset" as a superuser on a published dataset, we think the API should return an error like "Are you sure you want to destroy a published dataset? If so, use the dedicated 'destroy' API endpoint for this!"

The bottom line is that I don't plan to make a pull request for this issue after all. Not anytime soon anyway. Again, I don't need "destroy dataset", surprisingly. 😄

from pydataverse.

skasberger avatar skasberger commented on June 19, 2024

So, i can close the issue, right? Will there be any updates on the API side, who will fix this in the nearer future?

from pydataverse.

pdurbin avatar pdurbin commented on June 19, 2024

I'll just close this issue. Again, I don't need any changes in pyDataverse. Most people will probably just try "delete dataset" rather than hunting around for "destroy dataset" like I did.

I'm reluctant to change any APIs in Dataverse itself. Maybe this is because I watched "Spec-ulation" by Rich Hickey: https://www.youtube.com/watch?v=oyLBGkS5ICk . Transcript: https://github.com/matthiasn/talk-transcripts/blob/master/Hickey_Rich/Spec_ulation.md

"Now what happens if you just put foo2 next to foo? You can still tell people. They can say, "I am in Bermuda this week, but next week I will try foo2. That sounds awesome." But right now, my web service is going to keep working, because it calls foo, and you did not take it away from me while I was on vacation."

from pydataverse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.