You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
estou com um problema para abrir os arquivos via sql
quando eu rodo um arquivo via bd.read_table tudo funciona certinho, mas quando eu tento via bd.read_sql aparece esse erro aqui (abaixo). é algum problema no "billing_project_id", alguma sugestão do que pode ser?
ah..é sensacional o projeto de vocês
cordialmente
Lucas
Traceback (most recent call last)
~\Anaconda3\lib\site-packages\pandas_gbq\gbq.py in _download_results(self, query_job, max_results, progress_bar_type)
549
--> 550 query_job.result()
551 # Get the table schema, so that we can list rows.
~\Anaconda3\lib\site-packages\google\cloud\bigquery\job.py in result(self, retry, timeout)
811 # TODO: modify PollingFuture so it can pass a retry argument to done().
--> 812 return super(_AsyncJob, self).result(timeout=timeout)
813
~\Anaconda3\lib\site-packages\google\api_core\future\polling.py in result(self, timeout, retry)
133 # Pylint doesn't recognize that this is valid in this case.
--> 134 raise self._exception
135
BadRequest: 400 No matching signature for operator = for argument types: INT64, STRING. Supported signature: ANY = ANY at [4:76]
1:
2: SELECT estado.uf AS state, estado.municipio AS town, nomes.nome AS name, nomes.qtde_nascimentos_ate_2010 AS freq
3: FROM basedosdados.br_ibge_nomes_brasil.quantidade_municipio_nome_2010 AS nomes
4: INNER JOIN basedosdados.br_bd_diretorios_brasil.municipio AS estado ON nomes.id_municipio = estado.id_municipio
5:
| . | . | . | . | . | . | . | . | . | . | . |
During handling of the above exception, another exception occurred:
BaseDosDadosException Traceback (most recent call last)
in
5 INNER JOIN basedosdados.br_bd_diretorios_brasil.municipio AS estado ON nomes.id_municipio = estado.id_municipio
6 ''',
----> 7 billing_project_id='level-datum-268001'
8 )
~\Anaconda3\lib\site-packages\basedosdados\download\download.py in read_sql(query, billing_project_id, from_file, reauth)
165 except (OSError, ValueError):
166 raise BaseDosDadosException(
--> 167 "\nWe are not sure which Google Cloud project should be billed.\n"
168 "First, you should make sure that you have a Google Cloud project.\n"
169 "If you don't have one, set one up following these steps: \n"
BaseDosDadosException:
We are not sure which Google Cloud project should be billed.
First, you should make sure that you have a Google Cloud project.
If you don't have one, set one up following these steps:
1. Go to this link https://console.cloud.google.com/projectselector2/home/dashboard
2. Agree with Terms of Service if asked
3. Click in Create Project
4. Put a cool name in your project
5. Hit create
Copy the Project ID, (notice that it is not the Project Name)
Now, you have two options:
Add an argument to your function poiting to the billing project id.
Like bd.read_table('br_ibge_pib', 'municipios', billing_project_id=<YOUR_PROJECT_ID>)
You can set a project_id in the environment by running the following command in your terminal: gcloud config set project <YOUR_PROJECT_ID>. Bear in mind that you need gcloud installed.
The text was updated successfully, but these errors were encountered:
oi, tudo bom?
estou com um problema para abrir os arquivos via sql
quando eu rodo um arquivo via bd.read_table tudo funciona certinho, mas quando eu tento via bd.read_sql aparece esse erro aqui (abaixo). é algum problema no "billing_project_id", alguma sugestão do que pode ser?
ah..é sensacional o projeto de vocês
cordialmente
Lucas
~\Anaconda3\lib\site-packages\pandas_gbq\gbq.py in _download_results(self, query_job, max_results, progress_bar_type)
549
--> 550 query_job.result()
551 # Get the table schema, so that we can list rows.
~\Anaconda3\lib\site-packages\google\cloud\bigquery\job.py in result(self, page_size, max_results, retry, timeout, start_index)
3206 try:
-> 3207 super(QueryJob, self).result(retry=retry, timeout=timeout)
3208
~\Anaconda3\lib\site-packages\google\cloud\bigquery\job.py in result(self, retry, timeout)
811 # TODO: modify PollingFuture so it can pass a retry argument to done().
--> 812 return super(_AsyncJob, self).result(timeout=timeout)
813
~\Anaconda3\lib\site-packages\google\api_core\future\polling.py in result(self, timeout, retry)
133 # Pylint doesn't recognize that this is valid in this case.
--> 134 raise self._exception
135
BadRequest: 400 No matching signature for operator = for argument types: INT64, STRING. Supported signature: ANY = ANY at [4:76]
(job ID: f809e509-5d5c-40a2-aff0-72e03de6d998)
1:
2: SELECT estado.uf AS state, estado.municipio AS town, nomes.nome AS name, nomes.qtde_nascimentos_ate_2010 AS freq
3: FROM basedosdados.br_ibge_nomes_brasil.quantidade_municipio_nome_2010 AS nomes
4: INNER JOIN basedosdados.br_bd_diretorios_brasil.municipio AS estado ON nomes.id_municipio = estado.id_municipio
5:
| . | . | . | . | . | . | . | . | . | . | . |
During handling of the above exception, another exception occurred:
GenericGBQException Traceback (most recent call last)
~\Anaconda3\lib\site-packages\basedosdados\download\download.py in read_sql(query, billing_project_id, from_file, reauth)
162 credentials=credentials(from_file=from_file, reauth=reauth),
--> 163 project_id=billing_project_id,
164 )
~\Anaconda3\lib\site-packages\pandas_gbq\gbq.py in read_gbq(query, project_id, index_col, col_order, reauth, auth_local_webserver, dialect, location, configuration, credentials, use_bqstorage_api, max_results, verbose, private_key, progress_bar_type)
966 max_results=max_results,
--> 967 progress_bar_type=progress_bar_type,
968 )
~\Anaconda3\lib\site-packages\pandas_gbq\gbq.py in run_query(self, query, max_results, progress_bar_type, **kwargs)
531 max_results=max_results,
--> 532 progress_bar_type=progress_bar_type,
533 )
~\Anaconda3\lib\site-packages\pandas_gbq\gbq.py in _download_results(self, query_job, max_results, progress_bar_type)
564 except self.http_error as ex:
--> 565 self.process_http_error(ex)
566 finally:
~\Anaconda3\lib\site-packages\pandas_gbq\gbq.py in process_http_error(ex)
432
--> 433 raise GenericGBQException("Reason: {0}".format(ex))
434
GenericGBQException: Reason: 400 No matching signature for operator = for argument types: INT64, STRING. Supported signature: ANY = ANY at [4:76]
(job ID: f809e509-5d5c-40a2-aff0-72e03de6d998)
1:
2: SELECT estado.uf AS state, estado.municipio AS town, nomes.nome AS name, nomes.qtde_nascimentos_ate_2010 AS freq
3: FROM basedosdados.br_ibge_nomes_brasil.quantidade_municipio_nome_2010 AS nomes
4: INNER JOIN basedosdados.br_bd_diretorios_brasil.municipio AS estado ON nomes.id_municipio = estado.id_municipio
5:
| . | . | . | . | . | . | . | . | . | . | . |
During handling of the above exception, another exception occurred:
BaseDosDadosException Traceback (most recent call last)
in
5 INNER JOIN basedosdados.br_bd_diretorios_brasil.municipio AS estado ON nomes.id_municipio = estado.id_municipio
6 ''',
----> 7 billing_project_id='level-datum-268001'
8 )
~\Anaconda3\lib\site-packages\basedosdados\download\download.py in read_sql(query, billing_project_id, from_file, reauth)
165 except (OSError, ValueError):
166 raise BaseDosDadosException(
--> 167 "\nWe are not sure which Google Cloud project should be billed.\n"
168 "First, you should make sure that you have a Google Cloud project.\n"
169 "If you don't have one, set one up following these steps: \n"
BaseDosDadosException:
We are not sure which Google Cloud project should be billed.
First, you should make sure that you have a Google Cloud project.
If you don't have one, set one up following these steps:
1. Go to this link https://console.cloud.google.com/projectselector2/home/dashboard
2. Agree with Terms of Service if asked
3. Click in Create Project
4. Put a cool name in your project
5. Hit create
Copy the Project ID, (notice that it is not the Project Name)
Now, you have two options:
Like
bd.read_table('br_ibge_pib', 'municipios', billing_project_id=<YOUR_PROJECT_ID>)
gcloud config set project <YOUR_PROJECT_ID>
. Bear in mind that you needgcloud
installed.The text was updated successfully, but these errors were encountered: