Closed g8tor closed 7 years ago
@g8tor Thanks for the reporting the issue. I'll investigate (probably a bug).
@roll
No problem at all. .Thanks for your work
@g8tor I would recommend an approach like this:
from datapackage import Package, Resource, infer
SCHEMA_PATH = 'schema.json'
# Infer a schema
resource = Resource('data1.tsv')
resource.infer()
resource.schema.save(SCHEMA_PATH)
# Prepare a descriptor
descriptor = infer('*.tsv')
for resource_descriptor in descriptor['resources']:
resource_descriptor['schema'] = SCHEMA_PATH
# Create a data package
package = Package(descriptor)
This infer/commit system is relatively new so there is a few shortcomings for now. Like in your code resource
wasn't able to dereference the schema (path -> dict). Also resource.commit
for now will not lead to package.descriptor
change. We're looking forward to fix all this small issue.
@roll ill give it a try and thanks for the suggestion.
@g8tor You're welcome! Please re-open if needed.
I am new to using frictionless data's specifications so I could be totally off base on this, that said I apologize in advance.
I have multiple files in a directory that share the same schema (but can not be combined). I would like to use a local file path for the schema property as described (http://specs.frictionlessdata.io/data-resource/)
Esentially, I want to
I am able to do all of the above, hoever when I try to commit the change on the resource by calling resource.commit() I am getting the following:
Checking the expand_resource_descriptor helpers.py file, it looks like its expecting a dict. which contradicts the spec. Am I correct or am I going about this the wrong way? Any and all help is greatly appreciated.
Thanks In Advance.
Please advise.
Thanks in advance for any and all help.