chore: fix all ruff lint warnings
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
- Remove unused datetime imports from openbb_service, market_service, quantitative_service (now using obb_utils.days_ago) - Remove unused variable 'maintains' in routes_sentiment - Remove unused imports in test files - Fix forward reference annotation in test helper
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
"""Unit tests for akshare_service.py - written FIRST (TDD RED phase)."""
|
||||
|
||||
from datetime import datetime
|
||||
from unittest.mock import MagicMock, patch
|
||||
from unittest.mock import patch
|
||||
|
||||
import pandas as pd
|
||||
import pytest
|
||||
|
||||
@@ -7,7 +7,6 @@ from unittest.mock import AsyncMock, MagicMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
import defi_service
|
||||
from defi_service import (
|
||||
get_chain_tvls,
|
||||
get_dex_volumes,
|
||||
|
||||
@@ -268,7 +268,7 @@ async def test_fetch_historical_prices_skips_none(mock_fetch_hist):
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
def _make_prices(symbols: list[str], n_days: int = 60) -> "pd.DataFrame":
|
||||
def _make_prices(symbols: list[str], n_days: int = 60):
|
||||
"""Build a deterministic price DataFrame with enough rows for t-SNE."""
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
@@ -383,7 +383,6 @@ async def test_cluster_stocks_no_data_raises(mock_fetch):
|
||||
@patch("portfolio_service.fetch_historical_prices", new_callable=AsyncMock)
|
||||
async def test_cluster_stocks_identical_returns_still_works(mock_fetch):
|
||||
"""t-SNE should not raise even when all symbols have identical returns."""
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
import portfolio_service
|
||||
|
||||
@@ -530,7 +529,6 @@ async def test_find_similar_stocks_no_data_raises(mock_fetch):
|
||||
@patch("portfolio_service.fetch_historical_prices", new_callable=AsyncMock)
|
||||
async def test_find_similar_stocks_target_not_in_data_raises(mock_fetch):
|
||||
"""find_similar_stocks raises ValueError when target symbol has no data."""
|
||||
import pandas as pd
|
||||
import portfolio_service
|
||||
|
||||
# Only universe symbols have data, not the target
|
||||
|
||||
Reference in New Issue
Block a user