Skip to content

Fix Empty Image Filenames in CSV#1174

Merged
BryonLewis merged 6 commits into
mainfrom
fix-csv-filenames
Feb 23, 2022
Merged

Fix Empty Image Filenames in CSV#1174
BryonLewis merged 6 commits into
mainfrom
fix-csv-filenames

Conversation

@BryonLewis
Copy link
Copy Markdown
Collaborator

@BryonLewis BryonLewis commented Feb 17, 2022

fixes #1173

  • Adds a check to see if the field is empty when using the image map. It will skip using the image map if the field is empty.
  • Added another check to make sure that there are no files where it swaps between providing image filenames and not. This needed to handle both cases of (first row empty, second row populated) and (first row populated, second row empty). So it will throw an error when it encounters a row which is different than the previous rows.

Note: I wanted to add tests but the rejection process within the viame.ts parse function wasn't working well using jest. I may need to look into this more to figure out how I can add some relevant tests for image ordering and this new error.

@BryonLewis BryonLewis marked this pull request as ready for review February 21, 2022 14:16
Copy link
Copy Markdown
Contributor

@subdavis subdavis left a comment

Choose a reason for hiding this comment

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

Nit: declare type named variable

});
parser.on('readable', () => {
let record: string[];
let hasFilenames;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This variable is named like a boolean variable, but it's not boolean. It's true/false/undefined. Please declare its type here so TS can enforce assignment.

@BryonLewis BryonLewis merged commit d29531e into main Feb 23, 2022
@BryonLewis BryonLewis deleted the fix-csv-filenames branch February 23, 2022 16:41
BryonLewis added a commit that referenced this pull request Feb 24, 2022
* Adding basics

* Adding empty filename handling for CSV files

* fix imageMap undefined issue

* storing tests

* adding in tests

* adding type definition and fixing lint warning
subdavis pushed a commit that referenced this pull request Mar 11, 2022
* Adding basics

* Adding empty filename handling for CSV files

* fix imageMap undefined issue

* storing tests

* adding in tests

* adding type definition and fixing lint warning
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.

Handle Empty Image Names (Column 2) in VIAME CSV Import

2 participants