Skip to content

Commit

Permalink
refactor: don't use firstValueFrom if using toArray (#6)
Browse files Browse the repository at this point in the history
Closes #5
  • Loading branch information
westonpace authored Dec 18, 2024
1 parent 5c30926 commit b514a6b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { FlightSqlClient } from "./flightsql";
import { arrow as fsql } from "./generated/flightsql";
import { RecordBatch } from "apache-arrow";
import { pipe, toArray } from "iter-ops";
import { firstValueFrom } from "./async_util";

/**
* Options for creating a new client.
Expand Down Expand Up @@ -78,7 +77,7 @@ export class QueryResult {
* @returns an array of Arrow record batches
*/
public async collectToArrow(): Promise<RecordBatch[]> {
const batches = await firstValueFrom(pipe(this.raw, toArray()));
const batches = await pipe(this.raw, toArray()).first;
return batches ?? [];
}

Expand Down

0 comments on commit b514a6b

Please sign in to comment.