testing sqlmesh
This commit is contained in:
@@ -13,7 +13,7 @@ dependencies = [
|
|||||||
"pendulum>=3.1.0",
|
"pendulum>=3.1.0",
|
||||||
]
|
]
|
||||||
[project.scripts]
|
[project.scripts]
|
||||||
extract_psd = "psdonline.execute:main"
|
extract_psd = "psdonline.execute:extract_psd_dataset"
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["hatchling"]
|
requires = ["hatchling"]
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
def hello() -> str:
|
|
||||||
return "Hello from psdonline!"
|
|
||||||
|
|||||||
@@ -25,11 +25,11 @@ dev = [
|
|||||||
|
|
||||||
[tool.uv.sources]
|
[tool.uv.sources]
|
||||||
psdonline = {workspace = true }
|
psdonline = {workspace = true }
|
||||||
|
sqlmesh_materia = {workspace = true }
|
||||||
|
|
||||||
[tool.uv.workspace]
|
[tool.uv.workspace]
|
||||||
members = [
|
members = [
|
||||||
"extract/*",
|
"extract/*",
|
||||||
"load/*",
|
|
||||||
"transform/*",
|
"transform/*",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -1,24 +1,27 @@
|
|||||||
# --- Gateway Connection ---
|
# --- Gateway Connection ---
|
||||||
gateways:
|
gateways:
|
||||||
duckdb:
|
|
||||||
|
dev:
|
||||||
connection:
|
connection:
|
||||||
# For more information on configuring the connection to your execution engine, visit:
|
# For more information on configuring the connection to your execution engine, visit:
|
||||||
# https://sqlmesh.readthedocs.io/en/stable/reference/configuration/#connection
|
# https://sqlmesh.readthedocs.io/en/stable/reference/configuration/#connection
|
||||||
# https://sqlmesh.readthedocs.io/en/stable/integrations/engines/duckdb/#connection-options
|
# https://sqlmesh.readthedocs.io/en/stable/integrations/engines/duckdb/#connection-options
|
||||||
type: duckdb
|
type: duckdb
|
||||||
database: db.db
|
database: materia_dev_db.db
|
||||||
# concurrent_tasks: 1
|
extensions:
|
||||||
# register_comments: True
|
- name: zipfs
|
||||||
# pre_ping: False
|
|
||||||
# pretty_sql: False
|
|
||||||
# catalogs:
|
|
||||||
# extensions:
|
|
||||||
# connector_config:
|
|
||||||
# secrets:
|
|
||||||
# filesystems:
|
|
||||||
# token:
|
|
||||||
|
|
||||||
default_gateway: duckdb
|
prod:
|
||||||
|
connection:
|
||||||
|
# For more information on configuring the connection to your execution engine, visit:
|
||||||
|
# https://sqlmesh.readthedocs.io/en/stable/reference/configuration/#connection
|
||||||
|
# https://sqlmesh.readthedocs.io/en/stable/integrations/engines/duckdb/#connection-options
|
||||||
|
type: duckdb
|
||||||
|
database: materia_prod_db.db
|
||||||
|
extensions:
|
||||||
|
- name: zipfs
|
||||||
|
|
||||||
|
default_gateway: dev
|
||||||
|
|
||||||
# --- Model Defaults ---
|
# --- Model Defaults ---
|
||||||
# https://sqlmesh.readthedocs.io/en/stable/reference/model_configuration/#model-defaults
|
# https://sqlmesh.readthedocs.io/en/stable/reference/model_configuration/#model-defaults
|
||||||
|
|||||||
Binary file not shown.
@@ -1,15 +0,0 @@
|
|||||||
MODEL (
|
|
||||||
name sqlmesh_example.full_model,
|
|
||||||
kind FULL,
|
|
||||||
cron '@daily',
|
|
||||||
grain item_id,
|
|
||||||
audits (assert_positive_order_ids),
|
|
||||||
);
|
|
||||||
|
|
||||||
SELECT
|
|
||||||
item_id,
|
|
||||||
COUNT(DISTINCT id) AS num_orders,
|
|
||||||
FROM
|
|
||||||
sqlmesh_example.incremental_model
|
|
||||||
GROUP BY item_id
|
|
||||||
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
MODEL (
|
|
||||||
name sqlmesh_example.incremental_model,
|
|
||||||
kind INCREMENTAL_BY_TIME_RANGE (
|
|
||||||
time_column event_date
|
|
||||||
),
|
|
||||||
start '2020-01-01',
|
|
||||||
cron '@daily',
|
|
||||||
grain (id, event_date)
|
|
||||||
);
|
|
||||||
|
|
||||||
SELECT
|
|
||||||
id,
|
|
||||||
item_id,
|
|
||||||
event_date,
|
|
||||||
FROM
|
|
||||||
sqlmesh_example.seed_model
|
|
||||||
WHERE
|
|
||||||
event_date BETWEEN @start_date AND @end_date
|
|
||||||
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
MODEL (
|
|
||||||
name sqlmesh_example.seed_model,
|
|
||||||
kind SEED (
|
|
||||||
path '../seeds/seed_data.csv'
|
|
||||||
),
|
|
||||||
columns (
|
|
||||||
id INTEGER,
|
|
||||||
item_id INTEGER,
|
|
||||||
event_date DATE
|
|
||||||
),
|
|
||||||
grain (id, event_date)
|
|
||||||
);
|
|
||||||
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "sqlmesh-materia"
|
name = "sqlmesh_materia"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
description = "Add your description here"
|
description = "Add your description here"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
@@ -11,8 +11,6 @@ dependencies = [
|
|||||||
"sqlmesh>=0.200.0",
|
"sqlmesh>=0.200.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[project.scripts]
|
|
||||||
plan = "sqlmesh plan"
|
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["hatchling"]
|
requires = ["hatchling"]
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
id,item_id,event_date
|
|
||||||
1,2,2020-01-01
|
|
||||||
2,1,2020-01-01
|
|
||||||
3,3,2020-01-03
|
|
||||||
4,1,2020-01-04
|
|
||||||
5,1,2020-01-05
|
|
||||||
6,1,2020-01-06
|
|
||||||
7,1,2020-01-07
|
|
||||||
|
2
uv.lock
generated
2
uv.lock
generated
@@ -1203,7 +1203,7 @@ wheels = [
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "sqlmesh-materia"
|
name = "sqlmesh-materia"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = { editable = "transform/sqlmesh-materia" }
|
source = { editable = "transform/sqlmesh_materia" }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "sqlmesh" },
|
{ name = "sqlmesh" },
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user