Skip to content
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

Addresses subscript out of bounds error #8

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

veggabo
Copy link

@veggabo veggabo commented Feb 29, 2024

I have found a partial fix for the error raised in #7. It seems to be related to metadata which doesn't contain a source attribute. I have successfully downloaded the datasets using owid() that previously returned the error using my proposed change. However, calling owid_source() now returns an error, I guess it's because of the missing source attribute.

I have run some queries on the OWID API, and I can't see the source attribute in any of them, like these ones:

Population density: https://api.ourworldindata.org/v1/indicators/734429.metadata.json
Carbon intensity of electricity generation: https://api.ourworldindata.org/v1/indicators/817696.metadata.json

Maybe they have changed some attribute names? I see an attribute named origins that seems to contain the source information.

I think I have found a fix for the error raised in piersyork#7. It's related to metadata which doesn't contain a source attribute.
instead of adding an if else statement, I moved the placement of assigning a value on the source attribute. If the source attribute is missing from the metadata, and it's the first value that's added to the `data_info` list, the rest of the list can't be populated, and it returns the "out of bound" error.
@Watjoa
Copy link

Watjoa commented May 16, 2024

Hi, I still got the same problem going on after installing the package. Any updates on this?

@veggabo
Copy link
Author

veggabo commented May 16, 2024

Hi, I still got the same problem going on after installing the package. Any updates on this?

I don't think my proposed fix have been merged. The change is only to move one line of code, so you could try yourself in your local package copy. Or install the fork i have done, use the "patch-1" branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants