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

bug: Cell value not interpreted as array #957

Open
adrienDog opened this issue Jul 1, 2024 · 0 comments
Open

bug: Cell value not interpreted as array #957

adrienDog opened this issue Jul 1, 2024 · 0 comments

Comments

@adrienDog
Copy link

Hello!

Please if you can point me to where i can contribute and fix this, I would gladly contribute

Summary

When using describe

Im getting {'name': 'test_array', 'type': 'string'}

instead of {'name': 'test_array', 'type': 'array', 'arrayItems': {'type': 'string'}}

Description

Setup

For a given test.csv with this content:

id,name,test_array
1,foo,'["a", "b", "c"]'
2,bar,'["d", "e", "f"]'
  • Afaik this is the recommended way to write that CSV based on this doc
  • Ive tried with "['a', 'b', 'c']" in the csv, didnt work either

and the following code

from pprint import pprint
from frictionless import describe

resource = describe('test.csv')
pprint(resource)

Actual

{'name': 'test',
 'type': 'table',
 'path': 'test.csv',
 'scheme': 'file',
 'format': 'csv',
 'mediatype': 'text/csv',
 'encoding': 'utf-8',
 'dialect': {'csv': {'skipInitialSpace': True}},
 'schema': {'fields': [{'name': 'id', 'type': 'integer'},
                       {'name': 'name', 'type': 'string'},
                       {'name': 'test_array', 'type': 'string'}]}}

Expected

{'name': 'test',
 'type': 'table',
 'path': 'test.csv',
 'scheme': 'file',
 'format': 'csv',
 'mediatype': 'text/csv',
 'encoding': 'utf-8',
 'dialect': {'csv': {'skipInitialSpace': True}},
 'schema': {'fields': [{'name': 'id', 'type': 'integer'},
                       {'name': 'name', 'type': 'string'},
                       {'name': 'test_array', 'type': 'array', 'arrayItems': {'type': 'string'}}]}}
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

No branches or pull requests

1 participant