Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion handwritten/firestore/dev/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1895,7 +1895,12 @@ export class Firestore implements firestore.Firestore {
request: {},
requestTag: string,
): Promise<Duplex> {
const callOptions = this.createCallOptions(methodName);
// gax ignores autoPaginate for stream paging methods (e.g.
// partitionQueryStream) and warns if it is not explicitly disabled.
const callOptions = {
...this.createCallOptions(methodName),
autoPaginate: false,
};

const bidirectional = methodName === 'listen';
let numResponses = 0;
Expand Down
13 changes: 13 additions & 0 deletions handwritten/firestore/dev/test/partition-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,19 @@ describe('Partition Query', () => {
});
});

it('disables autoPaginate for the stream request', async () => {
const overrides: ApiOverride = {
partitionQueryStream: (request, options) => {
expect(options?.autoPaginate).to.be.false;
return stream({values: [{referenceValue: DOC1}]});
},
};
const firestore = await createInstance(overrides);
const query = firestore.collectionGroup('collectionId');
const result = await getPartitions(query, 2);
expect(result.length).to.equal(2);
});

it('does not issue RPC if only a single partition is requested', () => {
const desiredPartitionsCount = 1;

Expand Down
Loading