mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-02-04 01:25:07 +08:00
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:
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user