diff options
author | Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> | 2024-05-27 15:23:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-27 15:23:35 +0200 |
commit | 8d2c4ee8d1895fcd7abde52d0156c93f41bdc5ab (patch) | |
tree | b6a648f95e8cf3296a1e8613f9e89504f1cd06a4 | |
parent | 58e8ada6f4fd28f53a62ba461f790e6012cdc8be (diff) | |
parent | bfad015fcb19f3f2d96d9296cfe33589ef17c0a0 (diff) |
Merge branch 'develop' into feature/stream-fetcher
57 files changed, 6813 insertions, 1744 deletions
diff --git a/.codespell.ignore b/.codespell.ignore index c0b8680423f..5c79719a67d 100644 --- a/.codespell.ignore +++ b/.codespell.ignore @@ -44,3 +44,4 @@ wew yeld zar zlot +bootup
\ No newline at end of file diff --git a/.codespell.skip b/.codespell.skip index c7beee59c67..f83dcca0908 100644 --- a/.codespell.skip +++ b/.codespell.skip @@ -14,3 +14,5 @@ ./build/pyinstaller ./website/config.toml ./**/node_modules +./frontend-components/** +./website/content/terminal/reference/crypto/onchain/**
\ No newline at end of file diff --git a/.github/workflows/general-linting.yml b/.github/workflows/general-linting.yml index 792886414d6..d6d51d4e1f4 100644 --- a/.github/workflows/general-linting.yml +++ b/.github/workflows/general-linting.yml @@ -45,8 +45,8 @@ jobs: if: github.event_name == 'pull_request' run: | # "Checking PR diff" - echo "platform_files=$(git diff --diff-filter=d --name-only origin/${{ github.base_ref }}...${{ github.head_ref }} | grep 'openbb_platform/.*\.py$' | grep -v 'openbb_platform/openbb/package' | grep -v 'integration' | grep -v 'tests' | xargs)" >> $GITHUB_ENV - echo $platform_files + echo "diff_files=$(git diff --diff-filter=d --name-only origin/${{ github.base_ref }}...${{ github.head_ref }} | grep 'openbb_platform/.*\.py$|cli/.*\.py$' | grep -v 'openbb_platform/openbb/package' | grep -v 'integration' | grep -v 'tests' | xargs)" >> $GITHUB_ENV + echo $diff_files - uses: actions/cache@v3 with: @@ -58,16 +58,17 @@ jobs: pip install openbb-devtools pip install types-pytz types-requests types-termcolor types-tabulate types-PyYAML types-python-dateutil types-setuptools types-six - run: bandit -x ./tests -r . || true - - run: black --diff --check . - run: codespell --ignore-words=.codespell.ignore --skip="$(tr '\n' ',' < .codespell.skip | sed 's/,$//')" --quiet-level=2 - - run: ruff . - run: | - # Run linters for openbb_platform - if [ -n "${{ env.platform_files }}" ]; then - pylint ${{ env.platform_files }} - pydocstyle ${{ env.platform_files }} + # Run linters for openbb_platform | cli + if [ -n "${{ env.diff_files }}" ]; then + black --diff --check ${{ env.diff_files }} + mypy ${{ env.diff_files }} --ignore-missing-imports --scripts-are-modules --check-untyped-defs + pydocstyle ${{ env.diff_files }} + pylint ${{ env.diff_files }} + ruff check ${{ env.diff_files }} else - echo "No Python files changed in openbb_platform" + echo "No Python files changed in openbb_platform | cli" fi markdown-link-check: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index af8134cbce1..0b0a2174e4d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: hooks: - id: black - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: "v0.4.4" + rev: "v0.4.5" hooks: - id: ruff - repo: https://github.com/pycqa/pydocstyle diff --git a/openbb_platform/core/openbb_core/app/logs/handlers/path_tracking_file_handler.py b/openbb_platform/core/openbb_core/app/logs/handlers/path_tracking_file_handler.py index acf8a50d5cc..6b7ab2a55ba 100644 --- a/openbb_platform/core/openbb_core/app/logs/handlers/path_tracking_file_handler.py +++ b/openbb_platform/core/openbb_core/app/logs/handlers/path_tracking_file_handler.py @@ -5,7 +5,7 @@ from copy import deepcopy from logging.handlers import TimedRotatingFileHandler from pathlib import Path -# IMPORTATION THIRDPARTY +# IMPORTATION THIRD PARTY # IMPORTATION INTERNAL from openbb_core.app.logs.models.logging_settings import LoggingSettings from openbb_core.app.logs.utils.expired_files import ( diff --git a/openbb_platform/core/openbb_core/app/model/api_settings.py b/openbb_platform/core/openbb_core/app/model/api_settings.py index f75b690ae6f..59ac1569902 100644 --- a/openbb_platform/core/openbb_core/app/model/api_settings.py +++ b/openbb_platform/core/openbb_core/app/model/api_settings.py @@ -20,7 +20,7 @@ class Servers(BaseModel): model_config = ConfigDict(frozen=True) - url: str = "http://localhost:8000" + url: str = "" description: str = "Local OpenBB development server" @@ -36,7 +36,7 @@ class APISettings(BaseModel): contact_name: str = "OpenBB Team" contact_url: str = "https://openbb.co" contact_email: str = "hello@openbb.co" - license_name: str = "MIT" + license_name: str = "AGPLv3" license_url: str = ( "https://github.com/OpenBB-finance/OpenBBTerminal/blob/develop/LICENSE" ) diff --git a/openbb_platform/core/openbb_core/app/static/package_builder.py b/openbb_platform/core/openbb_core/app/static/package_builder.py index 82c6c234d8b..00fea7f5867 100644 --- a/openbb_platform/core/openbb_core/app/static/package_builder.py +++ b/openbb_platform/core/openbb_core/app/static/package_builder.py @@ -1684,6 +1684,8 @@ class ReferenceGenerator: reference: Dict[str, Dict] = {} for path, route in route_map.items(): + # Initialize the provider parameter fields as an empty dictionary + provider_parameter_fields = {"type": ""} # Initialize the reference fields as empty dictionaries reference[path] = {field: {} for field in cls.REFERENCE_FIELDS} # Route method is used to distinguish between GET and POST methods diff --git a/openbb_platform/core/openbb_core/provider/standard_models/balance_sheet_growth.py b/openbb_platform/core/openbb_core/provider/standard_models/balance_sheet_growth.py index e2aff45cb5d..429a623407c 100644 --- a/openbb_platform/core/openbb_core/provider/standard_models/balance_sheet_growth.py +++ b/openbb_platform/core/openbb_core/provider/standard_models/balance_sheet_growth.py @@ -1,23 +1,26 @@ """Balance Sheet Statement Growth Standard Model.""" from datetime import date as dateType -from typing import List, Optional, Set, Union +from typing import Optional from pydantic import Field, field_validator from openbb_core.provider.abstract.data import Data from openbb_core.provider.abstract.query_params import QueryParams -from openbb_core.provider.utils.descriptions import ( - DATA_DESCRIPTIONS, - QUERY_DESCRIPTIONS, -) +from openbb_core.provider.utils.descriptions import QUERY_DESCRIPTIONS class BalanceSheetGrowthQueryParams(QueryParams): """Balance Sheet Statement Growth Query.""" symbol: str = Field(description=QUERY_DESCRIPTIONS.get("symbol", "")) - limit: int = Field(default=10, description=QUERY_DESCRIPTIONS.get("limit", "")) + period: str = Field( + default="annual", + description=QUERY_DESCRIPTIONS.get("period", ""), + ) + limit: Optional[int] = Field( + default=10, description=QUERY_DESCRIPTIONS.get("limit", "") + ) @field_validator("symbol", mode="before", check_fields=False) @classmethod @@ -25,113 +28,20 @@ class BalanceSheetGrowthQueryParams(QueryParams): """Convert field to uppercase.""" return v.upper() + @field_validator("period", mode="before", check_fields=False) + @classmethod + def to_lower(cls, v: Optional[str]) -> Optional[str]: + """Convert field to lowercase.""" + return v.lower() if v else v + class BalanceSheetGrowthData(Data): """Balance Sheet Statement Growth Data.""" - symbol: Optional[str] = Field( - default=None, description=DATA_DESCRIPTIONS.get("symbol", "") - ) - date: dateType = Field(description=DATA_DESCRIPTIONS.get("date", "")) - period: str = Field(description="Reporting period.") - growth_cash_and_cash_equivalents: float = Field( - description="Growth rate of cash and cash equivalents." - ) - growth_short_term_investments: float = Field( - description="Growth rate of short-term investments." - ) - growth_cash_and_short_term_investments: float = Field( - description="Growth rate of cash and short-term investments." - ) - growth_net_receivables: float = Field(description="Growth rate of net receivables.") - growth_inventory: float = Field(description="Growth rate of inventory.") - growth_other_current_assets: float = Field( - description="Growth rate of other current assets." - ) - growth_total_current_assets: float = Field( - description="Growth rate of total current assets." - ) - growth_property_plant_equipment_net: float = Field( - description="Growth rate of net property, plant, and equipment." - ) - growth_goodwill: float = Field(description="Growth rate of goodwill.") - growth_intangible_assets: float = Field( - description="Growth rate of intangible assets." - ) - growth_goodwill_and_intangible_assets: float = Field( - description="Growth rate of goodwill and intangible assets." - ) - growth_long_term_investments: float = Field( - description="Growth rate of long-term investments." - ) - growth_tax_assets: float = Field(description="Growth rate of tax assets.") - growth_other_non_current_assets: float = Field( - description="Growth rate of other non-current assets." - ) - growth_total_non_current_assets: float = Field( - description="Growth rate of total non-current assets." - ) - growth_other_assets: float = Field(description="Growth rate of other assets.") - growth_total_assets: float = Field(description="Growth rate of total assets.") - growth_account_payables: float = Field( - description="Growth rate of accounts payable." - ) - growth_short_term_debt: float = Field(description="Growth rate of short-term debt.") - growth_tax_payables: float = Field(description="Growth rate of tax payables.") - growth_deferred_revenue: float = Field( - description="Growth rate of deferred revenue." + period_ending: dateType = Field(description="The end date of the reporting period.") + fiscal_period: Optional[str] = Field( + description="The fiscal period of the report.", default=None ) - growth_other_current_liabilities: float = Field( - description="Growth rate of other current liabilities." + fiscal_year: Optional[int] = Field( + description="The fiscal year of the fiscal period.", default=None ) - growth_total_ |