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

Fix issue #19: Handle similarly named column headers in CSV merger #21

Closed

Conversation

sweep-ai[bot]
Copy link

@sweep-ai sweep-ai bot commented Aug 10, 2023

Description

This PR addresses issue #19 by modifying the combine function in the Merger struct in internal/merger.go to handle similarly named column headers in the CSV merger. Currently, the merger treats each column as unique, resulting in duplicate columns for similarly named headers. The changes in this PR ensure that columns with the same header are merged into a single column.

Summary of Changes

  • Modified the combine function in the Merger struct to handle similarly named column headers.
  • Created a map to store the column headers and their indices.
  • When iterating over the records, checked if the column header already exists in the map. If it does, appended the data to the existing column. If it doesn't, created a new column.
  • Updated the TestCombine function in internal/merger_test.go to include a test case for similarly named column headers.

Fixes #19.


To checkout this PR branch, run the following command in your terminal:

git checkout sweep/fix-issue-19-handle-similarly-named-column-headers

To get Sweep to edit this pull request, leave a comment below or in the code. Leaving a comment in the code will only modify the file but commenting below can change the entire PR.

@sweep-ai sweep-ai bot added the sweep Assigns Sweep to an issue or pull request. label Aug 10, 2023
@sweep-ai sweep-ai bot closed this Aug 10, 2023
@sweep-ai sweep-ai bot deleted the sweep/fix-issue-19-handle-similarly-named-column-headers branch August 10, 2023 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sweep Assigns Sweep to an issue or pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sweep: make all similarly named column headers merge to the same column
0 participants