rename preference: obbject_method -> output_type

This commit is contained in:
Diogo Sousa
2023-09-27 19:15:10 +01:00
parent d28f9e07ce
commit c8a3968bd2
2 changed files with 4 additions and 4 deletions

View File

@@ -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.")

View File

@@ -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