chore: fix all ruff lint warnings
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:
Yaojia Wang
2026-03-19 23:19:08 +01:00
parent 0f7341b158
commit ec005c91a9
7 changed files with 2 additions and 10 deletions

View File

@@ -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