Skip to content

Commit

Permalink
cast
Browse files Browse the repository at this point in the history
  • Loading branch information
jonmmease committed Nov 15, 2024
1 parent 8c6e000 commit a6853a9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions altair/utils/_vegafusion_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import uuid
from importlib.metadata import version as importlib_version
from typing import TYPE_CHECKING, Any, Callable, Final, TypedDict, Union, overload
from typing import TYPE_CHECKING, Any, Callable, Final, TypedDict, Union, cast, overload
from weakref import WeakValueDictionary

import narwhals.stable.v1 as nw
Expand All @@ -29,7 +29,7 @@
# from charts by the vegafusion data transformer. Use a WeakValueDictionary
# rather than a dict so that the Python interpreter is free to garbage
# collect the stored DataFrames.
extracted_inline_tables: MutableMapping[str, Any] = WeakValueDictionary()
extracted_inline_tables: MutableMapping[str, DataFrameLike] = WeakValueDictionary()

# Special URL prefix that VegaFusion uses to denote that a
# dataset in a Vega spec corresponds to an entry in the `inline_datasets`
Expand Down Expand Up @@ -85,7 +85,7 @@ def vegafusion_data_transformer(

if supported_by_vf and not isinstance(data, SupportsGeoInterface):
table_name = f"table_{uuid.uuid4()}".replace("-", "_")
extracted_inline_tables[table_name] = data
extracted_inline_tables[table_name] = cast(DataFrameLike, data)
return {"url": VEGAFUSION_PREFIX + table_name}
else:
# Use default transformer for geo interface objects
Expand Down

0 comments on commit a6853a9

Please sign in to comment.