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

Relative paths in remote datapackages don't work #41

Closed
2 tasks
roll opened this issue Dec 31, 2016 · 4 comments · Fixed by #48
Closed
2 tasks

Relative paths in remote datapackages don't work #41

roll opened this issue Dec 31, 2016 · 4 comments · Fixed by #48
Assignees
Labels
Milestone

Comments

@roll
Copy link
Member

roll commented Dec 31, 2016

Overview

const Datapackage = require('datapackage-test').Datapackage
const descriptor = 'https://raw.githubusercontent.com/frictionlessdata/datapackage-js/master/data/dp1/datapackage.json'

new Datapackage(descriptor).then(dp => {
    dp.resources[0].table.then(table => console.log(table.read()))
})
Error: ENOENT: no such file or directory, open 'data.csv'

Tasks

  • fix broken behavior
  • add tests
@roll roll added the bug label Dec 31, 2016
@roll roll modified the milestone: Version-1 Dec 31, 2016
@roll roll added the priority label Dec 31, 2016
@roll roll added this to the Version-1 milestone Dec 31, 2016
@roll roll assigned roll and unassigned roll Jan 9, 2017
@roll roll added the [0.5d] label Jan 9, 2017
@rufuspollock
Copy link
Contributor

@roll any update on a fix here (or confirmation this is a bug)? I'd like to use this feature in DPR if we can ...

@roll roll modified the milestones: Version-0.3, Version-1 Jan 16, 2017
@roll roll removed the [0.5d] label Jan 16, 2017
@roll roll removed their assignment Jan 16, 2017
@roll roll changed the title Relative paths in remote datapackages don't work? Relative paths in remote datapackages don't work Jan 16, 2017
@roll
Copy link
Member Author

roll commented Jan 16, 2017

@rufuspollock
It's confirmed - we're starting to work on it.

@roll roll added [js] and removed (js) labels Jan 16, 2017
@roll roll assigned roll and dumyan and unassigned roll Jan 16, 2017
@dumyan
Copy link
Contributor

dumyan commented Jan 16, 2017

@roll

this should be fixed in jsontableschema-js, because we're just wrapping the Table class here. Basically when doing table.read() you are using only jsontableschema-js code.

Therefore, the estimate is for jsontableschema-js.

@dumyan dumyan added the [1d] label Jan 16, 2017
@roll
Copy link
Member Author

roll commented Jan 16, 2017

I suppose error could be in code where we pass path to jsontableschema.Table

@dumyan dumyan added review and removed priority labels Jan 16, 2017
dumyan added a commit to keitaroinc/datapackage-js that referenced this issue Jan 24, 2017
@roll roll closed this as completed in #48 Jan 24, 2017
@roll roll removed the review label Jan 24, 2017
roll pushed a commit that referenced this issue Jan 24, 2017
* Handle relative resource paths for URLs

* Add remote relative resource path test

* Don't prepend base path if the resource path is URL

* New datapackage for remote resource URL tests

* Make _getBasePath static

* Add _getBasePath tests

* Add source getter tests

* Add new data fixtures

* Add checkPath method

* Implement path validation logic

* Change validate return value to [] if valid

* Tests for basePath defaults and validation

* Add explanation for basePath

* Always throw error if basePath is invalid

* Correct comments

* Rename Resource.typeOfResourcePath to Resource.type

* Change validate return value to true

* Adjust tests to expect true from Profile.validate
@roll roll added duplicate and removed duplicate labels Jan 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants