googleapis / googleapis/google-cloud-python

add `index=True` option to `to_gbq`

Đang mở
#14,481 0 bình luận 0 reaction 1 người được giao Được @tswast nhận Xem trên GitHub
api: bigquery type: feature request
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ả

**Is your feature request related to a problem? Please describe.**

I'd like to be able to control when the DataFrame Index/MultiIndex is included in the serialized BigQuery table.

**Describe the solution you'd like**

I'd like a boolean parameter `index=True` to enable writing the index column(s) to the BigQuery table. For backwards compatibility, we might need to keep this parameter `False` by default.

**Describe alternatives you've considered**

Folks can always call `DataFrame.reset_index(drop=False)` before uploading if they want this behavior, but I do think it'd be nice to be consistent with other I/O methods.

**Additional context**

* https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_parquet.html (Has three options, where None is like True but serializes RangeIndex to metadata instead of as a column)
* https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_csv.html (index=True by default. Also includes an index_label="string-here" parameter to override the index name)

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.