Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Underscore Prepended to Numeric Column Labels #1093

Copy link
Copy link
Open
@b-schmeling

Description

@b-schmeling
Issue body actions

Environment details

  • OS type and version: MacOS Sonoma 4.5 (23F79)
  • Python version: 3.11.6
  • pip version: `23.3.1
  • sqlalchemy-bigquery version: 1.11.0

Steps to reproduce

  1. Attempt to label a column with a numeric column name (with or without quoted_name)
  2. Get the cursor description for this column. The name has a prepended underscore

Code example

import sqlalchemy as sa
engine = ****insert engine creation here****

with engine.connect() as conn:
    a = sa.literal("a")
    labeled_col = a.label(sa.sql.quoted_name("2", quote=True))
    res = conn.execute(sa.select(labeled_col))
    name = res.cursor.description[0].name

    res_2 = conn.execute("SELECT 'a' AS `2`")
    name_2 = res_2.cursor.description[0].name

assert name == name_2 == "2"

Stack trace

AssertionError: assert '_2' == '2'

Metadata

Metadata

Labels

api: bigqueryIssues related to the googleapis/python-bigquery-sqlalchemy API.Issues related to the googleapis/python-bigquery-sqlalchemy API.priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.type: questionRequest for information or clarification. Not an issue.Request 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

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.