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

4163 update export csv #939

Merged
merged 2 commits into from
Oct 21, 2020
Merged

4163 update export csv #939

merged 2 commits into from
Oct 21, 2020

Conversation

tillyw
Copy link
Contributor

@tillyw tillyw commented Oct 21, 2020

Fixes cityofaustin/atd-data-tech#4163

  • Removes unnecessary columns
  • Reorders remaining columns as requested
  • Renames death_cnt to cris_death_cnt

The only catch is there is a persisting bug that creates empty columns associated with nested objects and appends them at the end of the table. @JaceDeloney I plan to address this in a future issue/PR, but since this is marked as high-priority, we can merge this fix in the meantime.

Zip file with example CSV attached!

atd_txdot_crashes2020-10-21T12_42_42-05_00.csv.zip

Copy link
Contributor

@mateoclarke mateoclarke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

pumpkin_dance

return;
} else if (Array.isArray(columnValue)) {
// If value is array, recursive call and handle objects in array
flattenRow(columnValue, flattenedRow);
} else if (typeof columnValue === "object" && columnValue !== null) {
// If value is object, recursive call and handle k/v pairs in object
flattenRow(columnValue, flattenedRow);
} else if (columnName === "death_cnt") {
// Rename death_cnt column to cris_death_cnt at the request of VZ Team
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JaceDeloney, is this rename something that should be happening only for the CSV export? Should we be doing this at a system/database level?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvm, @tylerwhitson let me know its only for CSVs

@tillyw tillyw merged commit d732eb9 into master Oct 21, 2020
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

Successfully merging this pull request may close these issues.

Update CR3 download export file
2 participants