-
Notifications
You must be signed in to change notification settings - Fork 595
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
createTable - Required parameter is missing #1422
Comments
I believe this should work: cliDataset.createTable(type, {
schema: {
fields: [
{ type: 'string', name: 'type' },
{ type: 'string', name: 'service' },
{ type: 'string', name: 'uuid' },
{ type: 'timestamp', name: 'created_at' },
{
name: 'data',
type: 'record', // <-- new
fields: [
{
type: 'string',
name: 'favorite_flavor'
}
]
}
]
}
}, function(err, table, apiResponse) {
// ...
}); |
Okay, I figured out what I was doing wrong here. First, my table id was undefined since I was sending incorrect data to my API. However, in the process of tweaking things and trying to get this to work, I tried using the @stephenplusplus thanks for the help! |
Yeah, I think we can make this easier. We try to focus on the common use cases and decorate them to make things easier. This leaves holes where we link to the upstream API docs to show all of the options (https://cloud.google.com/bigquery/docs/reference/v2/tables#resource) from our docs (https://googlecloudplatform.github.io/gcloud-node/#/docs/v0.36.0/bigquery/dataset?method=createTable). Making this easier should be pretty... easy. I'll re-open this issue and ping you when I have a PR, if you don't mind. Thanks for calling this out! |
Sounds great, thanks! |
I'm creating a table with an existing dataset like this:
This is the payload being sent to the
/tables
endpoint as I inspected it in the gcloud node library (pretty-printed):The API is returning a vague error about a missing required parameter, but doesn't say which one, and I believe I'm using the node API correctly (very possible I'm not). Note: I also tried removing the
data
record in case I wasn't doing that properly, but I receive the same response:The text was updated successfully, but these errors were encountered: