how to create a table using the following python bigquery api?Setting clustering column in BigQuery python apiwhy the following Bigquery insertion is failing?How do I copy a file in Python?How can I safely create a nested directory in Python?How can I remove a trailing newline in Python?How do I parse a string to a float or int in Python?How to get the current time in PythonHow can I make a time delay in Python?How do I get the number of elements in a list in Python?How do I concatenate two lists in Python?Create a dictionary with list comprehension in PythonHow do I lowercase a string in Python?
Can I sign legal documents with a smiley face?
What major Native American tribes were around Santa Fe during the late 1850s?
Should I stop contributing to retirement accounts?
Longest common substring in linear time
Visiting the UK as unmarried couple
How do ground effect vehicles perform turns?
What does this horizontal bar at the first measure mean?
Did arcade monitors have same pixel aspect ratio as TV sets?
Can the Supreme Court overturn an impeachment?
Varistor? Purpose and principle
THT: What is a squared annular “ring”?
Flux received by a negative charge
Global amount of publications over time
Some numbers are more equivalent than others
How much character growth crosses the line into breaking the character
Is a model fitted to data or is data fitted to a model?
Why do IPv6 unique local addresses have to have a /48 prefix?
How do I implement a file system driver driver in Linux?
MAXDOP Settings for SQL Server 2014
What is this type of notehead called?
Customize circled numbers
Do the concepts of IP address and network interface not belong to the same layer?
What (else) happened July 1st 1858 in London?
About a little hole in Z'ha'dum
how to create a table using the following python bigquery api?
Setting clustering column in BigQuery python apiwhy the following Bigquery insertion is failing?How do I copy a file in Python?How can I safely create a nested directory in Python?How can I remove a trailing newline in Python?How do I parse a string to a float or int in Python?How to get the current time in PythonHow can I make a time delay in Python?How do I get the number of elements in a list in Python?How do I concatenate two lists in Python?Create a dictionary with list comprehension in PythonHow do I lowercase a string in Python?
Hello I cloned the following repository:
https://github.com/tylertreat/BigQuery-Python
I was reading the documentation about creating a table as follows:
schema = [
'name': 'foo', 'type': 'STRING', 'mode': 'nullable',
'name': 'bar', 'type': 'FLOAT', 'mode': 'nullable'
]
created = client.create_table('dataset', 'my_table', schema)
I tried to execute the same in my console as follows:
>>> schema = [
... 'name': 'foo', 'type': 'STRING', 'mode': 'nullable',
... 'name': 'bar', 'type': 'FLOAT', 'mode': 'nullable'
... ]
>>> created = client.create_table('data_set_course', 'my_table_testing', schema)
I only got 'False' and when I check the visual interface there is no table.
>>> print(created)
False
>>>
I dont have any idea about the issue, I really frustrated since I just what to create one table, so I really would like to appreciate the support to overcome this task.
python google-bigquery python-3.6
add a comment |
Hello I cloned the following repository:
https://github.com/tylertreat/BigQuery-Python
I was reading the documentation about creating a table as follows:
schema = [
'name': 'foo', 'type': 'STRING', 'mode': 'nullable',
'name': 'bar', 'type': 'FLOAT', 'mode': 'nullable'
]
created = client.create_table('dataset', 'my_table', schema)
I tried to execute the same in my console as follows:
>>> schema = [
... 'name': 'foo', 'type': 'STRING', 'mode': 'nullable',
... 'name': 'bar', 'type': 'FLOAT', 'mode': 'nullable'
... ]
>>> created = client.create_table('data_set_course', 'my_table_testing', schema)
I only got 'False' and when I check the visual interface there is no table.
>>> print(created)
False
>>>
I dont have any idea about the issue, I really frustrated since I just what to create one table, so I really would like to appreciate the support to overcome this task.
python google-bigquery python-3.6
See this question stackoverflow.com/questions/55031720/… it has good python script to reuse
– Tamir Klein
Mar 8 at 7:47
add a comment |
Hello I cloned the following repository:
https://github.com/tylertreat/BigQuery-Python
I was reading the documentation about creating a table as follows:
schema = [
'name': 'foo', 'type': 'STRING', 'mode': 'nullable',
'name': 'bar', 'type': 'FLOAT', 'mode': 'nullable'
]
created = client.create_table('dataset', 'my_table', schema)
I tried to execute the same in my console as follows:
>>> schema = [
... 'name': 'foo', 'type': 'STRING', 'mode': 'nullable',
... 'name': 'bar', 'type': 'FLOAT', 'mode': 'nullable'
... ]
>>> created = client.create_table('data_set_course', 'my_table_testing', schema)
I only got 'False' and when I check the visual interface there is no table.
>>> print(created)
False
>>>
I dont have any idea about the issue, I really frustrated since I just what to create one table, so I really would like to appreciate the support to overcome this task.
python google-bigquery python-3.6
Hello I cloned the following repository:
https://github.com/tylertreat/BigQuery-Python
I was reading the documentation about creating a table as follows:
schema = [
'name': 'foo', 'type': 'STRING', 'mode': 'nullable',
'name': 'bar', 'type': 'FLOAT', 'mode': 'nullable'
]
created = client.create_table('dataset', 'my_table', schema)
I tried to execute the same in my console as follows:
>>> schema = [
... 'name': 'foo', 'type': 'STRING', 'mode': 'nullable',
... 'name': 'bar', 'type': 'FLOAT', 'mode': 'nullable'
... ]
>>> created = client.create_table('data_set_course', 'my_table_testing', schema)
I only got 'False' and when I check the visual interface there is no table.
>>> print(created)
False
>>>
I dont have any idea about the issue, I really frustrated since I just what to create one table, so I really would like to appreciate the support to overcome this task.
python google-bigquery python-3.6
python google-bigquery python-3.6
asked Mar 8 at 6:29
neo33neo33
74711021
74711021
See this question stackoverflow.com/questions/55031720/… it has good python script to reuse
– Tamir Klein
Mar 8 at 7:47
add a comment |
See this question stackoverflow.com/questions/55031720/… it has good python script to reuse
– Tamir Klein
Mar 8 at 7:47
See this question stackoverflow.com/questions/55031720/… it has good python script to reuse
– Tamir Klein
Mar 8 at 7:47
See this question stackoverflow.com/questions/55031720/… it has good python script to reuse
– Tamir Klein
Mar 8 at 7:47
add a comment |
1 Answer
1
active
oldest
votes
I have tested this code and it works for me:
from bigquery import get_client
# JSON key provided by Google
json_key = 'key.json'
client = get_client(json_key_file=json_key, readonly=False)
schema = [
'name': 'foo', 'type': 'STRING', 'mode': 'nullable',
'name': 'bar', 'type': 'FLOAT', 'mode': 'nullable'
]
created = client.create_table(dataset='yourDataset', table='tableToCreate', schema=schema)
You need to check 2 things:
readonlyparameter in theget_clientmethod is set toFalse. Otherwise BigQuery access is read-only.The service account or user provided in the
key.jsonfile has been granted with the permissions to create a BigQuery table. At least it must have theroles/bigquery.dataEditorrole granted. To do it run the following command:
gcloud projects add-iam-policy-binding [PROJECT_ID] --member "serviceAccount:[NAME]@[PROJECT_ID].iam.gserviceaccount.com" --role "roles/bigquery.dataEditor"
Anyway I recommend you to use the official Python Client for Google BigQuery, you will have better documentation and functionality. As well as a huge amount of code examples in the BigQuery official documentation.
Thanks I am testing this api, it seems to work, thanks a lot for the support
– neo33
Mar 8 at 16:08
after the past issue now I cant execute an insert I hope you could please soporte me: stackoverflow.com/questions/55067816/… I really appreciate the support
– neo33
Mar 8 at 17:11
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55057855%2fhow-to-create-a-table-using-the-following-python-bigquery-api%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I have tested this code and it works for me:
from bigquery import get_client
# JSON key provided by Google
json_key = 'key.json'
client = get_client(json_key_file=json_key, readonly=False)
schema = [
'name': 'foo', 'type': 'STRING', 'mode': 'nullable',
'name': 'bar', 'type': 'FLOAT', 'mode': 'nullable'
]
created = client.create_table(dataset='yourDataset', table='tableToCreate', schema=schema)
You need to check 2 things:
readonlyparameter in theget_clientmethod is set toFalse. Otherwise BigQuery access is read-only.The service account or user provided in the
key.jsonfile has been granted with the permissions to create a BigQuery table. At least it must have theroles/bigquery.dataEditorrole granted. To do it run the following command:
gcloud projects add-iam-policy-binding [PROJECT_ID] --member "serviceAccount:[NAME]@[PROJECT_ID].iam.gserviceaccount.com" --role "roles/bigquery.dataEditor"
Anyway I recommend you to use the official Python Client for Google BigQuery, you will have better documentation and functionality. As well as a huge amount of code examples in the BigQuery official documentation.
Thanks I am testing this api, it seems to work, thanks a lot for the support
– neo33
Mar 8 at 16:08
after the past issue now I cant execute an insert I hope you could please soporte me: stackoverflow.com/questions/55067816/… I really appreciate the support
– neo33
Mar 8 at 17:11
add a comment |
I have tested this code and it works for me:
from bigquery import get_client
# JSON key provided by Google
json_key = 'key.json'
client = get_client(json_key_file=json_key, readonly=False)
schema = [
'name': 'foo', 'type': 'STRING', 'mode': 'nullable',
'name': 'bar', 'type': 'FLOAT', 'mode': 'nullable'
]
created = client.create_table(dataset='yourDataset', table='tableToCreate', schema=schema)
You need to check 2 things:
readonlyparameter in theget_clientmethod is set toFalse. Otherwise BigQuery access is read-only.The service account or user provided in the
key.jsonfile has been granted with the permissions to create a BigQuery table. At least it must have theroles/bigquery.dataEditorrole granted. To do it run the following command:
gcloud projects add-iam-policy-binding [PROJECT_ID] --member "serviceAccount:[NAME]@[PROJECT_ID].iam.gserviceaccount.com" --role "roles/bigquery.dataEditor"
Anyway I recommend you to use the official Python Client for Google BigQuery, you will have better documentation and functionality. As well as a huge amount of code examples in the BigQuery official documentation.
Thanks I am testing this api, it seems to work, thanks a lot for the support
– neo33
Mar 8 at 16:08
after the past issue now I cant execute an insert I hope you could please soporte me: stackoverflow.com/questions/55067816/… I really appreciate the support
– neo33
Mar 8 at 17:11
add a comment |
I have tested this code and it works for me:
from bigquery import get_client
# JSON key provided by Google
json_key = 'key.json'
client = get_client(json_key_file=json_key, readonly=False)
schema = [
'name': 'foo', 'type': 'STRING', 'mode': 'nullable',
'name': 'bar', 'type': 'FLOAT', 'mode': 'nullable'
]
created = client.create_table(dataset='yourDataset', table='tableToCreate', schema=schema)
You need to check 2 things:
readonlyparameter in theget_clientmethod is set toFalse. Otherwise BigQuery access is read-only.The service account or user provided in the
key.jsonfile has been granted with the permissions to create a BigQuery table. At least it must have theroles/bigquery.dataEditorrole granted. To do it run the following command:
gcloud projects add-iam-policy-binding [PROJECT_ID] --member "serviceAccount:[NAME]@[PROJECT_ID].iam.gserviceaccount.com" --role "roles/bigquery.dataEditor"
Anyway I recommend you to use the official Python Client for Google BigQuery, you will have better documentation and functionality. As well as a huge amount of code examples in the BigQuery official documentation.
I have tested this code and it works for me:
from bigquery import get_client
# JSON key provided by Google
json_key = 'key.json'
client = get_client(json_key_file=json_key, readonly=False)
schema = [
'name': 'foo', 'type': 'STRING', 'mode': 'nullable',
'name': 'bar', 'type': 'FLOAT', 'mode': 'nullable'
]
created = client.create_table(dataset='yourDataset', table='tableToCreate', schema=schema)
You need to check 2 things:
readonlyparameter in theget_clientmethod is set toFalse. Otherwise BigQuery access is read-only.The service account or user provided in the
key.jsonfile has been granted with the permissions to create a BigQuery table. At least it must have theroles/bigquery.dataEditorrole granted. To do it run the following command:
gcloud projects add-iam-policy-binding [PROJECT_ID] --member "serviceAccount:[NAME]@[PROJECT_ID].iam.gserviceaccount.com" --role "roles/bigquery.dataEditor"
Anyway I recommend you to use the official Python Client for Google BigQuery, you will have better documentation and functionality. As well as a huge amount of code examples in the BigQuery official documentation.
answered Mar 8 at 11:25
llompallesllompalles
980414
980414
Thanks I am testing this api, it seems to work, thanks a lot for the support
– neo33
Mar 8 at 16:08
after the past issue now I cant execute an insert I hope you could please soporte me: stackoverflow.com/questions/55067816/… I really appreciate the support
– neo33
Mar 8 at 17:11
add a comment |
Thanks I am testing this api, it seems to work, thanks a lot for the support
– neo33
Mar 8 at 16:08
after the past issue now I cant execute an insert I hope you could please soporte me: stackoverflow.com/questions/55067816/… I really appreciate the support
– neo33
Mar 8 at 17:11
Thanks I am testing this api, it seems to work, thanks a lot for the support
– neo33
Mar 8 at 16:08
Thanks I am testing this api, it seems to work, thanks a lot for the support
– neo33
Mar 8 at 16:08
after the past issue now I cant execute an insert I hope you could please soporte me: stackoverflow.com/questions/55067816/… I really appreciate the support
– neo33
Mar 8 at 17:11
after the past issue now I cant execute an insert I hope you could please soporte me: stackoverflow.com/questions/55067816/… I really appreciate the support
– neo33
Mar 8 at 17:11
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55057855%2fhow-to-create-a-table-using-the-following-python-bigquery-api%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
See this question stackoverflow.com/questions/55031720/… it has good python script to reuse
– Tamir Klein
Mar 8 at 7:47