Repository navigation
Conversation
Signed-off-by: James Swirhun <james@credibledata.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A package data file whose name has a space, such as
data/Revenue by month.csv, now lists with its columns and row count. Before, it listed as unreadable.Why it broke
To list a package's data files,
getDatabaseInfocompilesduckdb.table('<path>')for each one. Malloy's DuckDB table-path check takes a bare path only when every character is in a short safe set, and a space is not in it. So the compile failed with:readDatabasescaught that and listed the file witherrorand noinfo. A name with an apostrophe failed the same way.The change
getDatabaseInfonow passes the path as a single-quoted DuckDB literal ('...', with'doubled), which is the form the check asks for. For a path the check already accepted, the literal compiles to the same SQL as before. The literal sits inside a Malloy double-quoted string, so\and"are escaped for that string.data/Revenue by month.csverror: Invalid DuckDB table pathinfo: 2 columns, 3 rowsdata/Bob's sales.csverror: Invalid DuckDB table pathinfo: 2 columns, 3 rowsdatabase.csvinfoinfo(unchanged)One case is still refused. Malloy's single-quoted form refuses a path containing
;or--, and on currentmaina bare path containing--is refused too. So a package whose absolute directory contains--still lists every data file as unreadable. That is true before and after this change. I found it because my checkout path contained--, which failed the existinggetDatabaseInfotests on unmodifiedmain.Testing
A new case in
package.spec.tsprobes two real CSV files against real DuckDB, one named with a space and one with an apostrophe.Invalid DuckDB table path: "/.../testPackage/data/Revenue by month.csv".bun run lintandprettier --checkpass on the touched files.🤖 Generated with Claude Code