datopian / datahub-qa

:package: Bugs, issues and suggestions for datahub.io
https://datahub.io/
32 stars 6 forks source link

Instructions for importing data are not working #49

Closed AcckiyGerman closed 6 years ago

AcckiyGerman commented 6 years ago

I cannot use data from the datahub following the instruction

How to reproduce

Go to any dataset page on the datahub.io and try to use the dataset due to instructions, e.g. http://datahub.io/core/cofog#python

expected behavior

AcckiyGerman commented 6 years ago

@Mikanebu is it now ready for testing ?

Mikanebu commented 6 years ago

@AcckiyGerman created PR. It is under review. I will ping you

AcckiyGerman commented 6 years ago

TESTED: Python: OK Pandas: OK nodejs: FAIL

> const {Dataset} = require('data.js')
SyntaxError: Identifier 'Dataset' has already been declared

> 
> const path = 'http://datahub.io/core/cofog/datapackage.json'
SyntaxError: Identifier 'path' has already been declared

> 
> // We're using self-invoking function here as we want to use async-await syntax:
undefined
> (async () => {
...   const dataset = await Dataset.load(path)
... 
...   // Get the first data file in this dataset
...   const file = dataset.resources[0]
...   // Get a raw stream
...   const stream = await file.stream()
...   // entire file as a buffer (be careful with large files!)
...   const buffer = await file.buffer
... })()

Promise {
  <pending>,
  domain: 
   Domain {
     domain: null,
     _events: { error: [Function: debugDomainError] },
     _eventsCount: 1,
     _maxListeners: undefined,
     members: [] } }

R: FAIL OK

Ruby: Works but not with all the datasets. We agree (the team) to replace Ruby with Bash script (using Curl)

@Mikanebu

AcckiyGerman commented 6 years ago

FIXED

AcckiyGerman commented 6 years ago

new instruction bugs: Pandas: https://github.com/datahq/datahub-qa/issues/145 Python: https://github.com/datahq/datahub-qa/issues/143