[Bug fix] - Fix package mypy (#6110)

* fix: package mypy

* types

* black
This commit is contained in:
montezdesousa
2024-02-22 11:11:44 +00:00
committed by GitHub
parent 50185180f0
commit 0ecb742955
6 changed files with 10 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
from pydantic import BaseModel, Field
from uuid_extensions import uuid7str
from uuid_extensions import uuid7str # type: ignore
class Tagged(BaseModel):

View File

@@ -1,12 +1,12 @@
import sys
from dataclasses import dataclass
from typing import Optional
from typing import Dict, Optional
# `slots` is available on Python >= 3.10
if sys.version_info >= (3, 10):
slots_true = {"slots": True}
else:
slots_true = {}
slots_true: Dict[str, bool] = {}
class BaseMetadata:

View File

@@ -24,7 +24,7 @@ class Container:
return getattr(obbject, "to_" + output_type)()
def _get_provider(
self, choice: Optional[str], cmd: str, available: Tuple[str]
self, choice: Optional[str], cmd: str, available: Tuple[str, ...]
) -> str:
"""Get the provider to use in execution."""
if choice is None:

View File

@@ -7,7 +7,7 @@ from openbb_core.app.utils import check_single_item, convert_to_basemodel
def filter_inputs(
data_processing: bool = False,
extra_info: Optional[Dict[str, List[str]]] = None,
extra_info: Optional[Dict[str, Dict[str, List[str]]]] = None,
**kwargs,
) -> dict:
"""Filter command inputs."""

View File

@@ -16,7 +16,9 @@ from openbb_core.provider.utils.descriptions import (
class TrailingDivYieldQueryParams(QueryParams):
"""Trailing Dividend Yield Query."""
symbol: str = Field(default=None, description=QUERY_DESCRIPTIONS.get("symbol", ""))
symbol: Optional[str] = Field(
default=None, description=QUERY_DESCRIPTIONS.get("symbol", "")
)
limit: Optional[int] = Field(
default=252,
description=f"{QUERY_DESCRIPTIONS.get('limit', '')}"

View File

@@ -3443,7 +3443,7 @@ class ROUTER_equity_fundamental(Container):
def trailing_dividend_yield(
self,
symbol: Annotated[
str, OpenBBCustomParameter(description="Symbol to get data for.")
Optional[str], OpenBBCustomParameter(description="Symbol to get data for.")
] = None,
limit: Annotated[
Optional[int],
@@ -3458,7 +3458,7 @@ class ROUTER_equity_fundamental(Container):
Parameters
----------
symbol : str
symbol : Optional[str]
Symbol to get data for.
limit : Optional[int]
The number of data entries to return. Default is 252, the number of trading days in a year.