From 5b75d257a7970e902775c8fe1670e6607a0718ec Mon Sep 17 00:00:00 2001 From: Guilhem Lemouel Date: Wed, 2 Dec 2026 10:08:19 -0800 Subject: [PATCH] fix: page an upper-case .PARQUET key as a table in the S3 views Co-Authored-By: Claude Opus 5.5 --- frontend/src/lib/components/s3TableOps.test.ts | 5 +---- frontend/src/lib/components/s3TableOps.ts | 3 +-- 2 files changed, 2 insertions(+), 6 deletions(-) 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 }