Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions mock-cli/test-shopify/.databao/databao.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
dbt:
project: shopify_analytics
path: /Users/Artem.Trofimov/Work/databao-cli/mock-cli/test-shopify
databao:
path: /Users/Artem.Trofimov/Work/databao-cli/mock-cli/test-shopify/.databao
Comment on lines +3 to +5
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file appears to contain local, machine-specific absolute paths (e.g., under /Users/...) which will break for other environments and can leak developer workstation details. Consider storing paths relative to the dbt project root, or using env vars/placeholders, and avoid committing the generated per-user config to the repo.

Suggested change
path: /Users/Artem.Trofimov/Work/databao-cli/mock-cli/test-shopify
databao:
path: /Users/Artem.Trofimov/Work/databao-cli/mock-cli/test-shopify/.databao
path: .
databao:
path: .databao

Copilot uses AI. Check for mistakes.
connection:
type: duckdb
path: shopify.duckdb
schema: main
threads: 4
user:
email: artem@databao.app
token: mock_oauth_token_a1b2c3d4
Comment on lines +11 to +13
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Committing user credentials (email/token), even if "mock", is risky and trains insecure patterns; it can also be accidentally treated as real by tooling. Recommend removing the user block from the committed file and loading credentials from environment variables or a local-only config that is gitignored.

Suggested change
user:
email: artem@databao.app
token: mock_oauth_token_a1b2c3d4

Copilot uses AI. Check for mistakes.
2 changes: 2 additions & 0 deletions mock-cli/test-shopify/.databao/test_questions.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
question,gold_sql,mf_query,metric,formula
What is the refund rate by month?,,"mf query --metrics refund_rate --group-by metric_time__month",refund_rate,COUNT(*) WHERE financial_status='refunded' / COUNT(*)
1 change: 1 addition & 0 deletions mock-cli/test-shopify/.user.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
id: 7e32390b-2360-4c50-993c-408e4855247f
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.user.yml looks like a per-user/per-install identifier and is likely a generated local artifact. Consider not committing it (and adding it to ignore rules) to avoid sharing identifiers across developers/CI runs.

Suggested change
id: 7e32390b-2360-4c50-993c-408e4855247f
# Local per-user identifier intentionally omitted from source control.

Copilot uses AI. Check for mistakes.
23 changes: 23 additions & 0 deletions mock-cli/test-shopify/models/metrics/orders_metrics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
metrics:
- name: order_count
description: "Total number of orders"
type: simple
type_params:
measure: order_count
label: "Order Count"

- name: refunded_order_count
description: "Number of orders that were refunded"
type: simple
type_params:
measure: refunded_order_count
filter: "{{ Dimension('order__financial_status') }} = 'refunded'"
label: "Refunded Orders"

- name: refund_rate
description: "Share of orders that were refunded"
type: ratio
type_params:
numerator: refunded_order_count
denominator: order_count
label: "Refund Rate"
31 changes: 31 additions & 0 deletions mock-cli/test-shopify/models/semantic_models/orders.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
semantic_models:
- name: orders
description: "Shopify orders with payment and fulfillment status"
model: ref('stg_orders')
defaults:
agg_time_dimension: created_at
entities:
- name: order
type: primary
expr: id
- name: customer
type: foreign
expr: customer_id
dimensions:
- name: created_at
type: time
type_params:
time_granularity: day
- name: financial_status
type: categorical
- name: fulfillment_status
type: categorical
measures:
- name: order_count
description: "Total number of orders"
agg: count
expr: id
- name: refunded_order_count
description: "Number of orders with financial_status = 'refunded'"
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The refunded_order_count measure is described as refunded-only, but it currently counts id without any refund filter; the refund condition is applied later at the metric level. This is misleading and can cause incorrect reuse of the measure—consider either (a) renaming it to a generic count measure and reuse order_count with a metric filter, or (b) updating the measure description/name so it matches its actual semantics.

Suggested change
description: "Number of orders with financial_status = 'refunded'"
description: "Unfiltered count of orders; refunded-only semantics must be applied downstream via a metric-level filter on financial_status = 'refunded'"

Copilot uses AI. Check for mistakes.
agg: count
expr: id
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{{ config(materialized='table') }}

select
cast(range as date) as date_day
from generate_series(
cast('2020-01-01' as date),
cast('2030-01-01' as date),
interval '1 day'
) as t(range)
1 change: 1 addition & 0 deletions mock-cli/test-shopify/models/staging/stg_orders.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select * from {{ source('shopify_analytics', 'orders') }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@


select
cast(range as date) as date_day
from generate_series(
cast('2020-01-01' as date),
cast('2030-01-01' as date),
interval '1 day'
) as t(range)
Comment on lines +1 to +9
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

target/compiled is generated dbt output and is typically excluded from version control. Recommend removing this artifact from the PR and ignoring target/ to avoid churn.

Suggested change
select
cast(range as date) as date_day
from generate_series(
cast('2020-01-01' as date),
cast('2030-01-01' as date),
interval '1 day'
) as t(range)

Copilot uses AI. Check for mistakes.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
select * from "shopify"."main"."orders"
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

target/compiled is generated dbt output and is usually not committed since it is derived from sources and can differ by adapter/config. Recommend removing this file from the PR and ignoring the target/ directory.

Suggested change
select * from "shopify"."main"."orders"

Copilot uses AI. Check for mistakes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@





create table
"shopify"."main"."metricflow_time_spine__dbt_tmp"

as (


select
cast(range as date) as date_day
from generate_series(
cast('2020-01-01' as date),
cast('2030-01-01' as date),
interval '1 day'
) as t(range)
);


Comment on lines +1 to +21
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

target/run is dbt build output and is generally not committed (it is regenerated and environment-specific). Recommend removing this artifact from the PR and ignoring the target/ directory to keep the repo clean and diffs stable.

Suggested change
create table
"shopify"."main"."metricflow_time_spine__dbt_tmp"
as (
select
cast(range as date) as date_day
from generate_series(
cast('2020-01-01' as date),
cast('2030-01-01' as date),
interval '1 day'
) as t(range)
);
-- Generated dbt build artifact removed from version-controlled source.
-- This file under target/run should be regenerated by dbt and not committed.

Copilot uses AI. Check for mistakes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@


create view "shopify"."main"."stg_orders__dbt_tmp" as (
select * from "shopify"."main"."orders"
);
Comment on lines +1 to +5
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

target/run is dbt build output (includes __dbt_tmp objects) and is usually not committed because it is environment-specific and causes noisy diffs. Recommend removing this file from the PR and ignoring mock-cli/test-shopify/target/ (or **/target/) in version control.

Suggested change
create view "shopify"."main"."stg_orders__dbt_tmp" as (
select * from "shopify"."main"."orders"
);

Copilot uses AI. Check for mistakes.