bricksentry 0.1.15__tar.gz → 0.1.16__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {bricksentry-0.1.15 → bricksentry-0.1.16}/CHANGELOG.md +8 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/PKG-INFO +1 -1
- bricksentry-0.1.16/deploy/databricks-app/requirements.txt +1 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/pyproject.toml +1 -1
- {bricksentry-0.1.15 → bricksentry-0.1.16}/server.json +2 -2
- {bricksentry-0.1.15 → bricksentry-0.1.16}/src/bricksentry/__init__.py +1 -1
- {bricksentry-0.1.15 → bricksentry-0.1.16}/src/bricksentry/history.py +8 -4
- {bricksentry-0.1.15 → bricksentry-0.1.16}/templates/job-check/databricks_template_schema.json +8 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/templates/job-check/template/{{.project_name}}/README.md.tmpl +7 -1
- {bricksentry-0.1.15 → bricksentry-0.1.16}/templates/job-check/template/{{.project_name}}/resources/bricksentry_check.job.yml.tmpl +7 -2
- {bricksentry-0.1.15 → bricksentry-0.1.16}/tests/test_0114.py +16 -3
- bricksentry-0.1.15/deploy/databricks-app/requirements.txt +0 -1
- {bricksentry-0.1.15 → bricksentry-0.1.16}/.gitignore +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/CONTRIBUTING.md +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/LICENSE +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/README.md +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/SECURITY.md +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/action.yml +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/deploy/databricks-app/README.md +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/deploy/databricks-app/app.yaml +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/deploy/databricks-app/bricksentry.yml +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/deploy/databricks-app/databricks.yml +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/deploy/databricks-app/grants.sql +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/examples/databricks/bricksentry.yml +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/examples/databricks/bricksentry_check_my_table.ipynb +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/examples/databricks/bricksentry_check_my_table.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/examples/databricks/bricksentry_hr_walkthrough.ipynb +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/examples/databricks/bricksentry_hr_walkthrough.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/examples/databricks/bricksentry_quickstart.ipynb +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/examples/databricks/bricksentry_quickstart.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/examples/databricks/github-workflow.yml +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/examples/databricks/policy.yml +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/examples/demo/agent_loop_demo.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/scripts/build_notebook.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/src/bricksentry/__main__.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/src/bricksentry/agent_tools.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/src/bricksentry/assess.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/src/bricksentry/backends/__init__.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/src/bricksentry/backends/base.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/src/bricksentry/backends/databricks_backend.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/src/bricksentry/backends/duckdb_backend.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/src/bricksentry/changes.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/src/bricksentry/cli.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/src/bricksentry/config.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/src/bricksentry/demo.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/src/bricksentry/diff.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/src/bricksentry/explain.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/src/bricksentry/github.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/src/bricksentry/job.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/src/bricksentry/lineage.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/src/bricksentry/mcp_server.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/src/bricksentry/measures.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/src/bricksentry/models.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/src/bricksentry/notify.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/src/bricksentry/policy.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/src/bricksentry/policy_templates.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/src/bricksentry/preview.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/src/bricksentry/py.typed +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/src/bricksentry/report.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/templates/job-check/README.md +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/templates/job-check/template/{{.project_name}}/.gitignore +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/templates/job-check/template/{{.project_name}}/databricks.yml.tmpl +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/templates/job-check/template/{{.project_name}}/src/bricksentry_check.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/tests/conftest.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/tests/test_0110.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/tests/test_0112.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/tests/test_018.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/tests/test_019.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/tests/test_assess_policy.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/tests/test_check_notebook.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/tests/test_databricks_and_uc.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/tests/test_demo.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/tests/test_diff.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/tests/test_hr_notebook.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/tests/test_notebook.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/tests/test_notify_templates.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/tests/test_preview_agents.py +0 -0
- {bricksentry-0.1.15 → bricksentry-0.1.16}/tests/test_sample_guard_and_store.py +0 -0
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.16 (2026-11-11)
|
|
4
|
+
|
|
5
|
+
From the live test of 0.1.15 on Databricks serverless:
|
|
6
|
+
|
|
7
|
+
- Fix: two checks of the same table at the same time (two jobs watching it, or a job and a notebook) used the same scratch clone names, so one check's cleanup could drop the other's clone mid-diff (`TABLE_OR_VIEW_NOT_FOUND`). Each check now uses its own clone names.
|
|
8
|
+
- The job template's task also sets `disable_auto_optimization: true`. On serverless, auto-optimization retries failed tasks even with `max_retries: 0`, so a `block` was still run twice.
|
|
9
|
+
- The job template now pins the bricksentry version (new `bricksentry_version` prompt, default the current release). Correction to the 0.1.15 release notes: a job deployed with `>=0.1.14` does **not** pick up new releases by itself, because serverless resolves a job's dependencies once and caches them. To upgrade, change the version in the job's YAML and redeploy; the generated README says so.
|
|
10
|
+
|
|
3
11
|
## 0.1.15 (2026-11-11)
|
|
4
12
|
|
|
5
13
|
From the first live test of the 0.1.14 job template on Databricks serverless (deployed with `databricks bundle deploy`, started by the table update trigger and by hand):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: bricksentry
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.16
|
|
4
4
|
Summary: Change-safety for Databricks pipelines and the AI agents that edit them: data diffs, Unity Catalog blast radius, policy verdicts and rollback plans.
|
|
5
5
|
Project-URL: Homepage, https://bricksentry.org
|
|
6
6
|
Project-URL: Documentation, https://bricksentry.org/docs
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
bricksentry[databricks,mcp]==0.1.16
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "bricksentry"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.16"
|
|
8
8
|
description = "Change-safety for Databricks pipelines and the AI agents that edit them: data diffs, Unity Catalog blast radius, policy verdicts and rollback plans."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
"source": "github"
|
|
9
9
|
},
|
|
10
10
|
"websiteUrl": "https://bricksentry.org",
|
|
11
|
-
"version": "0.1.
|
|
11
|
+
"version": "0.1.16",
|
|
12
12
|
"packages": [
|
|
13
13
|
{
|
|
14
14
|
"registryType": "pypi",
|
|
15
15
|
"identifier": "bricksentry-mcp",
|
|
16
|
-
"version": "0.1.
|
|
16
|
+
"version": "0.1.16",
|
|
17
17
|
"runtimeHint": "uvx",
|
|
18
18
|
"transport": {
|
|
19
19
|
"type": "stdio"
|
|
@@ -9,6 +9,7 @@ version after), diffs them, runs lineage and policy, and returns the assessment
|
|
|
9
9
|
from __future__ import annotations
|
|
10
10
|
|
|
11
11
|
import re
|
|
12
|
+
import uuid
|
|
12
13
|
from dataclasses import dataclass
|
|
13
14
|
from datetime import datetime, timezone
|
|
14
15
|
from typing import TYPE_CHECKING, Any
|
|
@@ -123,9 +124,9 @@ def pick_change(
|
|
|
123
124
|
str(h.get("timestamp") or ""), [h["version"]])
|
|
124
125
|
|
|
125
126
|
|
|
126
|
-
def _scratch_name(schema: str, table: str, version: int) -> str:
|
|
127
|
+
def _scratch_name(schema: str, table: str, version: int, run: str) -> str:
|
|
127
128
|
short = re.sub(r"[^A-Za-z0-9_]", "_", table.split(".")[-1])[:40]
|
|
128
|
-
return f"{schema}.bs_check_{short}_v{version}"
|
|
129
|
+
return f"{schema}.bs_check_{short}_v{version}_{run}"
|
|
129
130
|
|
|
130
131
|
|
|
131
132
|
def check_change(
|
|
@@ -154,8 +155,11 @@ def check_change(
|
|
|
154
155
|
"or add a PRIMARY KEY constraint to the table.")
|
|
155
156
|
|
|
156
157
|
scratch = sentry.config.sandbox_schema
|
|
157
|
-
|
|
158
|
-
|
|
158
|
+
# Unique per check, so two checks of the same table at the same time (two jobs, or a job
|
|
159
|
+
# and a notebook) never drop each other's clones.
|
|
160
|
+
run = uuid.uuid4().hex[:8]
|
|
161
|
+
base = _scratch_name(scratch, table, change.base_version, run)
|
|
162
|
+
cand = _scratch_name(scratch, table, change.version, run)
|
|
159
163
|
db.ensure_schema(scratch)
|
|
160
164
|
try:
|
|
161
165
|
for target, v in ((base, change.base_version), (cand, change.version)):
|
{bricksentry-0.1.15 → bricksentry-0.1.16}/templates/job-check/databricks_template_schema.json
RENAMED
|
@@ -72,6 +72,14 @@
|
|
|
72
72
|
],
|
|
73
73
|
"description": "Mark the run failed when the verdict is at least",
|
|
74
74
|
"order": 8
|
|
75
|
+
},
|
|
76
|
+
"bricksentry_version": {
|
|
77
|
+
"type": "string",
|
|
78
|
+
"default": "0.1.16",
|
|
79
|
+
"description": "bricksentry version to install in the job (pinned; change it and redeploy to upgrade)",
|
|
80
|
+
"pattern": "^\\d+\\.\\d+\\.\\d+$",
|
|
81
|
+
"pattern_match_failure_message": "Use a version like 0.1.16.",
|
|
82
|
+
"order": 9
|
|
75
83
|
}
|
|
76
84
|
},
|
|
77
85
|
"success_message": "Created {{.project_name}}. Next: cd {{.project_name}} && databricks bundle deploy. See {{.project_name}}/README.md."
|
|
@@ -26,6 +26,12 @@ The job's identity needs `SELECT` on the tables, `USE` and `CREATE TABLE` on
|
|
|
26
26
|
lineage){{if .slack_secret}}, and `READ` on the secret scope{{end}}. Table history must still be there
|
|
27
27
|
(not removed by `VACUUM`).
|
|
28
28
|
|
|
29
|
+
## Upgrading bricksentry
|
|
30
|
+
|
|
31
|
+
The job installs `bricksentry[databricks]=={{.bricksentry_version}}`. Serverless resolves a job's
|
|
32
|
+
dependencies once and caches them, so to upgrade, change that version in
|
|
33
|
+
`resources/bricksentry_check.job.yml` and run `databricks bundle deploy` again.
|
|
34
|
+
|
|
29
35
|
## Slack alerts
|
|
30
36
|
|
|
31
37
|
```bash
|
|
@@ -55,7 +61,7 @@ writes the table:
|
|
|
55
61
|
depends_on: [{task_key: bricksentry_check}]
|
|
56
62
|
environments:
|
|
57
63
|
- environment_key: bricksentry
|
|
58
|
-
spec: {environment_version: "2", dependencies: ["bricksentry[databricks]
|
|
64
|
+
spec: {environment_version: "2", dependencies: ["bricksentry[databricks]=={{.bricksentry_version}}"]}
|
|
59
65
|
```
|
|
60
66
|
|
|
61
67
|
`--since {{`{{job.start_time.iso_datetime}}`}}` checks everything this run wrote as one change.
|
|
@@ -16,7 +16,10 @@ resources:
|
|
|
16
16
|
tasks:
|
|
17
17
|
- task_key: bricksentry_check
|
|
18
18
|
environment_key: default
|
|
19
|
-
|
|
19
|
+
# A block verdict is an answer, not a flaky failure: no retries. On serverless,
|
|
20
|
+
# auto-optimization retries failed tasks even with max_retries: 0, so turn it off too.
|
|
21
|
+
max_retries: 0
|
|
22
|
+
disable_auto_optimization: true
|
|
20
23
|
spark_python_task:
|
|
21
24
|
python_file: ../src/bricksentry_check.py
|
|
22
25
|
parameters:
|
|
@@ -51,4 +54,6 @@ resources:
|
|
|
51
54
|
spec:
|
|
52
55
|
environment_version: "2"
|
|
53
56
|
dependencies:
|
|
54
|
-
|
|
57
|
+
# Pinned: serverless resolves the dependencies once and caches them, so a range
|
|
58
|
+
# would not pick up new releases. To upgrade, change the version and redeploy.
|
|
59
|
+
- bricksentry[databricks]=={{.bricksentry_version}}
|
|
@@ -113,8 +113,10 @@ def test_check_change_end_to_end():
|
|
|
113
113
|
assert t.rollback == 'RESTORE TABLE "sales"."orders" TO VERSION AS OF 2'
|
|
114
114
|
assert t.summary.startswith("v2 -> v3 (MERGE): ")
|
|
115
115
|
assert [n.name for n in t.downstream] == ["sales.daily_revenue"]
|
|
116
|
-
assert
|
|
117
|
-
|
|
116
|
+
assert [re.sub(r"_[0-9a-f]{8}$", "", d) for d in db.dropped] == [
|
|
117
|
+
"scratch.bs_check_orders_v2", "scratch.bs_check_orders_v3"]
|
|
118
|
+
assert db.dropped[0][-8:] == db.dropped[1][-8:] # one run id per check
|
|
119
|
+
assert not any(db.table_exists(d) for d in db.dropped)
|
|
118
120
|
|
|
119
121
|
|
|
120
122
|
def test_check_change_since_and_keys_from_config():
|
|
@@ -320,6 +322,7 @@ def test_bundle_template_renders(slack, keys):
|
|
|
320
322
|
root = Path(__file__).resolve().parents[1] / "templates" / "job-check"
|
|
321
323
|
schema = json.loads((root / "databricks_template_schema.json").read_text())
|
|
322
324
|
values = {k: p.get("default", "") for k, p in schema["properties"].items()}
|
|
325
|
+
assert values["bricksentry_version"] == __import__("bricksentry").__version__
|
|
323
326
|
values.update(tables="main.sales.orders, main.sales.customers", warehouse_id="abc123", slack_secret=slack,
|
|
324
327
|
keys=keys)
|
|
325
328
|
for k, p in schema["properties"].items():
|
|
@@ -337,7 +340,8 @@ def test_bundle_template_renders(slack, keys):
|
|
|
337
340
|
assert "{{workspace.url}}/jobs/{{job.id}}/runs/{{job.run_id}}" in params
|
|
338
341
|
assert ("--slack-secret" in params) == bool(slack)
|
|
339
342
|
assert ("--keys" in params) == bool(keys)
|
|
340
|
-
assert task["max_retries"] == 0
|
|
343
|
+
assert task["max_retries"] == 0 and task["disable_auto_optimization"] is True
|
|
344
|
+
assert j["environments"][0]["spec"]["dependencies"] == [f"bricksentry[databricks]=={values['bricksentry_version']}"]
|
|
341
345
|
assert task["environment_key"] == j["environments"][0]["environment_key"]
|
|
342
346
|
assert j["environments"][0]["spec"]["dependencies"][0].startswith("bricksentry[databricks]")
|
|
343
347
|
# the job task's argv parses, and an unresolved trigger value falls back to --default-tables
|
|
@@ -375,3 +379,12 @@ def test_job_keys_option():
|
|
|
375
379
|
code = job.run(["--tables", "sales.orders", "--keys", "sales.orders=order_id; sales.other=x",
|
|
376
380
|
"--scratch-schema", "scratch", "--fail-on", "never"], backend=FakeDelta(pk=()), out=lines.append)
|
|
377
381
|
assert code == 0 and "sales.orders: BLOCK" in lines[0]
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
def test_concurrent_checks_use_different_clones():
|
|
385
|
+
"""Two checks of the same table must not share clone names (found live: one job's cleanup
|
|
386
|
+
dropped the other's clone mid-diff)."""
|
|
387
|
+
db = FakeDelta()
|
|
388
|
+
sentry(db).check_change("sales.orders")
|
|
389
|
+
sentry(db).check_change("sales.orders")
|
|
390
|
+
assert len(set(db.dropped)) == 4
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
bricksentry[databricks,mcp]==0.1.15
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bricksentry-0.1.15 → bricksentry-0.1.16}/examples/databricks/bricksentry_check_my_table.ipynb
RENAMED
|
File without changes
|
|
File without changes
|
{bricksentry-0.1.15 → bricksentry-0.1.16}/examples/databricks/bricksentry_hr_walkthrough.ipynb
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{bricksentry-0.1.15 → bricksentry-0.1.16}/templates/job-check/template/{{.project_name}}/.gitignore
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|