-
Notifications
You must be signed in to change notification settings - Fork 9
Update pyDataverse version and upload check
#61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Bumped the pydataverse package version from 0.3.1 to 0.3.4 in pyproject.toml to ensure compatibility with recent features and bug fixes.
Added a check in Dataset.upload to raise a ValueError if the dataset has already been uploaded (p_id is not None). Also added an integration test to verify that attempting to upload the same dataset twice raises the expected error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds protection against double dataset uploads and updates the pydataverse dependency. It introduces a safeguard in the upload method to prevent accidental re-uploads of already uploaded datasets by checking if the dataset already has a persistent ID.
- Added a check in the
uploadmethod to prevent double uploads whenp_idis already set - Updated pydataverse dependency from version 0.3.1 to 0.3.4
- Added integration test to verify the double upload protection behavior
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| easyDataverse/dataset.py | Added validation check to prevent double uploads when p_id exists |
| pyproject.toml | Updated pydataverse dependency from 0.3.1 to 0.3.4 |
| tests/integration/test_dataset_creation.py | Added integration test to verify double upload protection |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
Bumped the pydataverse package version from 0.3.4 to 0.3.5 in pyproject.toml to ensure compatibility with the latest features and bug fixes.
Eliminated a repeated error message when attempting to upload a dataset that has already been uploaded. The message now provides clearer instructions for users.
This pull request adds a safeguard to prevent double uploads of the same dataset and updates the
pydataversedependency. The main changes include introducing a check in theuploadmethod to raise an error if a dataset has already been uploaded, and adding a corresponding integration test to verify this behavior.Dataset upload protection:
uploadmethod ofeasyDataverse/dataset.pyto raise aValueErrorifp_idis notNone, preventing double uploads of the same dataset. The error message guides users to use theupdatemethod or resetp_idif needed.test_double_upload_raises_errorintests/integration/test_dataset_creation.pyto ensure that attempting to upload a dataset twice raises aValueError.Dependency update:
pydataversedependency version from0.3.1to0.3.4inpyproject.tomlfor improved compatibility and bug fixes.