Skip to content

Commit

Permalink
Merge branch 'develop' into feature/conda-distribution
Browse files Browse the repository at this point in the history
  • Loading branch information
deeleeramone authored Aug 19, 2024
2 parents acbf1c9 + 8f7555b commit 791e4ec
Show file tree
Hide file tree
Showing 56 changed files with 30,734 additions and 19,007 deletions.
154 changes: 77 additions & 77 deletions cli/poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion openbb_platform/core/openbb_core/api/router/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def exclude_fields_from_api(key: str, value: Any):

# if it's a model with nested fields
elif is_model(type_):
for field_name, field in type_.__fields__.items():
for field_name, field in type_.model_fields.items():
extra = getattr(field, "json_schema_extra", None)
if (
extra
Expand Down
18 changes: 10 additions & 8 deletions openbb_platform/core/openbb_core/provider/abstract/fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ def test(
if is_list:
assert all(
field in data[0]
for field in cls.data_type.__fields__
for field in cls.data_type.model_fields
if field in data[0]
), f"Data must have the correct fields. Expected: {cls.data_type.__fields__} Got: {data[0].__dict__}"
), f"Data must have the correct fields. Expected: {cls.data_type.model_fields} Got: {data[0].__dict__}"
# This makes sure that the data is not transformed yet so that the
# pipeline is implemented correctly. We can remove this assertion if we
# want to be less strict.
Expand All @@ -178,8 +178,8 @@ def test(
), f"Data must not be transformed yet. Expected: {cls.data_type} Got: {type(data[0])}"
else:
assert all(
field in data for field in cls.data_type.__fields__ if field in data
), f"Data must have the correct fields. Expected: {cls.data_type.__fields__} Got: {data.__dict__}"
field in data for field in cls.data_type.model_fields if field in data
), f"Data must have the correct fields. Expected: {cls.data_type.model_fields} Got: {data.__dict__}"
assert (
issubclass(type(data), cls.data_type) is False
), f"Data must not be transformed yet. Expected: {cls.data_type} Got: {type(data)}"
Expand All @@ -200,10 +200,12 @@ def test(
and return_type_args.__origin__ is dict
)
if return_type_is_dict:
return_type_fields = return_type_args.__args__[1].__args__[0].__fields__
return_type_fields = (
return_type_args.__args__[1].__args__[0].model_fields
)
return_type = return_type_args.__args__[1].__args__[0]
else:
return_type_fields = return_type_args.__fields__
return_type_fields = return_type_args.model_fields
return_type = return_type_args

assert len(transformed_data) > 0, "Transformed data must not be empty." # type: ignore
Expand All @@ -220,8 +222,8 @@ def test(
else:
assert all(
field in transformed_data.__dict__
for field in cls.return_type.__fields__
), f"Transformed data must have the correct fields. Expected: {cls.return_type.__fields__} Got: {transformed_data.__dict__}"
for field in cls.return_type.model_fields
), f"Transformed data must have the correct fields. Expected: {cls.return_type.model_fields} Got: {transformed_data.__dict__}"
assert issubclass(
type(transformed_data), cls.data_type
), f"Transformed data must be of the correct type. Expected: {cls.data_type} Got: {type(transformed_data)}"
Expand Down
772 changes: 325 additions & 447 deletions openbb_platform/core/poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion openbb_platform/core/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pydantic = "^2.5.1"
requests = "^2.32.1"
importlib-metadata = "^6.8.0"
python-dotenv = "^1.0.0"
aiohttp = "^3.9.5"
aiohttp = "^3.10.2"
ruff = ">=0.1.6" # Needed here to lint generated code
pyjwt = "^2.8.0"

Expand Down
770 changes: 324 additions & 446 deletions openbb_platform/extensions/commodity/poetry.lock

Large diffs are not rendered by default.

770 changes: 324 additions & 446 deletions openbb_platform/extensions/crypto/poetry.lock

Large diffs are not rendered by default.

