mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-12-03 16:10:37 +00:00
fix: page an upper-case .PARQUET key as a table in the S3 views
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
c3c451d136
commit
5b75d257a7
@@ -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', () => {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user