[Enhancement] Convert Params Models To Dictionary Before Assigning As Private Attribute In OBBject. (#6492)

* convert params models to dict

* update cli test

* fix test_static_command_runner_chart

* mock_obbject results

* minor linting adjustments

* review changes

* charting test mock obbject

---------

Co-authored-by: Henrique Joaquim <henriquecjoaquim@gmail.com>
This commit is contained in:
Danglewood
2024-06-13 01:12:55 -07:00
committed by GitHub
parent 99d2256e0f
commit 8b9f461dca
7 changed files with 73 additions and 55 deletions

View File

@@ -51,10 +51,12 @@ class Registry:
def _handle_standard_params(obbject: OBBject) -> str:
"""Handle standard params for obbjects"""
standard_params_json = ""
std_params = obbject._standard_params # pylint: disable=protected-access
if hasattr(std_params, "__dict__"):
std_params = getattr(
obbject, "_standard_params", {}
) # pylint: disable=protected-access
if std_params:
standard_params = {
k: str(v)[:30] for k, v in std_params.__dict__.items() if v
k: str(v)[:30] for k, v in std_params.items() if v and k != "data"
}
standard_params_json = json.dumps(standard_params)