Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI listing quick fix #6002

Merged
merged 15 commits into from
Jan 26, 2024
  •  
  •  
  •  
1 change: 1 addition & 0 deletions custom_pre_commit/check_reserved_args.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Check reserved command arguments in Controllers"""

import glob
import os
import re
Expand Down
1 change: 1 addition & 0 deletions generate_sdk.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Generates the sdk files from the trailmaps."""

import os
import re
import subprocess # nosec: B404
Expand Down
9 changes: 6 additions & 3 deletions openbb_platform/core/openbb_core/api/rest_api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""REST API for the OpenBB Platform."""

import logging
from contextlib import asynccontextmanager

Expand Down Expand Up @@ -75,9 +76,11 @@ async def lifespan(_: FastAPI):
)
AppLoader.from_routers(
app=app,
routers=[AuthService().router, router_system, router_coverage, router_commands]
if Env().DEV_MODE
else [router_commands],
routers=(
[AuthService().router, router_system, router_coverage, router_commands]
if Env().DEV_MODE
else [router_commands]
),
prefix=system.api_settings.prefix,
)

Expand Down
1 change: 1 addition & 0 deletions openbb_platform/core/openbb_core/api/router/coverage.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Coverage API router."""

from fastapi import APIRouter, Depends
from openbb_core.api.dependency.coverage import get_command_map, get_provider_interface
from openbb_core.app.provider_interface import ProviderInterface
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Coverage API router helper functions."""

from inspect import _empty, signature
from typing import TYPE_CHECKING, Any, Callable, Dict, Optional, Tuple, Type

Expand Down
1 change: 1 addition & 0 deletions openbb_platform/core/openbb_core/api/router/system.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""System router."""

from fastapi import APIRouter, Depends
from openbb_core.api.dependency.system import get_system_settings
from openbb_core.app.model.system_settings import SystemSettings
Expand Down
1 change: 1 addition & 0 deletions openbb_platform/core/openbb_core/app/charting_service.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Charting service."""

from importlib import import_module
from inspect import getmembers, getsource, isfunction
from typing import Callable, List, Optional, Tuple, TypeVar
Expand Down
1 change: 1 addition & 0 deletions openbb_platform/core/openbb_core/app/command_runner.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Command runner module."""

import warnings
from contextlib import nullcontext
from copy import deepcopy
Expand Down
1 change: 1 addition & 0 deletions openbb_platform/core/openbb_core/app/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Constants for the OpenBB Platform."""

from pathlib import Path

HOME_DIRECTORY = Path.home()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Posthog Handler."""

import json
import logging
import re
Expand Down
8 changes: 5 additions & 3 deletions openbb_platform/core/openbb_core/app/logs/logging_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,11 @@ class CredentialsDefinition(Enum):
undefined = "undefined"

return {
c: CredentialsDefinition.defined.value
if credentials[c]
else CredentialsDefinition.undefined.value
c: (
CredentialsDefinition.defined.value
if credentials[c]
else CredentialsDefinition.undefined.value
)
for c in credentials
}

Expand Down
1 change: 1 addition & 0 deletions openbb_platform/core/openbb_core/app/model/credentials.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Credentials model and its utilities."""

import traceback
import warnings
from typing import Dict, Optional, Set, Tuple
Expand Down
1 change: 1 addition & 0 deletions openbb_platform/core/openbb_core/app/model/extension.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Extension class for OBBject extensions."""

import warnings
from typing import Callable, List, Optional

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""FastAPI configuration settings model."""

from typing import Dict, List, Optional

from pydantic import BaseModel, ConfigDict, Field, computed_field
Expand Down
16 changes: 10 additions & 6 deletions openbb_platform/core/openbb_core/app/model/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,11 @@ def scale_arguments(cls, v):
type(arg_val[0]), pd.DataFrame
):
columns = [
list(df.index.names) + df.columns.tolist()
if any(index is not None for index in list(df.index.names))
else df.columns.tolist()
(
list(df.index.names) + df.columns.tolist()
if any(index is not None for index in list(df.index.names))
else df.columns.tolist()
)
for df in arg_val
]
new_arg_val = {
Expand All @@ -91,9 +93,11 @@ def scale_arguments(cls, v):
# List[Series]
elif isinstance(arg_val, list) and isinstance(arg_val[0], pd.Series):
columns = [
list(series.index.names) + [series.name]
if any(index is not None for index in list(series.index.names))
else series.name
(
list(series.index.names) + [series.name]
if any(index is not None for index in list(series.index.names))
else series.name
)
for series in arg_val
]
new_arg_val = {
Expand Down
1 change: 1 addition & 0 deletions openbb_platform/core/openbb_core/app/model/obbject.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""The OBBject."""

