Skip to content

BUG: Unhandled ValueError when Bigquery called through io.gbq returns zero rows #10273

Closed
@ssaumitra

Description

@ssaumitra

Sample code below throws ValueError. Ideally it should return a DataFrame with zero rows.

import pandas as pd
#This query returns zero rows
query = "SELECT * FROM [publicdata:samples.wikipedia] where timestamp=-9999999"
df = pd.io.gbq.read_gbq(query, project_id="my_bigquery_project_id")
Job not yet complete...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pandas/io/gbq.py", line 341, in read_gbq
    final_df = concat(dataframe_list, ignore_index = True)
  File "pandas/tools/merge.py", line 754, in concat
    copy=copy)
  File "pandas/tools/merge.py", line 799, in __init__
    raise ValueError('All objects passed were None')
ValueError: All objects passed were None
INSTALLED VERSIONS
------------------
commit: b144cc1285e8f353112075b3d4eff75a68ad1699
python: 2.7.9.final.0
python-bits: 64
OS: Darwin
OS-release: 14.3.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: None

pandas: 0.16.1-64-gb144cc1
nose: 1.3.6
Cython: 0.22
numpy: 1.9.2
scipy: None
statsmodels: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.4.1
pytz: 2015.4
bottleneck: None
tables: None
numexpr: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: 0.9.1
apiclient: 1.4.0
sqlalchemy: None
pymysql: None
psycopg2: None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions