mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-28 04:52:07 +00:00
fix lint errors
This commit is contained in:
@@ -12,10 +12,10 @@ from openbb_core.provider.abstract.query_params import QueryParams
|
||||
from openbb_core.provider.utils.descriptions import QUERY_DESCRIPTIONS
|
||||
from openbb_core.provider.utils.errors import EmptyDataError
|
||||
from pydantic import ConfigDict, Field, create_model
|
||||
from pydantic.config import JsonDict
|
||||
|
||||
_HIDE: dict[str, Any] = {"x-widget_config": {"hide": True}}
|
||||
|
||||
# Friendly column header for each cross-section stub field.
|
||||
_STUB_HEADER: dict[str, str] = {
|
||||
"industry": "Industry",
|
||||
"period": "Period",
|
||||
@@ -53,7 +53,6 @@ def _widget(
|
||||
"$.source": ["BLS"],
|
||||
"$.category": "Economy",
|
||||
"$.subCategory": subcategory,
|
||||
# Table renders first; the chart is an opt-in toggle.
|
||||
"table": {
|
||||
"showAll": True,
|
||||
"enableCharts": True,
|
||||
@@ -86,6 +85,7 @@ class _ChartData(Data):
|
||||
|
||||
def _make_base(kind: str, period_header: str) -> type[Data]:
|
||||
"""Build the shared (stub + bookkeeping) fields for a chart's Data model."""
|
||||
stub_cfg: JsonDict
|
||||
if kind == "ts":
|
||||
stub_field = "date"
|
||||
stub_type: Any = dateType
|
||||
|
||||
@@ -13,6 +13,7 @@ from openbb_core.provider.abstract.fetcher import Fetcher
|
||||
from openbb_core.provider.abstract.query_params import QueryParams
|
||||
from openbb_core.provider.utils.errors import EmptyDataError
|
||||
from pydantic import ConfigDict, Field, field_serializer
|
||||
from pydantic.config import JsonDict
|
||||
|
||||
from openbb_bls.utils.constants import BLS_USER_AGENT
|
||||
|
||||
@@ -53,7 +54,7 @@ class _CpiNrQueryParams(QueryParams):
|
||||
)
|
||||
|
||||
|
||||
_LABEL_HOVER_CARD = {
|
||||
_LABEL_HOVER_CARD: JsonDict = {
|
||||
"x-widget_config": {
|
||||
"renderFn": "hoverCard",
|
||||
"renderFnParams": {
|
||||
|
||||
@@ -10,8 +10,9 @@ from openbb_core.provider.abstract.data import Data
|
||||
from openbb_core.provider.abstract.fetcher import Fetcher
|
||||
from openbb_core.provider.abstract.query_params import QueryParams
|
||||
from pydantic import Field, field_validator
|
||||
from pydantic.config import JsonDict
|
||||
|
||||
_VOL_COLOR_RULES = {
|
||||
_VOL_COLOR_RULES: JsonDict = {
|
||||
"colorRules": [
|
||||
{"condition": "lt", "value": 5, "color": "#2e7d32", "fill": True},
|
||||
{
|
||||
|
||||
@@ -95,7 +95,7 @@ class FederalReserveCallReportSectionedQueryParams(QueryParams):
|
||||
section: str = Field(
|
||||
default="Schedule RC - Balance Sheet",
|
||||
description="The Call Report schedule (section) to return.",
|
||||
json_schema_extra={"choices": CALL_REPORT_SECTIONS},
|
||||
json_schema_extra={"choices": list(CALL_REPORT_SECTIONS)},
|
||||
)
|
||||
all_periods: bool = Field(
|
||||
default=False,
|
||||
|
||||
@@ -41,7 +41,7 @@ class FederalReserveCustomPeerGroupQueryParams(QueryParams):
|
||||
section: str = Field(
|
||||
default="Summary Ratios",
|
||||
description="The UBPR report section (page) to return.",
|
||||
json_schema_extra={"choices": UBPR_SECTIONS},
|
||||
json_schema_extra={"choices": list(UBPR_SECTIONS)},
|
||||
)
|
||||
all_periods: bool = Field(
|
||||
default=False,
|
||||
|
||||
@@ -30,7 +30,7 @@ class FederalReserveListOfBanksPeerGroupQueryParams(QueryParams):
|
||||
peer_group: str = Field(
|
||||
default="1",
|
||||
description="The UBPR peer-group name (e.g. '1', 'NATIONAL', 'ALCOM').",
|
||||
json_schema_extra={"choices": _PEER_GROUP_NAMES},
|
||||
json_schema_extra={"choices": list(_PEER_GROUP_NAMES)},
|
||||
)
|
||||
date: str | None = Field(
|
||||
default=None,
|
||||
|
||||
@@ -57,12 +57,12 @@ class FederalReservePeerGroupAverageQueryParams(QueryParams):
|
||||
default="1",
|
||||
description="The UBPR peer-group name; the default groups the largest"
|
||||
" insured commercial banks (assets greater than $100 billion).",
|
||||
json_schema_extra={"choices": _PEER_GROUP_NAMES},
|
||||
json_schema_extra={"choices": list(_PEER_GROUP_NAMES)},
|
||||
)
|
||||
section: str = Field(
|
||||
default="Summary Ratios",
|
||||
description="The Peer Group Average Report section (page) to return.",
|
||||
json_schema_extra={"choices": PGA_SECTIONS},
|
||||
json_schema_extra={"choices": list(PGA_SECTIONS)},
|
||||
)
|
||||
all_periods: bool = Field(
|
||||
default=False,
|
||||
|
||||
@@ -270,7 +270,7 @@ class FederalReservePeerGroupBankQueryParams(QueryParams):
|
||||
section: str = Field(
|
||||
default="Summary Ratios",
|
||||
description="The UBPR report section (page) to return.",
|
||||
json_schema_extra={"choices": PEER_GROUP_BANK_SECTIONS},
|
||||
json_schema_extra={"choices": list(PEER_GROUP_BANK_SECTIONS)},
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -59,12 +59,12 @@ class FederalReservePeerGroupDistributionQueryParams(QueryParams):
|
||||
peer_group: str = Field(
|
||||
default="1",
|
||||
description="The UBPR peer-group name (e.g. '1', 'NATIONAL', 'ALCOM').",
|
||||
json_schema_extra={"choices": _PEER_GROUP_NAMES},
|
||||
json_schema_extra={"choices": list(_PEER_GROUP_NAMES)},
|
||||
)
|
||||
section: str = Field(
|
||||
default="Summary Ratios",
|
||||
description="The report page (section) to return.",
|
||||
json_schema_extra={"choices": PEER_GROUP_DISTRIBUTION_SECTIONS},
|
||||
json_schema_extra={"choices": list(PEER_GROUP_DISTRIBUTION_SECTIONS)},
|
||||
)
|
||||
period: str | None = Field(
|
||||
default=None,
|
||||
|
||||
@@ -86,7 +86,7 @@ class FederalReservePrimaryDealerPositioningQueryParams(
|
||||
category: PdsCategories = Field(
|
||||
default="treasuries",
|
||||
description="The category of asset to return, defaults to 'treasuries'.",
|
||||
json_schema_extra={"choices": PDS_CATEGORY_CHOICES},
|
||||
json_schema_extra={"choices": list(PDS_CATEGORY_CHOICES)},
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -61,17 +61,17 @@ class FederalReserveStateAverageQueryParams(QueryParams):
|
||||
state: str = Field(
|
||||
default="SD",
|
||||
description="The two-letter state (or territory) code to average.",
|
||||
json_schema_extra={"choices": STATE_CODES},
|
||||
json_schema_extra={"choices": list(STATE_CODES)},
|
||||
)
|
||||
group_type: str = Field(
|
||||
default="commercial",
|
||||
description="The institution peer group to average across the state.",
|
||||
json_schema_extra={"choices": GROUP_TYPES},
|
||||
json_schema_extra={"choices": list(GROUP_TYPES)},
|
||||
)
|
||||
section: str = Field(
|
||||
default="Summary Ratios",
|
||||
description="The UBPR State Average report section (page) to return.",
|
||||
json_schema_extra={"choices": STATE_AVERAGE_SECTIONS},
|
||||
json_schema_extra={"choices": list(STATE_AVERAGE_SECTIONS)},
|
||||
)
|
||||
all_periods: bool = Field(
|
||||
default=False,
|
||||
|
||||
@@ -64,7 +64,7 @@ class FederalReserveUBPRQueryParams(QueryParams):
|
||||
section: str = Field(
|
||||
default="Summary Ratios",
|
||||
description="The UBPR report section (page) to return.",
|
||||
json_schema_extra={"choices": UBPR_SECTIONS},
|
||||
json_schema_extra={"choices": list(UBPR_SECTIONS)},
|
||||
)
|
||||
all_periods: bool = Field(
|
||||
default=False,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
[project]
|
||||
name = "openbb-finra"
|
||||
version = "2.0.0"
|
||||
description = "FINRA provider extension for OpenBB Platform."
|
||||
version = "1.6.1"
|
||||
description = "FINRA extension for OpenBB"
|
||||
authors = [{ name = "OpenBB Team", email = "hello@openbb.co" }]
|
||||
license = { text = "AGPL-3.0-only" }
|
||||
license = "Apache-2.0"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.10,<4"
|
||||
dependencies = [
|
||||
|
||||
@@ -24,12 +24,7 @@ _FREQ_MAP = {"annual": "A", "quarter": "Q", "monthly": "M"}
|
||||
|
||||
|
||||
class OECDUnemploymentQueryParams(UnemploymentQueryParams):
|
||||
"""OECD Unemployment Query.
|
||||
|
||||
Notes
|
||||
-----
|
||||
Source: https://data-explorer.oecd.org/?lc=en
|
||||
"""
|
||||
"""OECD Unemployment Query."""
|
||||
|
||||
__json_schema_extra__ = {
|
||||
"country": {
|
||||
@@ -50,7 +45,7 @@ class OECDUnemploymentQueryParams(UnemploymentQueryParams):
|
||||
age: Literal[AgesLiteral] = Field(
|
||||
description="Age group to get unemployment for. Total indicates 15 years or over",
|
||||
default="total",
|
||||
json_schema_extra={"choices": AGES},
|
||||
json_schema_extra={"choices": list(AGES)},
|
||||
)
|
||||
seasonal_adjustment: bool = Field(
|
||||
description="Whether to get seasonally adjusted unemployment. Defaults to False.",
|
||||
|
||||
@@ -6,8 +6,9 @@ from datetime import date as dateType
|
||||
|
||||
from openbb_core.provider.abstract.data import Data
|
||||
from pydantic import Field
|
||||
from pydantic.config import JsonDict
|
||||
|
||||
PERCENT = {"x-unit_measurement": "percent"}
|
||||
PERCENT: JsonDict = {"x-unit_measurement": "percent"}
|
||||
|
||||
|
||||
class StrategyData(Data):
|
||||
|
||||
Reference in New Issue
Block a user