Why this change is needed: PostgreSQLDB class doesn't have a fetch() method. The migration code was incorrectly using db.fetch() for batch data retrieval, causing AttributeError during E2E tests. How it solves it: 1. Changed db.fetch(sql, params) to db.query(sql, params, multirows=True) 2. Updated all test mocks to support the multirows parameter 3. Consolidated mock_query implementation to handle both single and multi-row queries Impact: - PostgreSQL legacy data migration now works correctly in E2E tests - All unit tests pass (6/6) - Aligns with PostgreSQLDB's actual API Testing: - pytest tests/test_postgres_migration.py -v (6/6 passed) - Updated test_postgres_migration_trigger mock - Updated test_scenario_2_legacy_upgrade_migration mock - Updated base mock_pg_db fixture |
||
|---|---|---|
| .. | ||
| conftest.py | ||
| README_WORKSPACE_ISOLATION_TESTS.md | ||
| test_aquery_data_endpoint.py | ||
| test_base_storage_integrity.py | ||
| test_curl_aquery_data.sh | ||
| test_e2e_multi_instance.py | ||
| test_embedding_func.py | ||
| test_graph_storage.py | ||
| test_lightrag_ollama_chat.py | ||
| test_postgres_migration.py | ||
| test_postgres_retry_integration.py | ||
| test_qdrant_migration.py | ||
| test_workspace_isolation.py | ||
| test_write_json_optimization.py | ||