opened
roll
username_0
It works with 2016-01 versions - https://github.com/okfn/datapackage-storage-py/blob/master/requirements.txt#L7

But with the latest ones it looks like there is issue with `resource.iter()` - it returns headers instead of rows.
The latest changes breakes datapackage-storage
issue
created
vitorbaptista
username_1
I took a look, and the error went from:

```python
# https://github.com/okfn/datapackage-storage-py/blob/master/datapackage_storage/package.py#L63
def import_package(storage, descriptor):
    # ...
    # Write data to tables
    for table in storage.tables:
        if table in datamap:
            storage.write(table, datamap[table])
```

to:

```python
# https://github.com/okfn/jsontableschema-sql-py/blob/update/jtssql/storage.py#L228
    def write(self, table, data):
        # ...
        schema = self.describe(table)
        model = SchemaModel(schema)
        cdata = []
        for row in data:
            rdata = {}
            # The "row" is a dict, which isn't the format "model.convert_row" expects
            row = tuple(model.convert_row(*row, fail_fast=True))
            for index, field in enumerate(model.fields):
                rdata[field['name']] = row[index]
            cdata.append(rdata)
```

I didn't move further than this, but the fix seems to be changing the `datamap[table]` format in `datapackage-storage`. I'll open an issue there.

As far as I can see, this isn't an error in `datapackage-py`, just a breaking change to its API.
comment
closed
vitorbaptista
username_1
issue