appspace / appspace/kwwhat

dbt Project Evaluator feedback

Open
#127 0 comments 0 reactions 1 assignee Claimed by @daria-sukhareva View on GitHub
Dominant language
No language data
Stars
14
Forks
3
PR merge metrics
No merged PRs in 30d

Description

# dbt dbt Project Evaluator feedback — Remediation Plan

https://github.com/dbt-labs/dbt-project-evaluator

---

## Warnings

### 1. Sources without freshness

**1 source flagged:** `raw.ports`

No `freshness:` block defined. Add `warn_after` and `error_after` thresholds to `sources.yml`.

---

### 2. Model naming conventions

**7 models flagged.** The evaluator requires `fct_` (not `fact_`) for mart fact models.

| Model | Current prefix | Required prefix |
|---|---|---|
| `charge_point_span...` | `charge_` | `dim_` or `fct_` |
| `fact_charge_attempts` | `fact_` | `fct_` |
| `fact_downtime_daily` | `fact_` | `fct_` |
| `fact_interval_data` | `fact_` | `fct_` |
| `fact_location_cap...` | `fact_` | `fct_` |
| `fact_uptime` | `fact_` | `fct_` |
| `fact_visits` | `fact_` | `fct_` |

Six models need a `fact_` → `fct_` rename. One model (`charge_point_span...`) needs a full prefix rethink — determine if it is a fact or dimension, then rename accordingly.

Renaming is disruptive: downstream refs, semantic models, and Power BI connections must all be updated.

---

### 3. Model fanout

**1 intermediate flagged:** `int_ports`

`int_ports` fans out directly to multiple mart-level leaf children (`dim_charge_points` and others) without an intermediate consolidation step. Consider whether the fanout is intentional or whether a bridging intermediate model would improve clarity.

---

### 4. Rejoining of upstream concepts

**2 cases flagged** (both loop-independent — usually safe but worth reviewing):

| Parent | Child | Shared via |
|---|---|---|
| `dim_ports` | `fact_uptime` | `fact_downtime_daily` |
| `stg_ocpp_logs` | `fact_interval_data` | `int_meter_values` |

A model and its ancestor are both joined into the same downstream model via different paths. Verify there is no redundant join or unintended denormalization.

---

### 5. Missing primary key tests

**2 models flagged:**

| Model | Layer | Issue |
|---|---|---|
| `dim_dates` | marts | No tests on grain columns at all |
| `stg_ocpp_logs` | staging | Has 4 tests but none are `unique` + `not_null` on the PK |

Both need `unique` and `not_null` tests on their primary key columns per project standards.

---

### 6. Semantic layer spec migration (dbt Fusion / 2.0)

When dbt Fusion alpha was tested, it emitted a warning about an outdated semantic model schema. This does **not** appear on the current dbt-core 1.11.11 build. It will resurface if the project migrates to Fusion or dbt 2.0.

**File:** `models/semantic/semantic_models.yml`

#### 6a. `sum_boolean` aggregation removed — HIGH priority

`sum_boolean` was removed from MetricFlow. 6 measures need to be rewritten to `agg: sum` with an explicit cast.

| Semantic model | Measure | Fix |
|---|---|---|
| `visits` | `visit_success_count` | `agg: sum` + `expr: cast(is_successful as integer)` |
| `visits` | `troubled_success_count` | `agg: sum` + `expr: cast(case when ... then true else false end as integer)` |
| `visits` | `charge_attempt_success_count` | same pattern |
| `visits` | `first_attempt_success_count` | same pattern |
| `charge_attempts` | `attempt_success_rate` | same pattern |
| `drivers` | `known_drivers_count` | `agg: sum` + `expr: cast(is_known_driver as integer)` |

#### 6b. Ratio metric `numerator`/`denominator` format — HIGH priority

4 ratio metrics reference other **metric names** in `type_params`. The new spec expects **measure names**:

```yaml
# current — references a metric name
type_params:
numerator: total_charge_attempts
denominator: total_visits

# dbt 2.0 — references a measure name
type_params:
numerator:
name: charge_attempts_count
denominator:
name: visits_count
```

Affected metrics: `average_attempts_per_visit`, `first_attempt_success_rate`, `troubled_success_rate`, `failed_rate`.

#### 6c. Complex SQL `expr` in `is_successful` dimension — MEDIUM priority

In the `charge_attempts` semantic model, the `is_successful` dimension has a full multi-clause SQL predicate as its `expr`. Fusion's stricter type inference may reject this. If so, move the logic into `fact_charge_attempts` as a computed boolean column and simplify the dimension `expr` to reference that column directly.

#### 6d. `defaults.agg_time_dimension` block syntax — LOW priority

The `defaults:` block is present on `visits`, `charge_attempts`, `drivers`, and `uptime`. Key name likely stays the same but verify the nesting structure against the Fusion YAML spec before upgrading.

---

### 7. Test coverage below 100%

**Current coverage: 95.83%** (23 of 24 models have at least one test)

One model has zero tests. Identify it via `fct_test_coverage` and add at minimum a PK test.

```sql
-- find the untested model
select resource_name
from fct_test_coverage
where test_count = 0
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.