-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: fix altair api break, cleanup DependencyManager #2006
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
marimo/_ast/visitor.py
Outdated
@@ -365,7 +365,7 @@ def visit_Call(self, node: ast.Call) -> None: | |||
elif isinstance(first_arg, ast.JoinedStr): | |||
sql = normalize_sql_f_string(first_arg) | |||
|
|||
if isinstance(sql, str) and DependencyManager.has_duckdb() and sql: | |||
if isinstance(sql, str) and DependencyManager.duckdb.has() and sql: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be has_at_version
? extract_statements
isn't available in some earlier versions of duckdb
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea i can add it here too
@@ -33,7 +33,7 @@ def sql( | |||
Returns: | |||
The result of the query. | |||
""" | |||
DependencyManager.require_duckdb("to execute sql") | |||
DependencyManager.duckdb.require("to execute sql") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be require_at_version
?
|
||
@staticmethod | ||
def require_numpy(why: str) -> None: | ||
def require(self, why: str) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also have a require_at_version
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i can add it, but I dont think it is used yet
polars = Dependency("polars") | ||
numpy = Dependency("numpy") | ||
altair = Dependency("altair", min_version="5.3.0", max_version="6.0.0") | ||
duckdb = Dependency("duckdb") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
min_version=1.0.0
? Or do we support duckdb < 1.0
in some places?
Hey, sorry to chime in, just wanted to
Thanks 🙏 |
Hi @MarcoGorelli - thanks for chiming in (and being a fan!)
|
🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.7.20-dev13 |
just fyi, the next Altair version should address this vega/altair#3550 |
thank you @MarcoGorelli! |
Fixes #2005
Altair made an (arguably) breaking change. Their data transformers now pass narwhal dataframes instead of pandas, which breaks some downstream features in marimo. This PR now supports narwhals
This is nice actually nice since now we can pass polars, pyarrow, etc to altair charts and get back the polars, pyarrow, etc charts.
This also DRYs up
DependencyManager