diff --git a/frontend/src/lib/components/s3TableOps.test.ts b/frontend/src/lib/components/s3TableOps.test.ts index 95a1cbb9db..a64e6a73bb 100644 --- a/frontend/src/lib/components/s3TableOps.test.ts +++ b/frontend/src/lib/components/s3TableOps.test.ts @@ -5,6 +5,7 @@ import { dbColumnKind } from './dbTableFilters' describe('serverTableFormat', () => { it('pages delimited text and newline-delimited JSON through the csv reader', () => { expect(serverTableFormat('a/b.parquet')).toBe('parquet') + expect(serverTableFormat('a/b.PARQUET')).toBe('parquet') for (const key of ['a.csv', 'a.TSV', 'a.jsonl', 'a.ndjson']) { expect(serverTableFormat(key)).toBe('csv') } @@ -14,10 +15,6 @@ describe('serverTableFormat', () => { expect(serverTableFormat('a.json')).toBeUndefined() expect(serverTableFormat('a.txt')).toBeUndefined() }) - - it('leaves an upper-case parquet extension to the download card', () => { - expect(serverTableFormat('a.PARQUET')).toBeUndefined() - }) }) describe('datatypeOf', () => { diff --git a/frontend/src/lib/components/s3TableOps.ts b/frontend/src/lib/components/s3TableOps.ts index e82f2eddd0..c9190b4c3c 100644 --- a/frontend/src/lib/components/s3TableOps.ts +++ b/frontend/src/lib/components/s3TableOps.ts @@ -5,8 +5,7 @@ import type { IDbTableOps } from './dbOps' /** Files the server can page through as a table, without reading them whole. */ export function serverTableFormat(fileKey: string): 'parquet' | 'csv' | undefined { - // The parquet reader requires the lower-case extension; the CSV reader takes any case. - if (fileKey.endsWith('.parquet')) return 'parquet' + if (/\.parquet$/i.test(fileKey)) return 'parquet' if (/\.(csv|tsv|jsonl|ndjson)$/i.test(fileKey)) return 'csv' return undefined }