Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into transform-filter-pr…
Browse files Browse the repository at this point in the history
…edicates
  • Loading branch information
dangotbanned committed Nov 13, 2024
2 parents e3ced3e + b292ccf commit 64dc7fd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
27 changes: 15 additions & 12 deletions altair/utils/_importers.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,21 @@ def import_vegafusion() -> ModuleType:
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):
msg = (
"The versions of the vegafusion and vegafusion-python-embed packages must match\n"
f"and must be version {min_version} or greater.\n"
f"Found:\n"
f" - vegafusion=={version}\n"
f" - vegafusion-python-embed=={embed_version}\n"
)
raise RuntimeError(msg)

return vf
if Version(version) >= Version("2.0.0a0"):
# In VegaFusion 2.0 there is no vegafusion-python-embed package
return vf
else:
embed_version = importlib_version("vegafusion-python-embed")
if version != embed_version or Version(version) < Version(min_version):
msg = (
"The versions of the vegafusion and vegafusion-python-embed packages must match\n"
f"and must be version {min_version} or greater.\n"
f"Found:\n"
f" - vegafusion=={version}\n"
f" - vegafusion-python-embed=={embed_version}\n"
)
raise RuntimeError(msg)
return vf
except ImportError as err:
msg = (
'The "vegafusion" data transformer and chart.transformed_data feature requires\n'
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ all = [
"pandas>=1.1.3",
"numpy",
"pyarrow>=11",
"vegafusion[embed]>=1.6.6,<2",
"vegafusion[embed]>=1.6.6",
"anywidget>=0.9.0",
"altair_tiles>=0.3.0"
]
Expand Down

0 comments on commit 64dc7fd

Please sign in to comment.