Skip to content

Well inventory CSV: sample_date stored with local timezone instead of UTC #634

@kbighorse

Description

@kbighorse

Summary

test_blank_depth_to_water_still_creates_water_level_records fails because sample_date is stored with the local timezone offset instead of UTC.

Expected

datetime(2025, 2, 15, 10, 30, tzinfo=timezone.utc)

Actual

datetime(2025, 2, 15, 10, 30, tzinfo=timezone(timedelta(days=-1, seconds=57600)))

The offset timedelta(days=-1, seconds=57600) corresponds to UTC-7 (MDT).

Location

  • Test: tests/test_well_inventory.py::test_blank_depth_to_water_still_creates_water_level_records (line 692)
  • Likely source: services/well_inventory_csv.py — datetime handling during CSV upload

Reproduction

uv run pytest tests/test_well_inventory.py::test_blank_depth_to_water_still_creates_water_level_records -v

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions