Skip to content

refactor: clean up PLC0415 noqa violations in experiments, evaluations, human_annotations#3030

Open
claude[bot] wants to merge 1 commit intomainfrom
claude/2994-20260314-030219
Open

refactor: clean up PLC0415 noqa violations in experiments, evaluations, human_annotations#3030
claude[bot] wants to merge 1 commit intomainfrom
claude/2994-20260314-030219

Conversation

@claude
Copy link
Contributor

@claude claude bot commented Mar 14, 2026

Technical Description

Cleans up # noqa: PLC0415 suppression comments in apps/experiments/, apps/evaluations/, and apps/human_annotations/ as part of issue #2994.

For each violation:

  • Moved to top-level when the import was purely a convenience (no circular dependency)
  • Kept as lazy with documented reason when the import avoids a circular dependency or avoids importing a heavy library at startup

Changes:

  • Moved convenience imports to module level in: experiments/models.py, experiments/views/experiment.py, experiments/management/commands/fix_vector_store_duplication.py, evaluations/evaluators.py, evaluations/tasks.py, evaluations/views/, evaluations/tables.py, evaluations/tests/, human_annotations/tests/test_views.py
  • Kept lazy with added explanatory comments for circular imports in: experiments/models.py (14 circular), experiments/tasks.py (langchain startup), evaluations/models.py, evaluations/utils.py, human_annotations/models.py

Note: Task 2 (utils + pipelines) was already completed by a previous PR (#3024) — all remaining noqa annotations there are properly documented circular/lazy imports.

Migrations

  • The migrations are backwards compatible

Demo

N/A - refactoring only

Docs and Changelog

  • This PR requires docs/changelog update

…s, human_annotations

- Move convenience imports to module level (Team, CustomTaggedItem, urlencode, translate_messages_with_llm, LlmProvider, django.conf.settings, QueryDict, FilterParams, compute_aggregates_for_run, json, EvaluationRunAggregate, evaluators, resolve_references)
- Remove duplicate inline imports in test files (AnnotationItem, ExperimentSessionFactory, ChatMessageFactory, AnnotationSessionsSelectionTable)
- Add noqa: PLC0415 - circular: <description> comments on all retained circular imports
- Add noqa: PLC0415 - lazy: <reason> on langchain import kept for startup performance

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 91.89189% with 3 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
apps/evaluations/utils.py 33.33% 2 Missing ⚠️
apps/experiments/tasks.py 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant