Skip to content

IP-7102: [compose] auto_wired 데코레이터 타입 호환성 개선#545

Merged
novdov merged 2 commits intomainfrom
ip-7102
Mar 12, 2026
Merged

IP-7102: [compose] auto_wired 데코레이터 타입 호환성 개선#545
novdov merged 2 commits intomainfrom
ip-7102

Conversation

@novdov
Copy link
Copy Markdown
Contributor

@novdov novdov commented Mar 12, 2026

목적

auto_wired 데코레이터의 타입 바운드가 일반 함수와 호환되지 않아 pyrefly 타입 체커에서 에러가 발생하는 문제 해결

변경 사항

  • auto_wired 타입 개선
    • HasSignature 프로토콜 제거, 타입 바운드를 Callable[..., Any]로 변경
    • __signature__ 직접 할당을 setattr로 전환하여 타입 안전성 확보
    • 테스트의 app.container 할당에 type ignore 추가
  • examples 코드 수정
    • repository.py의 불필요한 all 메서드 제거 및 import 정리
    • api.pyop.Eq 호출을 현재 API 시그니처에 맞게 수정

Summary by CodeRabbit

릴리스 노트

  • 버그 수정

    • 사용자 조회 쿼리의 이메일 필드 참조가 올바르게 수정되었습니다.
  • 리팩토링

    • 내부 타입 선언 및 모듈 임포트 경로가 정리되었습니다.
    • 함수 서명 처리 방식이 개선되었습니다.

@novdov novdov self-assigned this Mar 12, 2026
@pozalabs-workspace pozalabs-workspace bot added the Improvement New feature or request label Mar 12, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 12, 2026

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: 18810771-f793-4042-bbfb-00e2858be9c4

📥 Commits

Reviewing files that changed from the base of the PR and between 33c6c42 and 65fcba2.

📒 Files selected for processing (4)
  • compose/fastapi/wiring.py
  • examples/fastapi_example/src/user/adapter/repository.py
  • examples/fastapi_example/src/user/entrypoint/api.py
  • tests/fastapi/unit/test_auto_wired.py

Walkthrough

이 변경사항은 FastAPI 의존성 주입 시스템의 타입 정의를 단순화하고, 사용자 리포지토리의 불필요한 메서드를 제거하며, 이메일 쿼리 필드 참조를 수정합니다. 테스트 코드에 타입 체크 억제 주석을 추가합니다.

Changes

Cohort / File(s) Summary
FastAPI 자동 연결 개선
compose/fastapi/wiring.py
HasSignature Protocol 제거, auto_wired 제너릭 타입을 Callable[..., Any]로 변경, Protocol import 삭제, 함수 서명 설정 방식을 setattr()로 변경
사용자 어댑터 정리
examples/fastapi_example/src/user/adapter/repository.py
all() 메서드 제거, import 경로를 compose.repository에서 compose로 변경
사용자 API 쿼리 수정
examples/fastapi_example/src/user/entrypoint/api.py
retrieve_user_by_email에서 이메일 필드 쿼리 구성을 Eq(email=email)에서 ("email", email)로 변경
테스트 타입 주석
tests/fastapi/unit/test_auto_wired.py
app.container 할당에 type: ignore 주석 추가

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Protocol 제거하고 타입은 깔끔하게,
쿼리는 명확하고 메서드도 정리하니,
작은 개선들이 모여 코드가 반짝반짝,
FastAPI 여정은 계속된다! 🌟


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands and usage tips.

@novdov novdov merged commit 42942d2 into main Mar 12, 2026
5 checks passed
@novdov novdov deleted the ip-7102 branch March 12, 2026 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Improvement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant