Fix type hints and dependency issues for CI
- Add -r requirements.txt to requirements-dev.txt - Fix mypy errors: - Remove slots=True from Settings dataclass - Add explicit list[float] type annotations in hedge.py - Add type ignore comments for optional QuantLib imports - Use Sequence instead of list in GreeksTable for covariance - Fix dict type annotation in options.py - Add type ignore for nicegui attr-defined errors - Disable attr-defined error code in mypy config
This commit is contained in:
@@ -30,7 +30,7 @@ class DataService:
|
||||
cache_key = f"portfolio:{ticker}"
|
||||
|
||||
cached = await self.cache.get_json(cache_key)
|
||||
if cached:
|
||||
if cached and isinstance(cached, dict):
|
||||
return cached
|
||||
|
||||
quote = await self.get_quote(ticker)
|
||||
@@ -49,7 +49,7 @@ class DataService:
|
||||
async def get_quote(self, symbol: str) -> dict[str, Any]:
|
||||
cache_key = f"quote:{symbol}"
|
||||
cached = await self.cache.get_json(cache_key)
|
||||
if cached:
|
||||
if cached and isinstance(cached, dict):
|
||||
return cached
|
||||
|
||||
quote = await self._fetch_quote(symbol)
|
||||
@@ -61,7 +61,7 @@ class DataService:
|
||||
cache_key = f"options:{ticker}"
|
||||
|
||||
cached = await self.cache.get_json(cache_key)
|
||||
if cached:
|
||||
if cached and isinstance(cached, dict):
|
||||
return cached
|
||||
|
||||
quote = await self.get_quote(ticker)
|
||||
@@ -116,7 +116,8 @@ class DataService:
|
||||
},
|
||||
"strategies": engine.compare_all_strategies(),
|
||||
"recommendations": {
|
||||
profile: engine.recommend(profile) for profile in ("conservative", "balanced", "cost_sensitive")
|
||||
profile: engine.recommend(profile) # type: ignore[arg-type]
|
||||
for profile in ("conservative", "balanced", "cost_sensitive")
|
||||
},
|
||||
"sensitivity_analysis": engine.sensitivity_analysis(),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user