Fix: remove unused imports and f-string formatting (#12935)

### What problem does this PR solve?

- Remove unused imports (Mock, patch, MagicMock, json, os,
RAGFLOW_COLUMNS, VECTOR_FIELD_PATTERN) from multiple files
- Replace f-string formatting with regular strings for console output
messages in cli.py
- Clean up unnecessary imports that were no longer being used in the
codebase

### Type of change

- [x] Refactoring
This commit is contained in:
Liu An
2026-02-02 12:11:39 +08:00
committed by GitHub
parent 332b11cf96
commit 1b587013d8
10 changed files with 12 additions and 20 deletions

View File

@ -7,7 +7,6 @@ import os
import tempfile
import pytest
from pathlib import Path
from datetime import datetime
from es_ob_migration.progress import MigrationProgress, ProgressManager
@ -90,7 +89,7 @@ class TestProgressManager:
def test_create_progress_manager_creates_dir(self, temp_dir):
"""Test that progress manager creates directory."""
new_dir = os.path.join(temp_dir, "new_progress")
manager = ProgressManager(progress_dir=new_dir)
ProgressManager(progress_dir=new_dir)
assert Path(new_dir).exists()
def test_create_progress(self, manager):
@ -225,7 +224,7 @@ class TestProgressManager:
def test_can_resume_running(self, manager):
"""Test can_resume for running migration."""
progress = manager.create_progress(
manager.create_progress(
es_index="ragflow_resume_running",
ob_table="ragflow_resume_running",
total_documents=1000,
@ -291,7 +290,7 @@ class TestProgressManager:
def test_progress_file_path(self, manager):
"""Test progress file naming."""
progress = manager.create_progress(
manager.create_progress(
es_index="ragflow_abc123",
ob_table="ragflow_abc123",
total_documents=100,

View File

@ -9,7 +9,6 @@ This module tests:
"""
import json
import pytest
from es_ob_migration.schema import (
RAGFlowSchemaConverter,
RAGFlowDataConverter,

View File

@ -2,9 +2,8 @@
Tests for migration verification.
"""
import json
import pytest
from unittest.mock import Mock, MagicMock
from unittest.mock import Mock
from es_ob_migration.verify import MigrationVerifier, VerificationResult