update projects to packages
This commit is contained in:
@@ -7,11 +7,17 @@ authors = [
|
|||||||
{ name = "Deeman", email = "hendriknote@gmail.com" }
|
{ name = "Deeman", email = "hendriknote@gmail.com" }
|
||||||
]
|
]
|
||||||
requires-python = ">=3.13"
|
requires-python = ">=3.13"
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"niquests>=3.14.1",
|
"niquests>=3.14.1",
|
||||||
"pendulum>=3.1.0",
|
"pendulum>=3.1.0",
|
||||||
]
|
]
|
||||||
|
[project.scripts]
|
||||||
|
extract_psd = "psdonline.execute:main"
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["hatchling"]
|
requires = ["hatchling"]
|
||||||
build-backend = "hatchling.build"
|
build-backend = "hatchling.build"
|
||||||
|
|
||||||
|
[tool.hatch.build.targets.wheel]
|
||||||
|
packages = ["src/psdonline"]
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
AUDIT (
|
|
||||||
name assert_positive_order_ids,
|
|
||||||
);
|
|
||||||
|
|
||||||
SELECT *
|
|
||||||
FROM @this_model
|
|
||||||
WHERE
|
|
||||||
item_id < 0
|
|
||||||
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
# --- Gateway Connection ---
|
|
||||||
gateways:
|
|
||||||
duckdb:
|
|
||||||
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: db.db
|
|
||||||
# concurrent_tasks: 1
|
|
||||||
# register_comments: True
|
|
||||||
# pre_ping: False
|
|
||||||
# pretty_sql: False
|
|
||||||
# catalogs:
|
|
||||||
# extensions:
|
|
||||||
# connector_config:
|
|
||||||
# secrets:
|
|
||||||
# filesystems:
|
|
||||||
# token:
|
|
||||||
|
|
||||||
default_gateway: duckdb
|
|
||||||
|
|
||||||
# --- Model Defaults ---
|
|
||||||
# https://sqlmesh.readthedocs.io/en/stable/reference/model_configuration/#model-defaults
|
|
||||||
|
|
||||||
model_defaults:
|
|
||||||
dialect: duckdb
|
|
||||||
start: 2025-07-07 # Start date for backfill history
|
|
||||||
cron: '@daily' # Run models daily at 12am UTC (can override per model)
|
|
||||||
|
|
||||||
# --- Linting Rules ---
|
|
||||||
# Enforce standards for your team
|
|
||||||
# https://sqlmesh.readthedocs.io/en/stable/guides/linter/
|
|
||||||
|
|
||||||
linter:
|
|
||||||
enabled: true
|
|
||||||
rules:
|
|
||||||
- ambiguousorinvalidcolumn
|
|
||||||
- invalidselectstarexpansion
|
|
||||||
|
|
||||||
# FLOW: Minimal prompts, automatic changes, summary output
|
|
||||||
# https://sqlmesh.readthedocs.io/en/stable/reference/configuration/#plan
|
|
||||||
|
|
||||||
plan:
|
|
||||||
no_diff: true # Hide detailed text differences for changed models
|
|
||||||
no_prompts: true # No interactive prompts
|
|
||||||
auto_apply: true # Apply changes automatically
|
|
||||||
|
|
||||||
# --- Optional: Set a default target environment ---
|
|
||||||
# This is intended for local development to prevent users from accidentally applying plans to the prod environment.
|
|
||||||
# It is a development only config and should NOT be committed to your git repo.
|
|
||||||
# https://sqlmesh.readthedocs.io/en/stable/guides/configuration/#default-target-environment
|
|
||||||
|
|
||||||
# Uncomment the following line to use a default target environment derived from the logged in user's name.
|
|
||||||
# default_target_environment: dev_{{ user() }}
|
|
||||||
|
|
||||||
# Example usage:
|
|
||||||
# sqlmesh plan # Automatically resolves to: sqlmesh plan dev_yourname
|
|
||||||
# sqlmesh plan prod # Specify `prod` to apply changes to production
|
|
||||||
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,16 +0,0 @@
|
|||||||
[project]
|
|
||||||
name = "sqlmesh-materia"
|
|
||||||
version = "0.1.0"
|
|
||||||
description = "Add your description here"
|
|
||||||
readme = "README.md"
|
|
||||||
authors = [
|
|
||||||
{ name = "Deeman", email = "hendriknote@gmail.com" }
|
|
||||||
]
|
|
||||||
requires-python = ">=3.13"
|
|
||||||
dependencies = [
|
|
||||||
"sqlmesh>=0.200.0",
|
|
||||||
]
|
|
||||||
|
|
||||||
[build-system]
|
|
||||||
requires = ["hatchling"]
|
|
||||||
build-backend = "hatchling.build"
|
|
||||||
@@ -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
|
|
||||||
|
@@ -1,19 +0,0 @@
|
|||||||
test_example_full_model:
|
|
||||||
model: sqlmesh_example.full_model
|
|
||||||
inputs:
|
|
||||||
sqlmesh_example.incremental_model:
|
|
||||||
rows:
|
|
||||||
- id: 1
|
|
||||||
item_id: 1
|
|
||||||
- id: 2
|
|
||||||
item_id: 1
|
|
||||||
- id: 3
|
|
||||||
item_id: 2
|
|
||||||
outputs:
|
|
||||||
query:
|
|
||||||
rows:
|
|
||||||
- item_id: 1
|
|
||||||
num_orders: 2
|
|
||||||
- item_id: 2
|
|
||||||
num_orders: 1
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user