[Bugfix] Remove svg export (#6476)

* lint

* fix version

* add url functionality to the charting extension

* small adjustments and removing unused function

* remove svg

* remove unused function

* better messages

* version can't be asserted bc will change
This commit is contained in:
Henrique Joaquim
2024-06-03 14:28:57 +01:00
committed by GitHub
parent 0b3e286035
commit 8a63c2df3e
11 changed files with 39 additions and 113 deletions

View File

@@ -743,13 +743,15 @@ class BaseController(metaclass=ABCMeta):
if export_allowed == "raw_data_only":
choices_export = ["csv", "json", "xlsx"]
help_export = "Export raw data into csv, json, xlsx"
help_export = "Export raw data into csv, json or xlsx."
elif export_allowed == "figures_only":
choices_export = ["png", "jpg", "svg"]
help_export = "Export figure into png, jpg, svg "
choices_export = ["png", "jpg"]
help_export = "Export figure into png or jpg."
else:
choices_export = ["csv", "json", "xlsx", "png", "jpg", "svg"]
help_export = "Export raw data into csv, json, xlsx and figure into png, jpg, svg "
choices_export = ["csv", "json", "xlsx", "png", "jpg"]
help_export = (
"Export raw data into csv, json, xlsx and figure into png or jpg."
)
parser.add_argument(
"--export",
@@ -823,7 +825,7 @@ class BaseController(metaclass=ABCMeta):
"raw_data_and_figures",
]:
ns_parser.is_image = any(
ext in ns_parser.export for ext in ["png", "svg", "jpg"]
ext in ns_parser.export for ext in ["png", "jpg"]
)
except SystemExit:

View File

@@ -154,7 +154,7 @@ class PlatformController(BaseController):
obbject = translator.execute_func(parsed_args=ns_parser)
df: pd.DataFrame = pd.DataFrame()
fig: OpenBBFigure = None
fig: Optional[OpenBBFigure] = None
title = f"{self.PATH}{translator.func.__name__}"
if obbject:

View File

@@ -56,14 +56,14 @@ def __mock_parse_known_args_and_warn(
if export_allowed == "raw_data_only":
choices_export = ["csv", "json", "xlsx"]
help_export = "Export raw data into csv, json, xlsx"
help_export = "Export raw data into csv, json or xlsx."
elif export_allowed == "figures_only":
choices_export = ["png", "jpg", "svg"]
help_export = "Export figure into png, jpg, svg "
choices_export = ["png", "jpg"]
help_export = "Export figure into png or jpg."
else:
choices_export = ["csv", "json", "xlsx", "png", "jpg", "svg"]
choices_export = ["csv", "json", "xlsx", "png", "jpg"]
help_export = (
"Export raw data into csv, json, xlsx and figure into png, jpg, svg "
"Export raw data into csv, json, xlsx and figure into png or jpg."
)
parser.add_argument(

View File

@@ -901,7 +901,7 @@ def export_data(
else:
save_to_excel(df, saved_path, sheet_name)
elif saved_path.suffix in [".jpg", ".png", ".svg"]:
elif saved_path.suffix in [".jpg", ".png"]:
if figure is None:
Session().console.print("No plot to export.")
continue

View File

@@ -1,17 +1,20 @@
"""Settings model"""
"""Settings model."""
from typing import Any
from dotenv import dotenv_values, set_key
from openbb_cli.config.constants import ENV_FILE_SETTINGS
from openbb_core.app.version import get_package_version
from pydantic import BaseModel, ConfigDict, model_validator
VERSION = get_package_version("openbb-cli")
class Settings(BaseModel):
"""Settings model."""
# Platform CLI version
VERSION: str = "1.0.0"
VERSION: str = VERSION
# DEVELOPMENT FLAGS
TEST_MODE: bool = False