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

CSV export is broken for tables with null foreign keys #612

Closed
simonw opened this issue Nov 2, 2019 · 2 comments
Closed

CSV export is broken for tables with null foreign keys #612

simonw opened this issue Nov 2, 2019 · 2 comments

Comments

@simonw
Copy link
Owner

simonw commented Nov 2, 2019

Following on from #406 - this CSV export appears to be broken:

https://14da705.datasette.io/fixtures/foreign_key_references.csv?_labels=on&_size=max

pk,foreign_key_with_label,foreign_key_with_label_label,foreign_key_with_no_label,foreign_key_with_no_label_label
1,1,hello,1,1
2,,

That second row should have 5 values, but it only has 4.

@simonw simonw added the bug label Nov 2, 2019
@simonw
Copy link
Owner Author

simonw commented Nov 2, 2019

The bug is in this code here:

# Look for {"value": "label": } dicts and expand
new_row = []
for cell in row:
if isinstance(cell, dict):
new_row.append(cell["value"])
new_row.append(cell["label"])
else:
new_row.append(cell)

@simonw
Copy link
Owner Author

simonw commented Nov 2, 2019

This is a blocker on releasing 0.30.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant