Skip to content
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

Chore: update ibis example #4

Merged
merged 1 commit into from
Jun 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions 002_ibis/models/ibis_full_model_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
from sqlglot import exp

from sqlmesh import ExecutionContext, model
from sqlmesh.core.model import FullKind
from sqlmesh.core.model import ModelKindName


@model(
"ibis.ibis_full_model_python",
kind=FullKind(),
kind=dict(name=ModelKindName.FULL),
columns={
"item_id": "int",
"num_orders": "int",
Expand All @@ -33,7 +33,7 @@ def execute(
con = ibis.duckdb.connect(DB_PATH)

# retrieve table
incremental_model = con.table(name=upstream_model.name, schema=upstream_model.db)
incremental_model = con.table(name=upstream_model.name, database=upstream_model.db)

# build query
count = incremental_model.id.nunique()
Expand Down
2 changes: 1 addition & 1 deletion 002_ibis/models/ibis_full_model_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def entrypoint(evaluator: MacroEvaluator) -> str:
incremental_model = UnboundTable(
name="incremental_model",
schema={"id": "int32", "item_id": "int32", "ds": "varchar"},
namespace=Namespace(database="local", schema="ibis"),
namespace=Namespace(catalog="local", database="ibis"),
).to_expr()

# build query
Expand Down