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

GST is read as Gulf Standard Time (UTC+4) instead of Guam Standard Time (UTC+10)

Đã đóng Phù hợp với người mới
#454 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

@yang00333 đang làm issue này rồi.

Từ ngày 16/10/2026.

  • #455 của @yang00333 — đang mở

Đá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
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả 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

Các offset sai nằm trong bảng viết tắt ở dataretrieval/codes/timezones.py, và _build_utc_datetime trong dataretrieval/_wqx.py áp dụng chúng. Chạy lại bước tái hiện trong issue, bước này gọi _attach_datetime_columns, để thấy GST rơi vào +0400. Đổi GST thành +1000, NZDT và FJST thành +1300, và thêm HDT với -0900. Sau đó thêm test theo kiểu của #432. Công việc hoàn thành khi bước tái hiện in ra 2024-06-01 00:00:00+00:00 và các trường hợp mới đều đạt. Giữ nguyên các viết tắt mơ hồ khác, trừ khi maintainer yêu cầu.

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

Mô tả

codes.timezones puts GST on the +0400 row (Gulf Standard Time):

https://github.com/DOI-USGS/dataretrieval-python/blob/d5254bef635327765418dd590462246d4d1227df/dataretrieval/codes/timezones.py#L19

and _wqx._build_utc_datetime applies that offset when it builds the UTC column:

https://github.com/DOI-USGS/dataretrieval-python/blob/d5254bef635327765418dd590462246d4d1227df/dataretrieval/_wqx.py#L37

The USGS time-zone codes (https://help.waterdata.usgs.gov/tz) and the WQX TimeZone domain both define GST as Guam Standard Time, UTC+10. The same table feeds the *DateTime columns that wqp.get_results() and waterdata.get_samples() append, and utils.format_datetime(), so any result stamped GST is placed six hours off. (I haven't found a live response that carries GST yet; the Guam results I pulled from the Water Quality Portal have no times.)

Reproduce:

import pandas as pd
from dataretrieval._wqx import _attach_datetime_columns

df = pd.DataFrame({
    "Activity_StartDate": ["2024-06-01"],
    "Activity_StartTime": ["10:00:00"],
    "Activity_StartTimeZone": ["GST"],
})
print(_attach_datetime_columns(df)["Activity_StartDateTime"][0])
# 2024-06-01 06:00:00+00:00   expected 2024-06-01 00:00:00+00:00

Comparing the table with the USGS list turned up two smaller problems:

  • NZDT is +1330; the USGS list has UTC+13 (as does FJST, Fiji Summer Time).
  • HDT (Hawaii-Aleutian Daylight Time, UTC-9) is in the USGS list but not in the table, so it becomes NaT.

A few other abbreviations also mean different zones in the two lists (for example EAST, CCT, NFT, WAT, and SST, which the USGS list uses for Swedish Summer Time but WQX uses for Samoa). I have left those alone, since I don't know which ones actually appear in responses.

I have a small fix with tests ready for GST, NZDT/FJST, and HDT, following the pattern of #432. Happy to open a PR if that's welcome.

Python 3.11, pandas 3.0.2, dataretrieval main (d5254bef).

Ngôn ngữ chính
Python
Star
269
Fork
67
Merge trung bình
3 ngày 17 giờ
Pull request đã merge (30 ngày)
18

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 DOI-USGS/dataretrieval-python

Tất cả issue của DOI-USGS/dataretrieval-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.