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
11,258 changes: 11,258 additions & 0 deletions wrkplay_dbt/logs/dbt.log

Large diffs are not rendered by default.

67 changes: 67 additions & 0 deletions wrkplay_dbt/logs/dbt.log.legacy
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
2022-07-08 09:53:27.105382 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 09:53:27.106543 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 09:53:27.107559 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 09:53:27.108473 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 09:55:52.891117 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 09:55:52.892852 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 09:55:52.893930 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 09:55:52.894917 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 10:16:42.241476 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 10:16:42.243379 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 14:53:54.063157 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 14:53:54.064566 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 14:53:54.065600 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 14:53:54.066546 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 14:53:54.070844 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 14:53:54.072837 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 15:21:45.703347 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 15:21:45.704749 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 15:21:45.705717 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 15:21:45.706703 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 15:21:45.710621 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 15:21:45.712494 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 15:29:25.939099 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 15:29:25.940634 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 15:29:25.941641 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 15:29:25.942666 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 15:29:25.946548 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 15:29:25.948378 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 15:34:00.353389 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 15:34:00.355076 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 15:34:00.356169 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 15:34:00.357277 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 15:34:00.361413 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 15:34:00.363454 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 16:15:52.209833 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 16:15:52.211015 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 16:15:52.211874 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 16:15:52.212664 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 16:15:52.216853 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 16:15:52.218637 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 16:16:25.785374 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 16:16:25.786477 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 16:16:25.787365 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 16:16:25.791498 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 16:16:25.793234 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 17:05:46.112170 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 17:05:46.113556 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 17:05:46.114460 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 17:05:46.118705 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 17:12:50.276750 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 17:12:50.283153 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 17:12:50.283955 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 17:12:50.287995 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 17:12:50.289766 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 17:12:50.290556 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 17:12:50.291940 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 17:12:50.292749 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-08 17:12:50.294396 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-11 14:43:22.955945 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-11 14:43:22.957221 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-11 14:43:22.958106 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-11 14:43:22.962294 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-11 14:43:22.964100 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-11 14:43:22.964894 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-11 14:43:22.965766 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-11 14:43:22.966542 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
2022-07-11 14:43:22.968253 (MainThread): 'soft_unicode' has been renamed to 'soft_str'. The old name will be removed in MarkupSafe 2.1.
65 changes: 65 additions & 0 deletions wrkplay_dbt/target/catalog.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"metadata": {
"dbt_schema_version": "https://schemas.getdbt.com/dbt/catalog/v1.json",
"dbt_version": "1.1.1",
"generated_at": "2022-07-11T08:45:26.769481Z",
"invocation_id": "e1ecc8fe-243e-49e3-94e1-29d46bb8d9c3",
"env": {}
},
"nodes": {
"model.wrkplay_dbt.number_played_against": {
"metadata": {
"type": "VIEW",
"schema": "public",
"name": "number_played_against",
"database": "postgres",
"comment": null,
"owner": "postgres"
},
"columns": {
"player_id": { "type": "text", "index": 1, "name": "player_id", "comment": null },
"season_id": { "type": "text", "index": 2, "name": "season_id", "comment": null },
"num_played_against": { "type": "bigint", "index": 3, "name": "num_played_against", "comment": null }
},
"stats": {
"has_stats": {
"id": "has_stats",
"label": "Has Stats?",
"value": false,
"include": false,
"description": "Indicates whether there are statistics for this table"
}
},
"unique_id": "model.wrkplay_dbt.number_played_against"
},
"model.wrkplay_dbt.wins_losses": {
"metadata": {
"type": "VIEW",
"schema": "public",
"name": "wins_losses",
"database": "postgres",
"comment": null,
"owner": "postgres"
},
"columns": {
"player_id": { "type": "text", "index": 1, "name": "player_id", "comment": null },
"gameid": { "type": "text", "index": 2, "name": "gameid", "comment": null },
"seasonid": { "type": "text", "index": 3, "name": "seasonid", "comment": null },
"total_wins": { "type": "numeric", "index": 4, "name": "total_wins", "comment": null },
"total_losses": { "type": "numeric", "index": 5, "name": "total_losses", "comment": null }
},
"stats": {
"has_stats": {
"id": "has_stats",
"label": "Has Stats?",
"value": false,
"include": false,
"description": "Indicates whether there are statistics for this table"
}
},
"unique_id": "model.wrkplay_dbt.wins_losses"
}
},
"sources": {},
"errors": null
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
Welcome to your first dbt model!
Did you know that you can also configure models directly within SQL files?
This will override configurations stated in dbt_project.yml

Try changing "table" to "view" below
*/



with source_data as (

select 1 as id
union all
select null as id

)

select *
from source_data

/*
Uncomment the line below to remove records with null `id` values
*/

where id is not null
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- Use the `ref` function to select from other models

select *
from "postgres"."public"."my_first_dbt_model"
where id = 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@






select id
from "postgres"."public"."my_first_dbt_model"
where id is null


Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@






select id
from "postgres"."public"."my_second_dbt_model"
where id is null


Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@




select
id as unique_field,
count(*) as n_records

from "postgres"."public"."my_first_dbt_model"
where id is not null
group by id
having count(*) > 1


Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@




select
id as unique_field,
count(*) as n_records

from "postgres"."public"."my_second_dbt_model"
where id is not null
group by id
having count(*) > 1


Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
-- gets the number of players a player has played against or with per season
SELECT
c."b1" AS "player_id"
, c."season_id" AS "season_id"
, count(DISTINCT c."b2") AS "num_played_against"
FROM
(
WITH all_players AS (
SELECT
l."A" AS "match_id"
, l."B" AS "player_id"
, s.slug AS "season_id"
FROM
"_left" l
JOIN "Match" m ON l."A" = m.id
JOIN "Season" s ON m.seasonid = s.id
UNION ALL
SELECT
r."A" AS "r_A"
, r."B" AS "r_B"
, s.slug AS "r_season_id"
FROM
"_right" r
JOIN "Match" m ON r."A" = m.id
JOIN "Season" s ON m.seasonid = s.id
)
SELECT
a1."player_id" AS "b1"
, a2."player_id" AS "b2"
, a1."season_id" AS "season_id"
FROM
all_players a1
JOIN all_players a2 ON
a1."match_id" = a2."match_id"
) c
WHERE
c."b1" <> c."b2"
GROUP BY
c."b1"
, c."season_id"
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@






select num_played_against
from "postgres"."public"."number_played_against"
where num_played_against is null


Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@






select player_id
from "postgres"."public"."number_played_against"
where player_id is null


Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@






select season_id
from "postgres"."public"."number_played_against"
where season_id is null


Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@






select gameid
from "postgres"."public"."wins_losses"
where gameid is null


Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@






select player_id
from "postgres"."public"."wins_losses"
where player_id is null


Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@






select seasonid
from "postgres"."public"."wins_losses"
where seasonid is null


Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@


with validation as (

select
num_played_against as positive

from "postgres"."public"."number_played_against"

),

validation_errors as (

select
positive

from validation
-- if this is true, then positive is actually negative!
where positive < 0

)

select *
from validation_errors

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@


with validation as (

select
total_losses as positive

from "postgres"."public"."wins_losses"

),

validation_errors as (

select
positive

from validation
-- if this is true, then positive is actually negative!
where positive < 0

)

select *
from validation_errors

Loading