Repository navigation
Add a "Create a Dataset from a CSV" tutorial and make the getting-started tutorial read-only - #131
AntoninKns wants to merge 3 commits into
Conversation
|
@AntoninKns thanks for your PR. I checked out the branch, ran the new test which passes and ran section 8 on demo with a real token. step 3 fails: create_in_hdx() fails on demo with: HDXError: Failed when trying to create bel-example-indicators! (POST) The dataset sets "methodology": "Other", and HDX then requires methodology_other (which is some methodology text) in the dict. Please update build_dataset accordingly. With methodology_other added, the rest of section 8 worked on demo:
|
| from hdx.data.user import User | ||
|
|
||
| organisations = User.get_current_user_organization_dicts("create_dataset") | ||
| dataset["owner_org"] = organisations[0]["id"] |
There was a problem hiding this comment.
It would be better here for the user to explicitly pick the organisation to which they intend to upload
| resource or parent dataset: | ||
|
|
||
| resource = dataset.get_resource(2) | ||
| resource.mark_data_updated() |
There was a problem hiding this comment.
Link from the closing paragraph of getting-started.md or from the last line of the create tutorial to how-to/operate-resources/resource-operations.md which has details on resource operations
| @@ -0,0 +1,93 @@ | |||
| """Tests for the code in the "Create a Dataset from a CSV" tutorial""" | |||
There was a problem hiding this comment.
Add a comment along the lines of: "Mirrors the code in documentation/tutorials/create-a-dataset.md (steps 3-6). Update both together."
This PR corresponds to the suggested tutorial rewrite mentioned in #129. A follow-up to the documentation restructure in #126.
Following the discussion in #129, where it was confirmed that the getting-started tutorial doesn't explain authorisation for writing, this PR proposes one way to cover that: separate reading from writing, and add a tutorial whose main part runs offline. I'm happy to adjust the approach.
What changed (one commit each, so they can be reviewed separately)
How it was tested
Not tested: needs a maintainer
Questions
Generated with Claude, fully reviewed and edited manually.