diff --git a/altair/utils/schemapi.py b/altair/utils/schemapi.py index f38424681..ef1e39586 100644 --- a/altair/utils/schemapi.py +++ b/altair/utils/schemapi.py @@ -958,7 +958,9 @@ def to_dict( } ) kwds = { - k: v for k, v in kwds.items() if k not in list(ignore) + ["shorthand"] + k: v.to_list() if isinstance(v, pd.Series) else v + for k, v in kwds.items() + if k not in list(ignore) + ["shorthand"] } if "mark" in kwds and isinstance(kwds["mark"], str): kwds["mark"] = {"type": kwds["mark"]} diff --git a/tools/schemapi/schemapi.py b/tools/schemapi/schemapi.py index af98fbe8c..2f86f3dad 100644 --- a/tools/schemapi/schemapi.py +++ b/tools/schemapi/schemapi.py @@ -956,7 +956,9 @@ def to_dict( } ) kwds = { - k: v for k, v in kwds.items() if k not in list(ignore) + ["shorthand"] + k: v.to_list() if isinstance(v, pd.Series) else v + for k, v in kwds.items() + if k not in list(ignore) + ["shorthand"] } if "mark" in kwds and isinstance(kwds["mark"], str): kwds["mark"] = {"type": kwds["mark"]}