Skip to content

Commit

Permalink
column mapping should work on compressed files
Browse files Browse the repository at this point in the history
  • Loading branch information
fhennig committed Jan 8, 2025
1 parent 15ddb24 commit f93e5c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions website/src/components/Submission/DataUploadForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,7 @@ const InnerDataUploadForm = ({
let finalMetadataFile = metadataFile.inner();

if (columnMapping !== null) {
// TODO here we want to pass in the Processed File
finalMetadataFile = await columnMapping.applyTo(metadataFile.inner());
finalMetadataFile = await columnMapping.applyTo(metadataFile);
}

switch (action) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { stringSimilarity } from 'string-similarity-js';

Check failure on line 1 in website/src/components/Submission/FileUpload/ColumnMapping.ts

View workflow job for this annotation

GitHub Actions / Check format and types

There should be at least one empty line between import groups
import { ProcessedFile } from './fileProcessing';

export class ColumnMapping {
private readonly map: ReadonlyMap<string, string>;
Expand Down Expand Up @@ -78,7 +79,7 @@ export class ColumnMapping {
}

/* Apply this mapping to a TSV file, returning a new file with remapped columns. */
public async applyTo(tsvFile: File): Promise<File> {
public async applyTo(tsvFile: ProcessedFile): Promise<File> {
const text = await tsvFile.text();
const inputRows = text.split('\n');
const headersInFile = inputRows.splice(0, 1)[0].split('\t');
Expand Down

0 comments on commit f93e5c3

Please sign in to comment.