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

Support csv format for ArrayField #1434

Open
4 tasks
roll opened this issue Feb 20, 2023 · 0 comments
Open
4 tasks

Support csv format for ArrayField #1434

roll opened this issue Feb 20, 2023 · 0 comments
Labels
feature New functionality good first issue Good for newcomers

Comments

@roll
Copy link
Member

roll commented Feb 20, 2023

Overview

Currently, it's only possible to express an array within e.g. a csv this way:

type: array
format: default
["v1", "v2", "v3"]  # note that it should be additionally quoted within csv

We'd like to support csv format to allow this:

type: array
format: csv
v1, v2, v3  # note that it should be additionally quoted within csv

Implementation

It's relatively simple to implement by updating fields.ArrayField and using builtin csv module of Python.

  • write csv_cell_reader function in arrayField.create_cell_reader
  • based on field.format: default | csv return cell_reader or csv_cell_reader
  • add tests
  • add docs

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality good first issue Good for newcomers
Projects
Status: No status
Development

No branches or pull requests

1 participant