-
Notifications
You must be signed in to change notification settings - Fork 125
Closed
Labels
api: bigqueryIssues related to the googleapis/python-bigquery-pandas API.Issues related to the googleapis/python-bigquery-pandas API.priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.
Description
Hey, I've tried to read parquet files using gbq, and it returns an integer instead of timestamps. example attached below
it works for me on python 3.10, same pandas and pandas_gbq version
Environment details
- OS type and version: ubuntu 4.22
- Python version: python 3.11.4
- pip version: 22.3.1
pandas-gbqversion: 0.19.2
Steps to reproduce
- install python 3.11
Code example
import pandas as pd
s = pd.Series(0, index=pd.date_range('2021-01-01 01', periods=24, freq='H', tz='UTC', name='ts')).to_frame().reset_index()
save_path = 'gs://my_bucket/test_dir'
s.to_parquet(f'{save_path}/test_gbq.parquet', index=False)
s_res = pd.read_gbq('select * from test_data',
configuration={'query': {
'tableDefinitions':
{'test_data': {'sourceFormat': 'PARQUET',
'sourceUris': [f'{save_path}/*.parquet'],
'autodetect': True}}}},
location='eu'
)
print(s)
# ts 0
# 0 2021-01-01 01:00:00+00:00 0
# 1 2021-01-01 02:00:00+00:00 0
# 2 2021-01-01 03:00:00+00:00 0
# 3 2021-01-01 04:00:00+00:00 0
# 4 2021-01-01 05:00:00+00:00 0
print(s_res)
# ts 0
# 0 1609462800000000000 0
# 1 1609466400000000000 0
# 2 1609470000000000000 0
# 3 1609473600000000000 0
# 4 1609477200000000000 0Thanks!
Metadata
Metadata
Assignees
Labels
api: bigqueryIssues related to the googleapis/python-bigquery-pandas API.Issues related to the googleapis/python-bigquery-pandas API.priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.