Skip to content

Commit

Permalink
fix: configure upsert to models (#2574)
Browse files Browse the repository at this point in the history
  • Loading branch information
Datayama38 authored Sep 5, 2024
1 parent d652387 commit 2c81353
Show file tree
Hide file tree
Showing 23 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion dbt/models/observatoire/carpool_by_day.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(materialized='incremental') }}
{{ config(materialized='incremental',unique_key=['from', 'to', 'start_date']) }}

WITH com_evol AS (
SELECT * FROM {{ source('geo','com_evolution') }} WHERE year >= 2020
Expand Down
2 changes: 1 addition & 1 deletion dbt/models/observatoire/carpool_incentive_by_day.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(materialized='incremental') }}
{{ config(materialized='incremental',unique_key=['from', 'to', 'start_date']) }}

SELECT
coalesce(
Expand Down
2 changes: 1 addition & 1 deletion dbt/models/observatoire/carpool_newcomer_by_day.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(materialized='incremental') }}
{{ config(materialized='incremental',unique_key=['from', 'to', 'start_date']) }}

SELECT
coalesce(
Expand Down
2 changes: 1 addition & 1 deletion dbt/models/observatoire/directions_by_day.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(materialized='incremental') }}
{{ config(materialized='incremental',unique_key=['code', 'type', 'direction', 'start_date']) }}
with directions as (
select
"from" as code,
Expand Down
2 changes: 1 addition & 1 deletion dbt/models/observatoire/directions_incentive_by_day.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(materialized='incremental') }}
{{ config(materialized='incremental',unique_key=['code', 'type', 'direction', 'start_date']) }}
with directions as (
select
"from" as code,
Expand Down
2 changes: 1 addition & 1 deletion dbt/models/observatoire/distribution_by_month.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(materialized='incremental') }}
{{ config(materialized='incremental',unique_key=['code', 'type', 'direction', 'year', 'month']) }}

with distances as (
select
Expand Down
2 changes: 1 addition & 1 deletion dbt/models/observatoire/distribution_by_semester.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(materialized='incremental') }}
{{ config(materialized='incremental',unique_key=['code', 'type', 'direction', 'year', 'semester']) }}

with distances as (
select
Expand Down
2 changes: 1 addition & 1 deletion dbt/models/observatoire/distribution_by_trimester.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(materialized='incremental') }}
{{ config(materialized='incremental',unique_key=['code', 'type', 'direction', 'year', 'trimester']) }}

with distances as (
select
Expand Down
2 changes: 1 addition & 1 deletion dbt/models/observatoire/distribution_by_year.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(materialized='incremental') }}
{{ config(materialized='incremental',unique_key=['code', 'type', 'direction', 'year']) }}

with distances as (
select
Expand Down
2 changes: 1 addition & 1 deletion dbt/models/observatoire/distribution_distances_by_day.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(materialized='incremental') }}
{{ config(materialized='incremental',unique_key=['code', 'type', 'direction', 'start_date']) }}
with directions as (
select
start as code,
Expand Down
2 changes: 1 addition & 1 deletion dbt/models/observatoire/distribution_hours_by_day.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(materialized='incremental') }}
{{ config(materialized='incremental',unique_key=['code', 'type', 'direction', 'start_date']) }}
with directions as (
select
start as code,
Expand Down
2 changes: 1 addition & 1 deletion dbt/models/observatoire/flux_by_month.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(materialized='incremental') }}
{{ config(materialized='incremental',unique_key=['type','year', 'month', 'territory_1', 'territory_2']) }}

WITH flux AS (
SELECT
Expand Down
2 changes: 1 addition & 1 deletion dbt/models/observatoire/flux_by_semester.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(materialized='incremental') }}
{{ config(materialized='incremental',unique_key=['type','year', 'semester', 'territory_1', 'territory_2']) }}

WITH flux AS (
SELECT
Expand Down
2 changes: 1 addition & 1 deletion dbt/models/observatoire/flux_by_trimester.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(materialized='incremental') }}
{{ config(materialized='incremental',unique_key=['type','year', 'trimester', 'territory_1', 'territory_2']) }}

WITH flux AS (
SELECT
Expand Down
2 changes: 1 addition & 1 deletion dbt/models/observatoire/flux_by_year.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(materialized='incremental') }}
{{ config(materialized='incremental',unique_key=['type','year', 'territory_1', 'territory_2']) }}

WITH flux AS (
SELECT
Expand Down
2 changes: 1 addition & 1 deletion dbt/models/observatoire/incentive_by_month.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(materialized='incremental') }}
{{ config(materialized='incremental',unique_key=['code', 'type', 'direction', 'year', 'month']) }}

SELECT
extract('year' FROM start_date)::int AS year,
Expand Down
2 changes: 1 addition & 1 deletion dbt/models/observatoire/incentive_by_semester.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(materialized='incremental') }}
{{ config(materialized='incremental',unique_key=['code', 'type', 'direction', 'year', 'semester']) }}

SELECT
extract('year' FROM start_date)::int AS year,
Expand Down
2 changes: 1 addition & 1 deletion dbt/models/observatoire/incentive_by_trimester.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(materialized='incremental') }}
{{ config(materialized='incremental',unique_key=['code', 'type', 'direction', 'year', 'trimester']) }}

SELECT
extract('year' FROM start_date)::int AS year,
Expand Down
2 changes: 1 addition & 1 deletion dbt/models/observatoire/incentive_by_year.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(materialized='incremental') }}
{{ config(materialized='incremental',unique_key=['code', 'type', 'direction', 'year']) }}

SELECT
extract('year' FROM start_date)::int AS year,
Expand Down
2 changes: 1 addition & 1 deletion dbt/models/observatoire/occupation_by_month.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(materialized='incremental') }}
{{ config(materialized='incremental',unique_key=['code', 'type', 'direction', 'year', 'month'])}}
WITH sum_distance AS (
SELECT
code,
Expand Down
2 changes: 1 addition & 1 deletion dbt/models/observatoire/occupation_by_semester.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(materialized='incremental') }}
{{ config(materialized='incremental',unique_key=['code', 'type', 'direction', 'year', 'semester']) }}
WITH sum_distance AS (
SELECT
code,
Expand Down
2 changes: 1 addition & 1 deletion dbt/models/observatoire/occupation_by_trimester.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(materialized='incremental') }}
{{ config(materialized='incremental',unique_key=['code', 'type', 'direction', 'year', 'trimester']) }}
WITH sum_distance AS (
SELECT
code,
Expand Down
2 changes: 1 addition & 1 deletion dbt/models/observatoire/occupation_by_year.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ config(materialized='incremental') }}
{{ config(materialized='incremental',unique_key=['code', 'type', 'direction', 'year']) }}
WITH sum_distance AS (
SELECT
code,
Expand Down

0 comments on commit 2c81353

Please sign in to comment.