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

Trim couchdb fields while exporting rows #14289

Merged
merged 5 commits into from
Aug 1, 2024
Merged

Conversation

adrinr
Copy link
Collaborator

@adrinr adrinr commented Jul 31, 2024

Description

Currently, when exporting csv rows, we are exporting the full document. This give us fields that are not visible to the user, and they are causing some confusion (specially around reimporting). This only affects internal rows, as it has the extra data.
This PR trims all the fields that are not part of the table schema, but the _id (as it's used for matching when re-importing)

Launchcontrol

Trim couchdb fields on internal table row exports

@adrinr adrinr requested a review from a team as a code owner July 31, 2024 11:36
@adrinr adrinr requested review from mike12345567 and removed request for a team July 31, 2024 11:36
@github-actions github-actions bot added firestorm Data/Infra/Revenue Team size/s labels Jul 31, 2024
expect(results.length).toEqual(1)
const row = results[0]

expect(Object.keys(row)).toEqual(["_id", "name", "description"])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does the order matter here? Is Object.keys guaranteed to return the keys in that order? Will the test fail if it changes?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It matters for the test, but this should not change. It exports by the schema order, so changing the implementation might cause some errors.

@adrinr adrinr requested a review from samwho July 31, 2024 15:37
@adrinr adrinr enabled auto-merge July 31, 2024 15:44
@adrinr adrinr merged commit 19c4305 into master Aug 1, 2024
12 checks passed
@adrinr adrinr deleted the fix/import-column-issues branch August 1, 2024 08:47
@github-actions github-actions bot locked and limited conversation to collaborators Aug 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
firestorm Data/Infra/Revenue Team size/s
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants