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

loads datasets upload gibberish #176

Open
frafra opened this issue Nov 18, 2020 · 4 comments · May be fixed by #195
Open

loads datasets upload gibberish #176

frafra opened this issue Nov 18, 2020 · 4 comments · May be fixed by #195

Comments

@frafra
Copy link
Contributor

frafra commented Nov 18, 2020

Apparently random data are uploaded (strange symbols and such). Could it be an encoding error? I am using Python 3.8.

@frafra
Copy link
Contributor Author

frafra commented Nov 18, 2020

It seems to return a gzip file containing an HTML response "Resource not found".

@frafra
Copy link
Contributor Author

frafra commented Nov 18, 2020

It looks for an url in the JSON file, which is not there, as ckanapi dumps datasets creates resources like this:

    {
      "description": "Coordinates of all sites included in the dataset",
      "format": "TXT",
      "name": "s-ptarmigan-counts-coordinates-txt",
      "path": "data/s-ptarmigan-counts-coordinates-.txt",
      "title": "S_ptarmigan_counts_coordinates.txt"
    },

f = requests.get(resource['url'],stream=True)

@frafra
Copy link
Contributor Author

frafra commented Nov 19, 2020

In addition to making dump compatible with loads, a suggestion could be to raise a warning or an error when accessing a resource with an HTTP error.

@frafra
Copy link
Contributor Author

frafra commented Feb 1, 2022

ckanapi load datasets fails even when using ckanapi action ckan_package_search output, because it cannot get private datasets. CKAN returns a 404, potentially gzipped, which then gets uploaded as resource.

@frafra frafra linked a pull request Feb 1, 2022 that will close this issue
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 a pull request may close this issue.

1 participant