Skip to content

Commit

Permalink
Merge branch 'main' into vega-datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
dangotbanned authored Oct 13, 2024
2 parents c76cfd4 + 796649e commit d3f0497
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
3 changes: 2 additions & 1 deletion altair/utils/_importers.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
def import_vegafusion() -> ModuleType:
min_version = "1.5.0"
try:
import vegafusion as vf

version = importlib_version("vegafusion")
embed_version = importlib_version("vegafusion-python-embed")
if version != embed_version or Version(version) < Version(min_version):
Expand All @@ -23,7 +25,6 @@ def import_vegafusion() -> ModuleType:
f" - vegafusion-python-embed=={embed_version}\n"
)
raise RuntimeError(msg)
import vegafusion as vf # type: ignore

return vf
except ImportError as err:
Expand Down
2 changes: 1 addition & 1 deletion altair/utils/_vegafusion_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
if TYPE_CHECKING:
from narwhals.typing import IntoDataFrame

from vegafusion.runtime import ChartState # type: ignore
from vegafusion.runtime import ChartState

# Temporary storage for dataframes that have been extracted
# from charts by the vegafusion data transformer. Use a WeakValueDictionary
Expand Down
6 changes: 2 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ all = [
"pandas>=0.25.3",
"numpy",
"pyarrow>=11",
"vegafusion[embed]>=1.6.6",
"vegafusion[embed]>=1.6.6,<2",
"anywidget>=0.9.0",
"altair_tiles>=0.3.0"
]
Expand Down Expand Up @@ -436,9 +436,7 @@ module = [
"nbformat.*",
"ipykernel.*",
"ibis.*",
# This refers to schemapi in the tools folder which is imported
# by the tools scripts such as generate_schema_wrapper.py
# "schemapi.*"
"vegafusion.*",
]
ignore_missing_imports = true

Expand Down
2 changes: 1 addition & 1 deletion tests/test_jupyter_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@


try:
import vegafusion # type: ignore # noqa: F401
import vegafusion # noqa: F401

transformers = ["default", "vegafusion"]
except ImportError:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_transformed_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import narwhals as nw

try:
import vegafusion as vf # type: ignore
import vegafusion as vf
except ImportError:
vf = None

Expand Down

0 comments on commit d3f0497

Please sign in to comment.