Skip to content

Conversation

@JR-1991
Copy link
Member

@JR-1991 JR-1991 commented Aug 14, 2025

This pull request adds a safeguard to prevent double uploads of the same dataset and updates the pydataverse dependency. The main changes include introducing a check in the upload method to raise an error if a dataset has already been uploaded, and adding a corresponding integration test to verify this behavior.

Dataset upload protection:

  • Added a check in the upload method of easyDataverse/dataset.py to raise a ValueError if p_id is not None, preventing double uploads of the same dataset. The error message guides users to use the update method or reset p_id if needed.
  • Added an integration test test_double_upload_raises_error in tests/integration/test_dataset_creation.py to ensure that attempting to upload a dataset twice raises a ValueError.

Dependency update:

  • Updated the pydataverse dependency version from 0.3.1 to 0.3.4 in pyproject.toml for improved compatibility and bug fixes.

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.
@JR-1991 JR-1991 self-assigned this Aug 14, 2025
@JR-1991 JR-1991 added the bug Something isn't working label Aug 14, 2025
@JR-1991 JR-1991 requested a review from Copilot August 14, 2025 09:48
Copy link
Contributor

Copilot AI left a 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 upload method to prevent double uploads when p_id is 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.

JR-1991 and others added 2 commits August 14, 2025 12:52
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.
@JR-1991 JR-1991 merged commit ff52a42 into main Sep 2, 2025
8 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Development

Successfully merging this pull request may close these issues.

3 participants