770 changes: 324 additions & 446 deletions openbb_platform/extensions/currency/poetry.lock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ def derivatives_futures_curve( # noqa: PLR0912

provider = kwargs.get("provider", "")

df["expiration"] = to_datetime(df["expiration"], errors="ignore").dt.strftime(
"%b-%Y"
)
df["expiration"] = df["expiration"].apply(to_datetime).dt.strftime("%b-%Y")

if (
provider == "cboe"
Expand Down
770 changes: 324 additions & 446 deletions openbb_platform/extensions/derivatives/poetry.lock

Large diffs are not rendered by default.

1,192 changes: 636 additions & 556 deletions openbb_platform/extensions/devtools/poetry.lock

Large diffs are not rendered by default.

625 changes: 324 additions & 301 deletions openbb_platform/extensions/econometrics/poetry.lock

Large diffs are not rendered by default.

770 changes: 324 additions & 446 deletions openbb_platform/extensions/economy/poetry.lock

Large diffs are not rendered by default.

770 changes: 324 additions & 446 deletions openbb_platform/extensions/equity/poetry.lock

Large diffs are not rendered by default.

770 changes: 324 additions & 446 deletions openbb_platform/extensions/etf/poetry.lock

Large diffs are not rendered by default.

770 changes: 324 additions & 446 deletions openbb_platform/extensions/fixedincome/poetry.lock

Large diffs are not rendered by default.

770 changes: 324 additions & 446 deletions openbb_platform/extensions/index/poetry.lock

Large diffs are not rendered by default.

770 changes: 324 additions & 446 deletions openbb_platform/extensions/news/poetry.lock

Large diffs are not rendered by default.

678 changes: 278 additions & 400 deletions openbb_platform/extensions/quantitative/poetry.lock

Large diffs are not rendered by default.

770 changes: 324 additions & 446 deletions openbb_platform/extensions/regulators/poetry.lock

Large diffs are not rendered by default.

678 changes: 278 additions & 400 deletions openbb_platform/extensions/technical/poetry.lock

Large diffs are not rendered by default.

733 changes: 382 additions & 351 deletions openbb_platform/obbject_extensions/charting/poetry.lock

Large diffs are not rendered by default.

18 changes: 15 additions & 3 deletions openbb_platform/openbb/assets/reference.json
Original file line number Diff line number Diff line change
Expand Up @@ -35717,15 +35717,24 @@
"description": "The source of the news article.",
"default": null,
"optional": true,
"choices": null
"choices": [
"yahoo",
"moody",
"moody_us_news",
"moody_us_press_releases"
]
},
{
"name": "sentiment",
"type": "Literal['positive', 'neutral', 'negative']",
"description": "Return news only from this source.",
"default": null,
"optional": true,
"choices": null
"choices": [
"positive",
"neutral",
"negative"
]
},
{
"name": "language",
Expand Down Expand Up @@ -35791,7 +35800,10 @@
"description": "Sort order of the articles.",
"default": "desc",
"optional": true,
"choices": null
"choices": [
"asc",
"desc"
]
}
],
"tiingo": [
Expand Down
27 changes: 25 additions & 2 deletions openbb_platform/openbb/package/news.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def company(
Number of seconds since the news was published. (provider: benzinga)
sort : Literal['id', 'created', 'updated']
Key to sort the news by. (provider: benzinga)
order : Optional[Literal['asc', 'desc']]
order : Literal['asc', 'desc']
Order to sort the news by. (provider: benzinga);
Sort order of the articles. (provider: polygon)
isin : Optional[str]
Expand Down Expand Up @@ -240,7 +240,30 @@ def company(
"polygon": {"multiple_items_allowed": True, "choices": None},
"tiingo": {"multiple_items_allowed": True, "choices": None},
"yfinance": {"multiple_items_allowed": True, "choices": None},
}
},
"order": {
"polygon": {
"multiple_items_allowed": False,
"choices": ["asc", "desc"],
}
},
"source": {
"intrinio": {
"multiple_items_allowed": False,
"choices": [
"yahoo",
"moody",
"moody_us_news",
"moody_us_press_releases",
],
}
},
"sentiment": {
"intrinio": {
"multiple_items_allowed": False,
"choices": ["positive", "neutral", "negative"],
}
},
},
)
)
Expand Down
Loading

0 comments on commit 791e4ec

Please sign in to comment.