From 99619a3d3e5c1531540c03d631afa4590aab85c4 Mon Sep 17 00:00:00 2001 From: David Estes Date: Tue, 19 Nov 2024 12:58:22 -0700 Subject: [PATCH 1/4] chore: update cross to version without vulnerabilty --- pnpm-lock.yaml | 14 +++++++------- tests/c1-integration/package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 62498dd..154daf0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -585,8 +585,8 @@ importers: specifier: 18.0.0 version: 18.0.0 cross-spawn: - specifier: ^7.0.5 - version: 7.0.5 + specifier: ^7.0.6 + version: 7.0.6 modern-spawn: specifier: ^1.0.0 version: 1.0.0 @@ -2269,8 +2269,8 @@ packages: cross-spawn@5.1.0: resolution: {integrity: sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==} - cross-spawn@7.0.5: - resolution: {integrity: sha512-ZVJrKKYunU38/76t0RMOulHOnUcbU9GbpWKAOZ0mhjr7CX6FVrH+4FrAapSOekrgFQ3f/8gwMEuIft0aKq6Hug==} + cross-spawn@7.0.6: + resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} cssesc@3.0.0: @@ -5955,7 +5955,7 @@ snapshots: shebang-command: 1.2.0 which: 1.3.1 - cross-spawn@7.0.5: + cross-spawn@7.0.6: dependencies: path-key: 3.1.1 shebang-command: 2.0.0 @@ -6177,7 +6177,7 @@ snapshots: execa@5.1.1: dependencies: - cross-spawn: 7.0.5 + cross-spawn: 7.0.6 get-stream: 6.0.1 human-signals: 2.1.0 is-stream: 2.0.1 @@ -7035,7 +7035,7 @@ snapshots: modern-spawn@1.0.0: dependencies: - cross-spawn: 7.0.5 + cross-spawn: 7.0.6 ms@2.1.2: {} diff --git a/tests/c1-integration/package.json b/tests/c1-integration/package.json index a4d0f86..ea519ac 100644 --- a/tests/c1-integration/package.json +++ b/tests/c1-integration/package.json @@ -34,7 +34,7 @@ "apache-arrow": "18.0.0", "@jest/environment": "^29.7.0", "@types/cross-spawn": "^6.0.0", - "cross-spawn": "^7.0.5", + "cross-spawn": "^7.0.6", "modern-spawn": "^1.0.0" }, "devDependencies": {}, From 2da0759b30b9ab6497029877ff849a9a61e17bc9 Mon Sep 17 00:00:00 2001 From: David Estes Date: Tue, 19 Nov 2024 13:45:45 -0700 Subject: [PATCH 2/4] chore: include more context in errors now includes message like `failed to prepare statement: IpcError("Status { code: Internal, message: \"Plan(\\\"table 'ceramic.v0.conclusion_feed' not found\\\")\", metadata: MetadataMap { headers: {\"content-type\": \"application/grpc\", \"date\": \"Tue, 19 Nov 2024 20:42:18 GMT\", \"content-length\": \"0\"} }, source: None }")` instead of simply `failed to prepare statement` --- packages/flight-sql-client/src/error.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/flight-sql-client/src/error.rs b/packages/flight-sql-client/src/error.rs index fe40905..653c299 100644 --- a/packages/flight-sql-client/src/error.rs +++ b/packages/flight-sql-client/src/error.rs @@ -8,17 +8,17 @@ pub type Result = std::result::Result; #[derive(Debug, Snafu)] #[snafu(visibility(pub(crate)))] pub enum Error { - #[snafu(display("column '{name}' is missing"))] - MissingColumn { name: String }, - #[snafu(display("{message}"))] + #[snafu(display("{message}: {source:?}"))] Arrow { source: ArrowError, message: &'static str, }, + #[snafu(display("{message}: {source:?}"))] Flight { source: FlightError, message: &'static str, }, + #[snafu(display("{message}: {source}"))] Status { source: Status, message: &'static str, From 8f0af38e83056f641c1947c414f7694a445750ed Mon Sep 17 00:00:00 2001 From: David Estes Date: Tue, 19 Nov 2024 13:48:07 -0700 Subject: [PATCH 3/4] chore: update flight sql test so it will pass when unskipped --- tests/c1-integration/test/flight.test.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/c1-integration/test/flight.test.ts b/tests/c1-integration/test/flight.test.ts index ea02ea8..c27d955 100644 --- a/tests/c1-integration/test/flight.test.ts +++ b/tests/c1-integration/test/flight.test.ts @@ -68,11 +68,12 @@ describe('flight sql', () => { // disabled until server support is implemented test.skip('prepared stmt', async () => { const client = await createFlightSqlClient(OPTIONS) - const data = await client.preparedStatement( - 'SELECT * from conclusion_feed where stream_type = $1', + const buffer = await client.preparedStatement( + 'SELECT * from conclusion_events where stream_type = $1', new Array(['$1', '3']), ) - console.log(data) + const data = tableFromIPC(buffer) + console.log(JSON.stringify(data)) }) afterAll(async () => { From 99034de3295d9a494627608cc2a5da19ce552321 Mon Sep 17 00:00:00 2001 From: David Estes Date: Fri, 22 Nov 2024 12:25:33 -0700 Subject: [PATCH 4/4] chore: update flight sql query to use new table for latest c1 this is needed to pass CI now that ceramic-one:latest has been updated --- tests/c1-integration/test/flight.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/c1-integration/test/flight.test.ts b/tests/c1-integration/test/flight.test.ts index c27d955..78ab939 100644 --- a/tests/c1-integration/test/flight.test.ts +++ b/tests/c1-integration/test/flight.test.ts @@ -37,7 +37,7 @@ describe('flight sql', () => { test('makes query', async () => { const client = await getClient() - const buffer = await client.query('SELECT * FROM conclusion_feed') + const buffer = await client.query('SELECT * FROM conclusion_events') const data = tableFromIPC(buffer) console.log(JSON.stringify(data)) })