googleapis / googleapis/google-cloud-python

Underscore Prepended to Numeric Column Labels

Đang mở
#15,780 5 bình luận 1 reaction 1 người được giao Được giao cho @chalmerlowe Xem trên GitHub
api: bigquery priority: p3 type: question
Ngôn ngữ chính
Python
Star
5.4k
Fork
1.8k
Merge trung bình
3 ngày 4 giờ
Pull request đã merge (30 ngày)
122

Mô tả

#### 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

```python
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'
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.