Skip to content

Commit 24c2430

Browse files
rustyconoverclaude
andcommitted
fix: repair pre-existing typecheck and lint failures on main
The build/lint/runtime-smoke-test CI jobs were red independent of any dependency work: - src/client/ipc.ts: import the `RecordBatch` type (used in three signatures but never imported) — TS2304. - src/client/stream.ts: capture `_stateToken` into a local inside the continuation loop so the null-guard narrows it; the class property widened back to `string | null` after reassignment — TS2345. - Apply Biome safe fixes: remove unused imports (the lint errors) and organize imports across affected src/test files. typecheck, biome check, build, and bun/node smoke tests all pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent ddbf0ec commit 24c2430

4 files changed

Lines changed: 16 additions & 44 deletions

File tree

src/arrow/impl-arrowjs/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
import {
44
Binary as A_Binary,
55
Bool as A_Bool,
6+
Data as A_Data,
67
type DataType as A_DataType,
8+
DataType as A_DataTypeNS,
79
DateDay as A_DateDay,
810
Decimal as A_Decimal,
911
Dictionary as A_Dictionary,
@@ -33,8 +35,6 @@ import {
3335
Uint32 as A_Uint32,
3436
Uint64 as A_Uint64,
3537
Utf8 as A_Utf8,
36-
Data as A_Data,
37-
DataType as A_DataTypeNS,
3838
makeData as a_makeData,
3939
vectorFromArray as a_vectorFromArray,
4040
RecordBatchReader,

src/client/ipc.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ import {
77
DataType,
88
Float64,
99
Int64,
10+
type RecordBatch,
1011
RecordBatchReader,
1112
type Schema,
1213
Utf8,
1314
} from "@query-farm/apache-arrow";
14-
import {
15-
emptyBatchWithMetadata,
16-
singleRowBatchWithMetadata,
17-
} from "#vgi-rpc-arrow";
15+
import { emptyBatchWithMetadata, singleRowBatchWithMetadata } from "#vgi-rpc-arrow";
1816
import {
1917
LOG_EXTRA_KEY,
2018
LOG_LEVEL_KEY,

src/client/stream.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,9 @@ export class HttpStreamSession implements StreamSession {
250250

251251
// Follow continuation tokens
252252
while (true) {
253-
const responseBody = await this._sendContinuation(this._stateToken);
253+
const stateToken = this._stateToken;
254+
if (stateToken === null) return;
255+
const responseBody = await this._sendContinuation(stateToken);
254256
const { batches } = await readResponseBatches(responseBody);
255257

256258
let gotContinuation = false;

test/client/ipc-cross-impl.test.ts

Lines changed: 9 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,10 @@
2929
*/
3030

3131
import { describe, expect, it } from "bun:test";
32-
import {
33-
Field,
34-
Float64,
35-
Schema,
36-
Utf8,
37-
} from "@query-farm/apache-arrow";
38-
39-
import * as flechetteImpl from "../../src/arrow/impl-flechette/index.js";
32+
import { Field, Float64, Schema, Utf8 } from "@query-farm/apache-arrow";
4033
import * as arrowjsImpl from "../../src/arrow/impl-arrowjs/index.js";
41-
import {
42-
PROTOCOL_VERSION_KEY,
43-
REQUEST_VERSION,
44-
REQUEST_VERSION_KEY,
45-
RPC_METHOD_KEY,
46-
} from "../../src/constants.js";
34+
import * as flechetteImpl from "../../src/arrow/impl-flechette/index.js";
35+
import { PROTOCOL_VERSION_KEY, REQUEST_VERSION, REQUEST_VERSION_KEY, RPC_METHOD_KEY } from "../../src/constants.js";
4736

4837
const impls = [
4938
{ name: "impl-arrowjs", impl: arrowjsImpl },
@@ -95,11 +84,7 @@ for (const { name, impl } of impls) {
9584
const schema = new Schema([new Field("name", new Utf8(), true)]);
9685
const metadata = buildExpectedMetadata("catalog_attach", "1.0.0");
9786

98-
const batch = impl.singleRowBatchWithMetadata(
99-
schema as any,
100-
{ name: "albemarle_gis" },
101-
metadata,
102-
);
87+
const batch = impl.singleRowBatchWithMetadata(schema as any, { name: "albemarle_gis" }, metadata);
10388
const bytes = impl.serializeBatches(schema as any, [batch as any]);
10489
expect(bytes.byteLength).toBeGreaterThan(0);
10590

@@ -138,14 +123,9 @@ describe("buildRequestIpc empty-schema regression — apache-arrow batch passed
138123
// apache-arrow batch doesn't surface that field.
139124
it("flechette.serializeBatches refuses an apache-arrow RecordBatch", () => {
140125
const schema = new Schema([]);
141-
const apacheBatch = arrowjsImpl.emptyBatchWithMetadata(
142-
schema as any,
143-
buildExpectedMetadata("__describe__"),
144-
);
126+
const apacheBatch = arrowjsImpl.emptyBatchWithMetadata(schema as any, buildExpectedMetadata("__describe__"));
145127

146-
expect(() =>
147-
flechetteImpl.serializeBatches(schema as any, [apacheBatch as any]),
148-
).toThrow(); // any throw is fine — the point is that mixing impls is incoherent.
128+
expect(() => flechetteImpl.serializeBatches(schema as any, [apacheBatch as any])).toThrow(); // any throw is fine — the point is that mixing impls is incoherent.
149129
});
150130
});
151131

@@ -172,9 +152,7 @@ describe("introspect.deserializeSchema returns impl-native types", () => {
172152
// serialized as a Schema IPC message. Both impls' deserializeSchema
173153
// should accept it and return a type instance whose factory matches
174154
// their own backend.
175-
const apacheSchema = arrowjsImpl.schema([
176-
arrowjsImpl.field("request", arrowjsImpl.binary() as any, true),
177-
]);
155+
const apacheSchema = arrowjsImpl.schema([arrowjsImpl.field("request", arrowjsImpl.binary() as any, true)]);
178156
const ipcBytes = arrowjsImpl.serializeSchema(apacheSchema);
179157

180158
// Bun default condition resolves to impl-arrowjs. Re-imports of the
@@ -184,11 +162,7 @@ describe("introspect.deserializeSchema returns impl-native types", () => {
184162
for (const { name, impl } of impls) {
185163
const decoded: any = impl.deserializeSchema(ipcBytes);
186164
const payload = new Uint8Array([1, 2, 3, 4, 5]);
187-
const batch = impl.singleRowBatchWithMetadata(
188-
decoded,
189-
{ request: payload },
190-
buildExpectedMetadata("test"),
191-
);
165+
const batch = impl.singleRowBatchWithMetadata(decoded, { request: payload }, buildExpectedMetadata("test"));
192166
const wire = impl.serializeBatches(decoded, [batch as any]);
193167
const re: any = impl.deserializeBatch(wire);
194168
const got = (re.getChildAt ? re.getChildAt(0) : re.getChild?.("request"))?.get?.(0);
@@ -223,9 +197,7 @@ describe("introspect → buildRequestIpc end-to-end (catalog_attach shape)", ()
223197
it(`${name}: schema-deserialize → binary-encode → re-decode round-trips`, () => {
224198
// Build the schema (`request: binary`) and emit just-its IPC bytes,
225199
// matching what the server includes in its __describe__ response.
226-
const originalSchema = impl.schema([
227-
impl.field("request", impl.binary() as any, true),
228-
]);
200+
const originalSchema = impl.schema([impl.field("request", impl.binary() as any, true)]);
229201
const schemaBytes = impl.serializeSchema(originalSchema);
230202

231203
// Deserialize the schema the way introspect.ts does for paramsSchema.

0 commit comments

Comments
 (0)