Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bigquery table.exists is documented to return a boolean, but it returns an Array instead #2446

Closed
xbill82 opened this issue Jul 11, 2017 · 4 comments
Assignees
Labels
type: question Request for information or clarification. Not an issue.

Comments

@xbill82
Copy link

xbill82 commented Jul 11, 2017

Environment details

  • OS: Linux
  • Node.js version: v6.9.4
  • npm version: 5.1.0
  • google-cloud-node version: ^0.9.5

Steps to reproduce

  1. require @google-cloud/bigquery
  2. bigQuery.dataset(this.dataSet).table(tableName).exists().then(exists => {return Array.isArray(exists})
  3. check it returns true

But the doc says the callback value is a Boolean.

@callmehiphop
Copy link
Contributor

For the callback mode, the value is indeed a boolean, however for promisified versions we always return an array (since promises can only resolve with a single argument). Something we need to improve on is highlighting the promise docs, because as it is now we simple show its usage in the last example.

Sorry for any confusion this caused you!

@callmehiphop callmehiphop added docs type: question Request for information or clarification. Not an issue. labels Jul 12, 2017
@xbill82
Copy link
Author

xbill82 commented Jul 12, 2017

Oh, I understand. Is this documented somewhere?

@callmehiphop
Copy link
Contributor

Well, if you go to the link you provided, the second example shows how to use that method with a promise. I don't think we explicitly state that promises return arrays anywhere.. but that is standard for every method in the library.

@stephenplusplus
Copy link
Contributor

This is a similar issue as #2167-- we plan to add docs that explain the basics of how promises work across the library. Sorry for the confusion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

3 participants