Skip to content

Commit

Permalink
[ENH] Add Support for pd.Index and pd.Series to array type
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiaLingWeng committed Oct 24, 2023
1 parent 721b2b2 commit 9065623
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion altair/utils/schemapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]}
Expand Down
4 changes: 3 additions & 1 deletion tools/schemapi/schemapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]}
Expand Down

0 comments on commit 9065623

Please sign in to comment.