mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-12-01 13:44:16 +00:00
rename preference: obbject_method -> output_type
This commit is contained in:
@@ -19,7 +19,7 @@ class Preferences(BaseModel):
|
||||
table_style: Literal["dark", "light"] = "dark"
|
||||
request_timeout: PositiveInt = 15
|
||||
metadata: bool = True
|
||||
obbject_method: Optional[
|
||||
output_type: Optional[
|
||||
Literal["to_dataframe", "to_df", "to_polars", "to_numpy", "to_dict", "to_chart"]
|
||||
] = Field(default=None, description="Method to apply to OBBject by default.")
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ class Container:
|
||||
def run(self, *args, **kwargs) -> Union[OBBject, pd.DataFrame, dict]:
|
||||
"""Run a command in the container."""
|
||||
obbject = self._command_runner.run(*args, **kwargs)
|
||||
obbject_method = self._command_runner.user_settings.preferences.obbject_method
|
||||
if obbject_method:
|
||||
return getattr(obbject, obbject_method)()
|
||||
output_type = self._command_runner.user_settings.preferences.output_type
|
||||
if output_type:
|
||||
return getattr(obbject, output_type)()
|
||||
return obbject
|
||||
|
||||
Reference in New Issue
Block a user