GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — object dtype when empty query result · Issue #2148 · googleapis/python-bigquery

This repository was archived by the owner on Mar 6, 2026. It is now read-only.
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

object dtype when empty query result #2148

Copy link
Copy link
Closed
#2147
Closed
object dtype when empty query result#2148
#2147
Copy link
Labels
api: bigqueryIssues related to the googleapis/python-bigquery API.

Description

@yokomotod
yokomotod
opened on Mar 19, 2025
Issue body actions

Thanks for stopping by to let us know something could be better!

PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.

Please run down the following list and make sure you've tried the usual "quick fixes":

  • Search the issues already opened: https://github.com/googleapis/python-bigquery/issues
  • Search StackOverflow: https://stackoverflow.com/questions/tagged/google-cloud-platform+python

If you are still having issues, please be sure to include as much information as possible:

Environment details

  • OS type and version:
  • Python version: python --version: Python 3.13.2
  • pip version: pip --version: pip 25.0
  • google-cloud-bigquery version: pip show google-cloud-bigquery: 3.30.0

Steps to reproduce

>>> from google.cloud import bigquery

>>> bigquery.Client().query("SELECT * FROM (SELECT 1 as integer_field) WHERE 1 = 0").result().to_dataframe().dtypes
integer_field    object
dtype: object


>>> bigquery.Client().query("SELECT * FROM (SELECT 1 as integer_field) WHERE 1 = 1").result().to_dataframe().dtypes
integer_field    Int64
dtype: object

It uses subquery SELECT 1 as integer_field to skip table setup, but it's same on normal query from tables.

cause

https://github.com/googleapis/python-bigquery/blob/v3.30.0/google/cloud/bigquery/table.py#L2642

Activity

  1. product-auto-label
    added
    api: bigqueryIssues related to the googleapis/python-bigquery API.
    on Mar 19, 2025
  2. blunderbuss-gcf
    assigned
    hongalex
    on Mar 19, 2025
  3. Linchin
    unassigned
    hongalex
    on Mar 31, 2025
  4. Linchin
    closed this as completedin #2147on Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: bigqueryIssues related to the googleapis/python-bigquery API.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.