Skip to content

Commit

Permalink
improvement: auto-install sqlglot when using mo.sql in wasm (#3900)
Browse files Browse the repository at this point in the history
auto install sqlglot when using sql cells
  • Loading branch information
mscolnick authored Feb 24, 2025
1 parent d0eef44 commit 21d3156
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions frontend/src/core/islands/worker/worker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ const requestHandler = createRPCRequestHandler({
// Add pandas and duckdb to the code
code = `import pandas\n${code}`;
code = `import duckdb\n${code}`;
code = `import sqlglot\n${code}`;
}

await self.pyodide.loadPackagesFromImports(code, {
Expand Down
1 change: 1 addition & 0 deletions frontend/src/core/wasm/worker/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ export class DefaultWasmController implements WasmController {
// We need pandas and duckdb for mo.sql
code = `import pandas\n${code}`;
code = `import duckdb\n${code}`;
code = `import sqlglot\n${code}`;
}

// Add:
Expand Down
1 change: 1 addition & 0 deletions frontend/src/core/wasm/worker/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ const requestHandler = createRPCRequestHandler({
// Add pandas and duckdb to the code
code = `import pandas\n${code}`;
code = `import duckdb\n${code}`;
code = `import sqlglot\n${code}`;
}

await self.pyodide.loadPackagesFromImports(code, {
Expand Down

0 comments on commit 21d3156

Please sign in to comment.