Skip to content

Commit 31e7528

Browse files
Fix package-lock.yml format, remove dbt-vertica from all extra, add release validation (#2159)
* Fix package-lock.yml format for dbt 1.8+ and remove restrictive adapters from all extra - Remove deprecated 'name' fields from package-lock.yml that dbt 1.8+ rejects - Remove dbt-clickhouse, dbt-sqlserver, dbt-vertica from 'all' extra as they pin dbt-core to 1.8.x (still available as individual extras) Co-Authored-By: Itamar Hartstein <haritamar@gmail.com> * Add release validation: reject package-lock.yml with deprecated 'name' fields Co-Authored-By: Itamar Hartstein <haritamar@gmail.com> * Revert lock file and release validation changes The 'name' field in package-lock.yml is not deprecated - it is the current format generated by modern dbt versions. The issue was specific to dbt 1.8.x which has a bug rejecting this field. The real fix is removing restrictive adapters from the 'all' extra so dbt resolves to 1.11+ where this bug doesn't exist. Co-Authored-By: Itamar Hartstein <haritamar@gmail.com> * Fix package-lock.yml and release validation wording - Remove 'name' fields from package-lock.yml (unsupported in dbt 1.8) - Re-add release validation with corrected wording: 'unsupported in dbt 1.8' instead of incorrectly saying 'deprecated' Co-Authored-By: Itamar Hartstein <haritamar@gmail.com> * Add dbt-clickhouse and dbt-sqlserver back to all extra Only dbt-vertica (dbt-core==1.8.5 exact pin) and dbt-fabricspark (broken upstream) need to stay out. dbt-clickhouse 1.10.0 requires dbt-core>=1.9 and dbt-sqlserver 1.9.0 requires dbt-core>=1.9.0,<2.0, so both are compatible with newer dbt-core versions. Co-Authored-By: Itamar Hartstein <haritamar@gmail.com> * Add comments explaining why fabricspark and vertica are excluded from all extra Co-Authored-By: Itamar Hartstein <haritamar@gmail.com> * Bump version to 0.23.1 Co-Authored-By: Itamar Hartstein <haritamar@gmail.com> * Add pre-commit hook to auto-strip 'name' fields from package-lock.yml The hook runs on package-lock.yml changes, strips any 'name' fields (unsupported in dbt 1.8), and exits 1 so the user re-stages the fix. Placed before the existing verify-dbt-project-packages-lock hook. Co-Authored-By: Itamar Hartstein <haritamar@gmail.com> * Remove release validation for package-lock.yml name fields The pre-commit hook handles this automatically now, so the release validation step is redundant. Co-Authored-By: Itamar Hartstein <haritamar@gmail.com> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Itamar Hartstein <haritamar@gmail.com>
1 parent 8c910d4 commit 31e7528

File tree

3 files changed

+30
-6
lines changed

3 files changed

+30
-6
lines changed

.pre-commit-config.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,29 @@ repos:
4646

4747
- repo: local
4848
hooks:
49+
- id: strip-name-from-package-lock
50+
name: Strip 'name' fields from package-lock.yml (unsupported in dbt 1.8)
51+
entry: |
52+
python -c "
53+
import yaml, sys
54+
lock_file = 'elementary/monitor/dbt_project/package-lock.yml'
55+
with open(lock_file) as f:
56+
data = yaml.safe_load(f)
57+
changed = False
58+
for pkg in data.get('packages', []):
59+
if 'name' in pkg:
60+
del pkg['name']
61+
changed = True
62+
if changed:
63+
with open(lock_file, 'w') as f:
64+
yaml.dump(data, f, default_flow_style=False, sort_keys=False)
65+
print(f'Removed unsupported name fields from {lock_file}')
66+
sys.exit(1)
67+
"
68+
language: system
69+
files: package-lock\.yml$
70+
pass_filenames: false
71+
4972
- id: verify-dbt-project-packages-lock
5073
name: Verify internal dbt project package lock
5174
entry: |
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
packages:
2-
- name: dbt_utils
3-
package: dbt-labs/dbt_utils
2+
- package: dbt-labs/dbt_utils
43
version: 0.8.6
5-
- name: elementary
6-
package: elementary-data/elementary
4+
- package: elementary-data/elementary
75
version: 0.23.0
86
sha1_hash: 0edc67beba193ced6784779894083b5af00f73ec

pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "elementary-data"
3-
version = "0.23.0"
3+
version = "0.23.1"
44
description = "Data monitoring and lineage"
55
authors = ["Elementary"]
66
keywords = ["data", "lineage", "data lineage", "data warehouse", "DWH", "observability", "data monitoring", "data observability", "Snowflake", "BigQuery", "Redshift", "data reliability", "analytics engineering"]
@@ -76,7 +76,10 @@ fabric = ["dbt-fabric"]
7676
fabricspark = ["dbt-fabricspark"]
7777
sqlserver = ["dbt-sqlserver"]
7878
vertica = ["dbt-vertica"]
79-
all = ["dbt-snowflake", "dbt-bigquery", "dbt-redshift", "dbt-postgres", "dbt-databricks", "dbt-spark", "dbt-clickhouse", "dbt-athena-community", "dbt-trino", "dbt-duckdb", "dbt-dremio", "dbt-fabric", "dbt-sqlserver", "dbt-vertica"]
79+
# dbt-fabricspark is excluded due to broken upstream dependencies (azure-cli pre-release pins).
80+
# dbt-vertica is excluded because it pins dbt-core==1.8.5, forcing the entire resolution to dbt 1.8.
81+
# Both are still available as individual extras (e.g. pip install elementary-data[vertica]).
82+
all = ["dbt-snowflake", "dbt-bigquery", "dbt-redshift", "dbt-postgres", "dbt-databricks", "dbt-spark", "dbt-athena-community", "dbt-trino", "dbt-clickhouse", "dbt-duckdb", "dbt-dremio", "dbt-fabric", "dbt-sqlserver"]
8083

8184
[build-system]
8285
requires = ["poetry-core>=1.0.0"]

0 commit comments

Comments
 (0)