Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

`Pandas4Warning` emitted when converting a query result or table with a timestamp-with-timezone to a pandas dataframe

Đang mở Phù hợp với người mới
#708 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
70/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
pandas, python
Lĩnh vực
data

Hướng nghiên cứu

Báo cáo chỉ ra src/pyresult.cpp, đặc biệt là lời gọi .drop() ở các dòng 303–306 và logic chuyển đổi dấu thời gian có múi giờ ở các dòng 314–323. Đọc các phần đó và tái hiện cảnh báo bằng truy vấn được cung cấp cùng pandas 3.1.0. Hoàn thành khi việc chuyển đổi một kết quả có múi giờ không còn phát ra cảnh báo inplace đã lỗi thời.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

needs triage
What happens?

The following warning is emitted when converting to a pandas dataframe:

Pandas4Warning: The inplace keyword in DataFrame.drop is deprecated and will be removed in a future version (PDEP-8).
See https://pandas.pydata.org/docs/dev/whatsnew/v3.1.0.html#deprecation-inplace for more details.

The actual deprecation docs are at:

https://pandas.pydata.org/docs/whatsnew/v3.1.0.html#deprecated-inplace-keyword-for-various-methods

FWIW, the only place I was able to find where .drop() is called is

https://github.com/duckdb/duckdb-python/blob/4154efc6aa9114a04ee705e2182e044e13381fff/src/pyresult.cpp#L303-L306

And the logic that's calling this for timestamptz columns seems to be

https://github.com/duckdb/duckdb-python/blob/4154efc6aa9114a04ee705e2182e044e13381fff/src/pyresult.cpp#L314-L323

To Reproduce
# /// script
# requires-python = "==3.15.*"
# dependencies = ["duckdb==2.0.0", "pandas==3.1.0"]
# ///
import warnings

import duckdb

warnings.simplefilter("error")  # same effect as `python -W error`

# Any timezone-aware timestamp column triggers it; a plain `select 1 a` does not.
duckdb.sql("select timestamptz '2020-01-01 00:00:00+00' as tz").df()
OS:

OSX

DuckDB Package Version:

2.0.0

Python Version:

3.15

Full Name:

Edgar Ramírez Mondragón

Affiliation:

Meltano

What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.

I have tested with a stable release

Did you include all relevant data sets for reproducing the issue?

Yes

Did you include all code required to reproduce the issue?
  • Yes, I have
Did you include all relevant configuration to reproduce the issue?
  • Yes, I have
Ngôn ngữ chính
Python
Star
194
Fork
119
Merge trung bình
19 giờ 31 phút
Pull request đã merge (30 ngày)
50

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của duckdb/duckdb-python

Tất cả issue của duckdb/duckdb-python

Issue tương tự

Thêm issue về Python

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.