from re import sub
from typing import (
TYPE_CHECKING,
Expand Down
6 changes: 3 additions & 3 deletions openbb_platform/core/openbb_core/app/model/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ class Preferences(BaseModel):
table_style: Literal["dark", "light"] = "dark"
request_timeout: PositiveInt = 15
metadata: bool = True
output_type: Literal[
"OBBject", "dataframe", "polars", "numpy", "dict", "chart"
] = Field(default="OBBject", description="Python default output type.")
output_type: Literal["OBBject", "dataframe", "polars", "numpy", "dict", "chart"] = (
Field(default="OBBject", description="Python default output type.")
)

model_config = ConfigDict(validate_assignment=True)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""The OpenBB Platform System Settings."""

import json
import platform as pl # I do this so that the import doesn't conflict with the variable name
from pathlib import Path
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""User settings model."""

from pydantic import Field

from openbb_core.app.model.abstract.tagged import Tagged
Expand Down
15 changes: 9 additions & 6 deletions openbb_platform/core/openbb_core/app/provider_interface.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Provider Interface."""

from dataclasses import dataclass, make_dataclass
from difflib import SequenceMatcher
from typing import Any, Callable, Dict, List, Literal, Optional, Tuple, Type, Union
Expand Down Expand Up @@ -252,12 +253,14 @@ def _create_field(
default=default or None,
title=provider_name,
description=description,
validation_alias=AliasChoices(
field.alias,
*list(set(alias_dict.get(name, []))),
)
if alias_dict.get(name, [])
else None,
validation_alias=(
AliasChoices(
field.alias,
*list(set(alias_dict.get(name, []))),
)
if alias_dict.get(name, [])
else None
),
json_schema_extra=field.json_schema_extra,
)

Expand Down
7 changes: 4 additions & 3 deletions openbb_platform/core/openbb_core/app/router.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""OpenBB Router."""

import traceback
import warnings
from functools import lru_cache, partial
Expand Down Expand Up @@ -275,9 +276,9 @@ def command(
if deprecation_message:
kwargs["summary"] = deprecation_message
else:
kwargs[
"summary"
] = "This functionality will be deprecated in the future releases."
kwargs["summary"] = (
"This functionality will be deprecated in the future releases."
)

api_router.add_api_route(**kwargs)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Auth service."""

import logging
from importlib import import_module
from types import ModuleType
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Hub manager class."""

from typing import Optional

from fastapi import HTTPException
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""User service."""

import json
from functools import reduce
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions openbb_platform/core/openbb_core/app/static/account.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Account."""

# pylint: disable=W0212:protected-access
import json
from functools import wraps
Expand Down
1 change: 1 addition & 0 deletions openbb_platform/core/openbb_core/app/static/app_factory.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""App factory."""

from typing import Optional, Type, TypeVar

from openbb_core.app.command_runner import CommandRunner
Expand Down
1 change: 1 addition & 0 deletions openbb_platform/core/openbb_core/app/static/container.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Container class."""

from typing import Any

from openbb_core.app.command_runner import CommandRunner
Expand Down
1 change: 1 addition & 0 deletions openbb_platform/core/openbb_core/app/static/coverage.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Coverage module."""

from typing import TYPE_CHECKING, Any, Dict, List, Optional

from openbb_core.api.router.helpers.coverage_helpers import get_route_schema_map
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Package Builder Class."""

# pylint: disable=too-many-lines
import builtins
import inspect
Expand Down Expand Up @@ -383,9 +384,11 @@ def build(path: str, ext_map: Optional[Dict[str, List[str]]] = None) -> str:
methods += MethodDefinition.build_command_method(
path=route.path,
func=route.endpoint,
model_name=route.openapi_extra.get("model", None)
if route.openapi_extra
else None,
model_name=(
route.openapi_extra.get("model", None)
if route.openapi_extra
else None
),
) # type: ignore
else:
doc += " /" if path else " /"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Console module."""

from openbb_core.env import Env


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Decorators for the OpenBB Platform static assets."""

from functools import wraps
from typing import Any, Callable, Optional, TypeVar, overload

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""OpenBB filters."""


from openbb_core.app.utils import convert_to_basemodel


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Linters for the package."""

import shutil
import subprocess
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions openbb_platform/core/openbb_core/app/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Version script for the OpenBB Platform."""

import shutil
import subprocess
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions openbb_platform/core/openbb_core/provider/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
"""OpenBB Provider Package."""

from . import query_executor, registry, registry_map, standard_models # noqa: F401
from .utils import descriptions, helpers # noqa: F401
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Abstract class for the fetcher."""

# ruff: noqa: S101
# pylint: disable=E1101

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""The OpenBB Standardized QueryParams Model that holds the query input parameters."""

from typing import Dict

from pydantic import BaseModel, ConfigDict
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Query executor module."""

from typing import Any, Dict, Optional, Type

from pydantic import SecretStr
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""AMERIBOR Standard Model."""


from datetime import date as dateType
from typing import Optional

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Analyst Estimates Standard Model."""


from datetime import date as dateType
from typing import List, Literal, Set, Union

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Available Indices Standard Model."""


from typing import Optional

from pydantic import Field
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Balance Sheet Statement Growth Standard Model."""


from datetime import date as dateType
from typing import List, Optional, Set, Union

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Dividend Calendar Standard Model."""


from datetime import date as dateType
from typing import Optional

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Earnings Calendar Standard Model."""


from datetime import date as dateType
from typing import Optional

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Calendar Splits Standard Model."""


from datetime import date as dateType
from typing import Optional

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Cash Flow Statement Growth Standard Model."""


from datetime import date as dateType
from typing import List, Optional, Set, Union

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Company News Standard Model."""


from datetime import datetime
from typing import Optional

Expand Down
Loading
Loading