fix: datetime.utcnow / HTTP_422 deprecation 제거 (#26, #27) #35

Merged
xhh merged 1 commit from issue-26-27-deprecations into main 2026-04-22 03:39:06 +09:00
Owner

Summary

#26, #27 을 함께 처리.

#26 datetime.utcnow

  • financial_platform/utils/time.py::utc_now() 헬퍼 신설 — datetime.now(UTC).replace(tzinfo=None) 을 감싼 tz-naive UTC. 기존 DB 컬럼(tz-naive)과 섞어도 semantics 변화 없음.
  • 라우터 5개, scheduler/jobs, storage/database, ORM default/onupdate, scripts, 일부 테스트까지 전수 교체
  • ORM 컬럼을 DateTime(timezone=True) 로 바꾸는 마이그레이션은 범위 밖 (별도 이슈 필요)

#27 Starlette 422

  • HTTP_422_UNPROCESSABLE_ENTITYHTTP_422_UNPROCESSABLE_CONTENT (reports.py 1곳)

Test plan

  • ruff check clean
  • 47 tests pass
  • DeprecationWarning 로그가 pytest 출력에서 사라짐 (OpenBB/pydantic 외부 warning 만 잔존)

Closes #26
Closes #27

## Summary #26, #27 을 함께 처리. ### #26 datetime.utcnow - `financial_platform/utils/time.py::utc_now()` 헬퍼 신설 — `datetime.now(UTC).replace(tzinfo=None)` 을 감싼 tz-naive UTC. 기존 DB 컬럼(tz-naive)과 섞어도 semantics 변화 없음. - 라우터 5개, scheduler/jobs, storage/database, ORM default/onupdate, scripts, 일부 테스트까지 전수 교체 - ORM 컬럼을 `DateTime(timezone=True)` 로 바꾸는 마이그레이션은 범위 밖 (별도 이슈 필요) ### #27 Starlette 422 - `HTTP_422_UNPROCESSABLE_ENTITY` → `HTTP_422_UNPROCESSABLE_CONTENT` (reports.py 1곳) ## Test plan - [x] ruff check clean - [x] 47 tests pass - [x] DeprecationWarning 로그가 pytest 출력에서 사라짐 (OpenBB/pydantic 외부 warning 만 잔존) Closes #26 Closes #27
fix: datetime.utcnow/HTTP_422 deprecation 제거 (#26, #27)
All checks were successful
Tests (PR) / pytest (pull_request) Successful in 28s
489e7cf591
#26 datetime.utcnow() → utils.time.utc_now()
-------------------------------------------
- `src/financial_platform/utils/time.py::utc_now()` 신규
  (= `datetime.now(UTC).replace(tzinfo=None)`, 기존 tz-naive 의미 보존)
- 라우터 5개(reports/watchlist/collect/system/auth), scheduler/jobs,
  storage/database, storage/models(ORM default/onupdate), scripts/apikey,
  scripts/test_collection, tests/api/test_collect 에서 전수 교체
- ORM `DateTime(timezone=True)` 마이그레이션은 범위 밖 — 별도 이슈로

#27 HTTP_422_UNPROCESSABLE_ENTITY → _CONTENT
-------------------------------------------
- `api/routers/reports.py` 한 곳 교체

검증
----
- 47 tests pass, ruff check clean
- DeprecationWarning 로그가 pytest 출력에서 사라짐 (외부 라이브러리
  openbb/pydantic 관련 warning 만 남음)

CLAUDE.md 에 함정 패턴 2건 반영:
- utc_now 헬퍼 컨벤션
- Starlette 422 상수 이름 변경

Closes #26
Closes #27

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
xhh merged commit 5b32177ab7 into main 2026-04-22 03:39:06 +09:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
xhh/financial-data-platform!35
No description provided.