Skip to content

Restriction.to_human_readable()にIDを出力するオプションを追加しました。 - #760

Merged
yuji38kwmt merged 2 commits into
mainfrom
20260723-1
Jul 23, 2026
Merged

Restriction.to_human_readable()にIDを出力するオプションを追加しました。#760
yuji38kwmt merged 2 commits into
mainfrom
20260723-1

Conversation

@yuji38kwmt

@yuji38kwmt yuji38kwmt commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

属性英語名が重複している場合は、属性IDを出力しないと特定できないので、IDを出力するオプションを追加しました。

@kci-pr-agent

kci-pr-agent Bot commented Jul 23, 2026

Copy link
Copy Markdown

Title

Refactor code structure for improved readability and maintainability


Description

  • Upgrade mypy constraint to >=2

Changes walkthrough 📝

Relevant files
Dependencies
pyproject.toml
Upgrade mypy version constraint                                                   

pyproject.toml

  • Bumped mypy dependency to >=2 for Python>=3.13
+1/-1     

Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • @kci-pr-agent

    kci-pr-agent Bot commented Jul 23, 2026

    Copy link
    Copy Markdown

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    依存性互換性

    mypy>=2 へのバージョンアップにより、既存の型チェック設定やプラグインとの互換性に影響が出る可能性があります。ローカル環境や CI 上での動作確認が必要です。

    "mypy>=2 ; python_version >= '3.13'",

    @kci-pr-agent

    kci-pr-agent Bot commented Jul 23, 2026

    Copy link
    Copy Markdown

    PR Code Suggestions ✨

    No code suggestions found for the PR.

    @yuji38kwmt yuji38kwmt changed the title Refactor code structure for improved readability and maintainability Restriction.to_human_readable()にIDを出力するオプションを追加しました。 Jul 23, 2026
    @yuji38kwmt
    yuji38kwmt requested a review from Copilot July 23, 2026 10:16

    Copilot AI left a comment

    Copy link
    Copy Markdown

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Pull request overview

    属性英語名が重複しているケースでも制約内容を特定できるように、Restriction.to_human_readable() の出力へ属性ID/選択肢ID/ラベルIDを付与できるオプション(include_ids)を追加するPRです。CLI等での制約表示のトラブルシュート性を高める変更になっています。

    Changes:

    • Restriction.to_human_readable(..., include_ids: bool = False) を追加し、必要に応じてID付き表現へ切り替え可能に変更
    • ID付きの人間向け文字列表現を生成する内部関数 _restriction_to_human_readable_with_ids() を追加
    • include_ids=True の挙動(属性ID/選択肢ID/ラベルIDの出力)をテストで追加
    • Python 3.13向けの lint 依存として mypy>=2 へ更新

    Reviewed changes

    Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

    File Description
    annofabapi/util/attribute_restrictions.py to_human_readable()include_ids を追加し、ID付き人間向け文字列表現の生成ロジックを実装
    tests/util/test_attribute_restrictions.py include_ids=True 時に属性ID/選択肢ID/ラベルIDが出力されることを検証するテストを追加
    pyproject.toml Python 3.13 条件付きで linter 依存の mypy 制約を mypy>=2 に更新

    @yuji38kwmt
    yuji38kwmt merged commit c793863 into main Jul 23, 2026
    10 checks passed
    @yuji38kwmt
    yuji38kwmt deleted the 20260723-1 branch July 23, 2026 10:20
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Labels

    None yet

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    2 participants