Skip to content

Commit 6912452

Browse files
Move isArqueroTable to fix circular dependency (#336)
1 parent 51a61fc commit 6912452

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/arquero.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export function isArqueroTable(value) {
2+
// Arquero tables have a `toArrowBuffer` function
3+
return value && typeof value.toArrowBuffer === "function";
4+
}

src/duckdb.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import {isArqueroTable} from "./arquero.js";
12
import {getArrowTableSchema, isArrowTable, loadArrow} from "./arrow.js";
23
import {duckdb} from "./dependencies.js";
34
import {FileAttachment} from "./fileAttachment.js";
45
import {cdn} from "./require.js";
5-
import {isArqueroTable} from "./table.js";
66

77
// Adapted from https://observablehq.com/@cmudig/duckdb-client
88
// Copyright 2021 CMU Data Interaction Group

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
export {FileAttachments, AbstractFile} from "./fileAttachment.js";
22
export {Library} from "./library.js";
33
export {getArrowTableSchema, isArrowTable} from "./arrow.js";
4+
export {isArqueroTable} from "./arquero.js";
45
export {
56
makeQueryTemplate,
67
loadDataSource,
78
arrayIsPrimitive,
89
isDataArray,
910
isDatabaseClient,
10-
isArqueroTable,
1111
__table as applyDataTableOperations
1212
} from "./table.js";

src/table.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {ascending, descending, reverse} from "d3-array";
22
import {FileAttachment} from "./fileAttachment.js";
3+
import {isArqueroTable} from "./arquero.js";
34
import {isArrowTable, loadArrow} from "./arrow.js";
45
import {DuckDBClient} from "./duckdb.js";
56

@@ -141,11 +142,6 @@ function isTypedArray(value) {
141142
);
142143
}
143144

144-
export function isArqueroTable(value) {
145-
// Arquero tables have a `toArrowBuffer` function
146-
return value && typeof value.toArrowBuffer === "function";
147-
}
148-
149145
// __query is used by table cells; __query.sql is used by SQL cells.
150146
export const __query = Object.assign(
151147
async (source, operations, invalidation, name) => {

0 commit comments

Comments
 (0)