Skip to content

BigQuery: Converting query results to dataframe fails to convert date columns #136

@darwinyip

Description

@darwinyip

Environment details

google-api-python-client==1.9.3
google-cloud-bigquery==1.25.0
pyarrow==0.17.1

Steps to reproduce

  1. Issuing a select statement that returns a date column and converting the results to dataframe fails to convert the date column and leaves it as string

Code example

select = "select DATE(date) as dt from [project:dataset.table]"
client = bigquery.Client()
job_config = bigquery.QueryJobConfig(use_legacy_sql=True)
select_job = client.query(select, job_config=job_config)
select_job.result()
df = select_job.to_dataframe()
df.dtypes

# dt    object

Metadata

Metadata

Labels

api: bigqueryIssues related to the googleapis/python-bigquery API.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions