mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-12-01 13:44:16 +00:00
Add toml to dev deps, fix to_df() edge case
This commit is contained in:
@@ -1,14 +1,6 @@
|
||||
"""The OBBject."""
|
||||
from re import sub
|
||||
from typing import (
|
||||
Any,
|
||||
Dict,
|
||||
Generic,
|
||||
List,
|
||||
Literal,
|
||||
Optional,
|
||||
TypeVar,
|
||||
)
|
||||
from typing import Any, Dict, Generic, List, Literal, Optional, TypeVar
|
||||
|
||||
import pandas as pd
|
||||
from numpy import ndarray
|
||||
@@ -147,7 +139,11 @@ class OBBject(Tagged, Generic[T]):
|
||||
sort_columns = False
|
||||
# List[List | str | int | float] | Dict[str, Dict | List | BaseModel]
|
||||
else:
|
||||
df = pd.DataFrame(res)
|
||||
try:
|
||||
df = pd.DataFrame(res)
|
||||
except ValueError:
|
||||
if isinstance(res, dict):
|
||||
df = pd.DataFrame([res])
|
||||
|
||||
if df is None:
|
||||
raise OpenBBError("Unsupported data format.")
|
||||
|
||||
1
openbb_platform/pyproject.toml
vendored
1
openbb_platform/pyproject.toml
vendored
@@ -62,6 +62,7 @@ all = [
|
||||
pytest = "^7.0.0"
|
||||
pytest-subtests = "^0.11.0"
|
||||
pytest-recorder = "^0.2.3"
|
||||
toml = "^0.10.2"
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry-core"]
|
||||
|
||||
Reference in New Issue
Block a user