Skip to content

Conversation

@kenlhlui
Copy link
Contributor

@kenlhlui kenlhlui commented Jun 18, 2025

I came across an issue when I was trying to initialize the Dataverse instance for borealisdata.ca (also (https://demo.borealisdata.ca/).

When I try to run this code:

from easyDataverse import Dataverse
dataverse = Dataverse("https://borealisdata.ca/")

The error message:

/dataverse.py:140, in Dataverse._connect(self)
    115 def _connect(self) -> None:
    116     """Connects to a Dataverse installation and adds all metadtablocks as classes.
...
--> 231 if int(major) >= 6:
    232     return True
    233 elif int(major) >= 5 and int(minor) >= 13:

ValueError: invalid literal for int() with base 10: 'v6'

The reason is that there is a leading v for the major version number in Borealis:
{"status":"OK","data":{"version":"v6.4.1-SP","build":null}}

This PR sanitizes the version number, ensuring the number can be changed from str to int, and can then perform the check.

Not sure this can be accepted! Because it's likely more a signle Dataverse instance issue!

@JR-1991 JR-1991 self-assigned this Jun 18, 2025
@JR-1991 JR-1991 added the bug Something isn't working label Jun 18, 2025
@JR-1991 JR-1991 added this to the v0.4.5 milestone Jun 18, 2025
@JR-1991
Copy link
Member

JR-1991 commented Jun 18, 2025

@kenlhlui, thank you very much for the PR! I was completely unaware of this, and it’s great to have it checked. If you don’t mind, I’ve added a couple of tests and an additional check to your Dataverse instance.

@JR-1991 JR-1991 moved this to Ready for Review in PyDataverse Working Group Jun 18, 2025
@kenlhlui
Copy link
Contributor Author

It looks great! Sorry, I should have written the test as well. Thanks so much!

@JR-1991
Copy link
Member

JR-1991 commented Jun 18, 2025

No worries, the most important thing is that you’ve spotted and fixed it! Merging 🙌

@JR-1991 JR-1991 merged commit 48a8379 into gdcc:main Jun 18, 2025
2 checks passed
@github-project-automation github-project-automation bot moved this from Ready for Review to Done in PyDataverse Working Group Jun 18, 2025
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.

2 participants