This repository was archived by the owner on Jul 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
This repository was archived by the owner on Jul 20, 2023. It is now read-only.
Respect pageSize parameter #296
Copy link
Copy link
Closed
Labels
🚨This issue needs some love.This issue needs some love.api: datacatalogIssues related to the googleapis/nodejs-datacatalog API.Issues related to the googleapis/nodejs-datacatalog API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Environment details
- OS: MacOS BigSur 11.5.1
- Node.js version: 16.7.0
- npm version: 7.20.3
@google-cloud/datacatalogversion: 2.5.0
I wrote a request handler (fastify) that uses @google-cloud/datacatalog library. According to documentation I should pass pageSize to limit the number of results returned. However, responses to searchCatalog or searchCatalogAsync return hundreds or thousands of results when I pass pageSize parameter in the request body.
Seems like a bug? Or am I using this API incorrectly?
My request body is as follows:
{
"query": "country",
"pageSize": 50,
"orderBy": "relevance"
}My handler looks like this:
import { DataCatalogClient } from '@google-cloud/datacatalog'
const dc = new DataCatalogClient()
const projectId = 'some-project-id'
const search = async (req, res) => {
const { body } = req
const requestPayload = {
scope: {
includeProjectIds: [projectId],
},
...body
}
const result = await dc.searchCatalogAsync(requestPayload)
let results = []
for await(const r of result) {
results.push(r)
}
res.code(200).send(results)
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
🚨This issue needs some love.This issue needs some love.api: datacatalogIssues related to the googleapis/nodejs-datacatalog API.Issues related to the googleapis/nodejs-datacatalog API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.