From 822ea3194e8c1562b0ee06210c5df3c4dd4727df Mon Sep 17 00:00:00 2001 From: Bruno Campos Date: Tue, 26 Jul 2022 22:51:13 +0100 Subject: [PATCH] build: dbt set up in dev --- wrkplay_dbt/logs/dbt.log | 11258 ++++++++++++++++ wrkplay_dbt/logs/dbt.log.legacy | 67 + wrkplay_dbt/target/catalog.json | 65 + .../models/example/my_first_dbt_model.sql | 26 + .../models/example/my_second_dbt_model.sql | 5 + .../not_null_my_first_dbt_model_id.sql | 11 + .../not_null_my_second_dbt_model_id.sql | 11 + .../unique_my_first_dbt_model_id.sql | 14 + .../unique_my_second_dbt_model_id.sql | 14 + .../models/marts/number_played_against.sql | 40 + ...mber_played_against_num_played_against.sql | 11 + ...t_null_number_played_against_player_id.sql | 11 + ...t_null_number_played_against_season_id.sql | 11 + .../not_null_wins_losses_gameid.sql | 11 + .../not_null_wins_losses_player_id.sql | 11 + .../not_null_wins_losses_seasonid.sql | 11 + ...mber_played_against_num_played_against.sql | 25 + ...positive_test_wins_losses_total_losses.sql | 25 + .../positive_test_wins_losses_total_wins.sql | 25 + .../wrkplay_dbt/models/marts/wins_losses.sql | 195 + .../models/number_played_against.sql | 40 + ...mber_played_against_num_played_against.sql | 11 + ...t_null_number_played_against_player_id.sql | 11 + ...t_null_number_played_against_season_id.sql | 11 + .../not_null_wins_losses_gameid.sql | 11 + .../not_null_wins_losses_player_id.sql | 11 + .../not_null_wins_losses_seasonid.sql | 11 + ...mber_played_against_num_played_against.sql | 25 + ...positive_test_wins_losses_total_losses.sql | 25 + .../positive_test_wins_losses_total_wins.sql | 25 + .../unique_wins_losses_seasonid.sql | 14 + .../wrkplay_dbt/models/wins_losses.sql | 195 + wrkplay_dbt/target/graph.gpickle | Bin 0 -> 16031 bytes wrkplay_dbt/target/index.html | 102 + wrkplay_dbt/target/manifest.json | 3959 ++++++ wrkplay_dbt/target/partial_parse.msgpack | Bin 0 -> 216010 bytes .../models/example/my_first_dbt_model.sql | 29 + .../models/example/my_second_dbt_model.sql | 8 + .../not_null_my_first_dbt_model_id.sql | 19 + .../not_null_my_second_dbt_model_id.sql | 19 + .../unique_my_first_dbt_model_id.sql | 22 + .../unique_my_second_dbt_model_id.sql | 22 + .../models/marts/number_played_against.sql | 43 + ...mber_played_against_num_played_against.sql | 19 + ...t_null_number_played_against_player_id.sql | 19 + ...t_null_number_played_against_season_id.sql | 19 + .../not_null_wins_losses_gameid.sql | 19 + .../not_null_wins_losses_player_id.sql | 19 + .../not_null_wins_losses_seasonid.sql | 19 + ...mber_played_against_num_played_against.sql | 33 + ...positive_test_wins_losses_total_losses.sql | 33 + .../positive_test_wins_losses_total_wins.sql | 33 + .../wrkplay_dbt/models/marts/wins_losses.sql | 198 + .../models/number_played_against.sql | 43 + ...mber_played_against_num_played_against.sql | 19 + ...t_null_number_played_against_player_id.sql | 19 + ...t_null_number_played_against_season_id.sql | 19 + .../not_null_wins_losses_gameid.sql | 19 + .../not_null_wins_losses_player_id.sql | 19 + .../not_null_wins_losses_seasonid.sql | 19 + ...mber_played_against_num_played_against.sql | 33 + ...positive_test_wins_losses_total_losses.sql | 33 + .../positive_test_wins_losses_total_wins.sql | 33 + .../unique_wins_losses_seasonid.sql | 22 + .../run/wrkplay_dbt/models/wins_losses.sql | 198 + wrkplay_dbt/target/run_results.json | 217 + 66 files changed, 17564 insertions(+) create mode 100644 wrkplay_dbt/logs/dbt.log create mode 100644 wrkplay_dbt/logs/dbt.log.legacy create mode 100644 wrkplay_dbt/target/catalog.json create mode 100644 wrkplay_dbt/target/compiled/wrkplay_dbt/models/example/my_first_dbt_model.sql create mode 100644 wrkplay_dbt/target/compiled/wrkplay_dbt/models/example/my_second_dbt_model.sql create mode 100644 wrkplay_dbt/target/compiled/wrkplay_dbt/models/example/schema.yml/not_null_my_first_dbt_model_id.sql create mode 100644 wrkplay_dbt/target/compiled/wrkplay_dbt/models/example/schema.yml/not_null_my_second_dbt_model_id.sql create mode 100644 wrkplay_dbt/target/compiled/wrkplay_dbt/models/example/schema.yml/unique_my_first_dbt_model_id.sql create mode 100644 wrkplay_dbt/target/compiled/wrkplay_dbt/models/example/schema.yml/unique_my_second_dbt_model_id.sql create mode 100644 wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/number_played_against.sql create mode 100644 wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/not_null_number_played_against_num_played_against.sql create mode 100644 wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/not_null_number_played_against_player_id.sql create mode 100644 wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/not_null_number_played_against_season_id.sql create mode 100644 wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/not_null_wins_losses_gameid.sql create mode 100644 wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/not_null_wins_losses_player_id.sql create mode 100644 wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/not_null_wins_losses_seasonid.sql create mode 100644 wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/positive_test_number_played_against_num_played_against.sql create mode 100644 wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/positive_test_wins_losses_total_losses.sql create mode 100644 wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/positive_test_wins_losses_total_wins.sql create mode 100644 wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/wins_losses.sql create mode 100644 wrkplay_dbt/target/compiled/wrkplay_dbt/models/number_played_against.sql create mode 100644 wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/not_null_number_played_against_num_played_against.sql create mode 100644 wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/not_null_number_played_against_player_id.sql create mode 100644 wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/not_null_number_played_against_season_id.sql create mode 100644 wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/not_null_wins_losses_gameid.sql create mode 100644 wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/not_null_wins_losses_player_id.sql create mode 100644 wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/not_null_wins_losses_seasonid.sql create mode 100644 wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/positive_test_number_played_against_num_played_against.sql create mode 100644 wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/positive_test_wins_losses_total_losses.sql create mode 100644 wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/positive_test_wins_losses_total_wins.sql create mode 100644 wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/unique_wins_losses_seasonid.sql create mode 100644 wrkplay_dbt/target/compiled/wrkplay_dbt/models/wins_losses.sql create mode 100644 wrkplay_dbt/target/graph.gpickle create mode 100644 wrkplay_dbt/target/index.html create mode 100644 wrkplay_dbt/target/manifest.json create mode 100644 wrkplay_dbt/target/partial_parse.msgpack create mode 100644 wrkplay_dbt/target/run/wrkplay_dbt/models/example/my_first_dbt_model.sql create mode 100644 wrkplay_dbt/target/run/wrkplay_dbt/models/example/my_second_dbt_model.sql create mode 100644 wrkplay_dbt/target/run/wrkplay_dbt/models/example/schema.yml/not_null_my_first_dbt_model_id.sql create mode 100644 wrkplay_dbt/target/run/wrkplay_dbt/models/example/schema.yml/not_null_my_second_dbt_model_id.sql create mode 100644 wrkplay_dbt/target/run/wrkplay_dbt/models/example/schema.yml/unique_my_first_dbt_model_id.sql create mode 100644 wrkplay_dbt/target/run/wrkplay_dbt/models/example/schema.yml/unique_my_second_dbt_model_id.sql create mode 100644 wrkplay_dbt/target/run/wrkplay_dbt/models/marts/number_played_against.sql create mode 100644 wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/not_null_number_played_against_num_played_against.sql create mode 100644 wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/not_null_number_played_against_player_id.sql create mode 100644 wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/not_null_number_played_against_season_id.sql create mode 100644 wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/not_null_wins_losses_gameid.sql create mode 100644 wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/not_null_wins_losses_player_id.sql create mode 100644 wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/not_null_wins_losses_seasonid.sql create mode 100644 wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/positive_test_number_played_against_num_played_against.sql create mode 100644 wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/positive_test_wins_losses_total_losses.sql create mode 100644 wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/positive_test_wins_losses_total_wins.sql create mode 100644 wrkplay_dbt/target/run/wrkplay_dbt/models/marts/wins_losses.sql create mode 100644 wrkplay_dbt/target/run/wrkplay_dbt/models/number_played_against.sql create mode 100644 wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/not_null_number_played_against_num_played_against.sql create mode 100644 wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/not_null_number_played_against_player_id.sql create mode 100644 wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/not_null_number_played_against_season_id.sql create mode 100644 wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/not_null_wins_losses_gameid.sql create mode 100644 wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/not_null_wins_losses_player_id.sql create mode 100644 wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/not_null_wins_losses_seasonid.sql create mode 100644 wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/positive_test_number_played_against_num_played_against.sql create mode 100644 wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/positive_test_wins_losses_total_losses.sql create mode 100644 wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/positive_test_wins_losses_total_wins.sql create mode 100644 wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/unique_wins_losses_seasonid.sql create mode 100644 wrkplay_dbt/target/run/wrkplay_dbt/models/wins_losses.sql create mode 100644 wrkplay_dbt/target/run_results.json diff --git a/wrkplay_dbt/logs/dbt.log b/wrkplay_dbt/logs/dbt.log new file mode 100644 index 0000000..342ab21 --- /dev/null +++ b/wrkplay_dbt/logs/dbt.log @@ -0,0 +1,11258 @@ + + +============================== 2022-07-08 09:53:26.835672 | 1ad2e30b-6041-41e5-808b-fb1e7e48e072 ============================== +09:53:26.835721 [info ] [MainThread]: Running with dbt=1.1.1 +09:53:26.836167 [debug] [MainThread]: running dbt with arguments {'write_json': True, 'use_colors': True, 'printer_width': 80, 'version_check': True, 'partial_parse': True, 'static_parser': True, 'profiles_dir': '/Users/bruno.campos/.dbt', 'send_anonymous_usage_stats': True, 'event_buffer_size': 100000, 'quiet': False, 'no_print': False, 'which': 'run', 'rpc_method': 'run', 'indirect_selection': 'eager'} +09:53:26.836269 [debug] [MainThread]: Tracking: tracking +09:53:26.854662 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [, , ]} +09:53:26.861342 [info ] [MainThread]: Partial parse save file not found. Starting full parse. +09:53:26.861502 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'partial_parser', 'label': '1ad2e30b-6041-41e5-808b-fb1e7e48e072', 'context': []} +09:53:26.869312 [debug] [MainThread]: Parsing macros/catalog.sql +09:53:26.871706 [debug] [MainThread]: Parsing macros/relations.sql +09:53:26.872420 [debug] [MainThread]: Parsing macros/adapters.sql +09:53:26.883484 [debug] [MainThread]: Parsing macros/materializations/snapshot_merge.sql +09:53:26.884360 [debug] [MainThread]: Parsing macros/materializations/hooks.sql +09:53:26.886238 [debug] [MainThread]: Parsing macros/materializations/configs.sql +09:53:26.887379 [debug] [MainThread]: Parsing macros/materializations/snapshots/snapshot_merge.sql +09:53:26.888153 [debug] [MainThread]: Parsing macros/materializations/snapshots/strategies.sql +09:53:26.896442 [debug] [MainThread]: Parsing macros/materializations/snapshots/helpers.sql +09:53:26.902999 [debug] [MainThread]: Parsing macros/materializations/snapshots/snapshot.sql +09:53:26.908480 [debug] [MainThread]: Parsing macros/materializations/tests/test.sql +09:53:26.910557 [debug] [MainThread]: Parsing macros/materializations/tests/helpers.sql +09:53:26.911366 [debug] [MainThread]: Parsing macros/materializations/tests/where_subquery.sql +09:53:26.912167 [debug] [MainThread]: Parsing macros/materializations/models/incremental/column_helpers.sql +09:53:26.914175 [debug] [MainThread]: Parsing macros/materializations/models/incremental/merge.sql +09:53:26.922512 [debug] [MainThread]: Parsing macros/materializations/models/incremental/is_incremental.sql +09:53:26.923197 [debug] [MainThread]: Parsing macros/materializations/models/incremental/incremental.sql +09:53:26.928001 [debug] [MainThread]: Parsing macros/materializations/models/incremental/on_schema_change.sql +09:53:26.935611 [debug] [MainThread]: Parsing macros/materializations/models/table/table.sql +09:53:26.939333 [debug] [MainThread]: Parsing macros/materializations/models/table/create_table_as.sql +09:53:26.940617 [debug] [MainThread]: Parsing macros/materializations/models/view/view.sql +09:53:26.944421 [debug] [MainThread]: Parsing macros/materializations/models/view/helpers.sql +09:53:26.945011 [debug] [MainThread]: Parsing macros/materializations/models/view/create_or_replace_view.sql +09:53:26.946245 [debug] [MainThread]: Parsing macros/materializations/models/view/create_view_as.sql +09:53:26.947255 [debug] [MainThread]: Parsing macros/materializations/seeds/seed.sql +09:53:26.950097 [debug] [MainThread]: Parsing macros/materializations/seeds/helpers.sql +09:53:26.958225 [debug] [MainThread]: Parsing macros/get_custom_name/get_custom_alias.sql +09:53:26.958901 [debug] [MainThread]: Parsing macros/get_custom_name/get_custom_schema.sql +09:53:26.960011 [debug] [MainThread]: Parsing macros/get_custom_name/get_custom_database.sql +09:53:26.960705 [debug] [MainThread]: Parsing macros/generic_test_sql/relationships.sql +09:53:26.961115 [debug] [MainThread]: Parsing macros/generic_test_sql/not_null.sql +09:53:26.961464 [debug] [MainThread]: Parsing macros/generic_test_sql/unique.sql +09:53:26.961761 [debug] [MainThread]: Parsing macros/generic_test_sql/accepted_values.sql +09:53:26.962367 [debug] [MainThread]: Parsing macros/etc/statement.sql +09:53:26.964387 [debug] [MainThread]: Parsing macros/etc/datetime.sql +09:53:26.968364 [debug] [MainThread]: Parsing macros/adapters/schema.sql +09:53:26.969315 [debug] [MainThread]: Parsing macros/adapters/indexes.sql +09:53:26.970511 [debug] [MainThread]: Parsing macros/adapters/relation.sql +09:53:26.974940 [debug] [MainThread]: Parsing macros/adapters/freshness.sql +09:53:26.976237 [debug] [MainThread]: Parsing macros/adapters/persist_docs.sql +09:53:26.978222 [debug] [MainThread]: Parsing macros/adapters/metadata.sql +09:53:26.981586 [debug] [MainThread]: Parsing macros/adapters/columns.sql +09:53:26.986111 [debug] [MainThread]: Parsing tests/generic/builtin.sql +09:53:27.067708 [debug] [MainThread]: 1699: static parser successfully parsed example/my_first_dbt_model.sql +09:53:27.073203 [debug] [MainThread]: 1699: static parser successfully parsed example/my_second_dbt_model.sql +09:53:27.115113 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '1ad2e30b-6041-41e5-808b-fb1e7e48e072', 'context': []} +09:53:27.117311 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '1ad2e30b-6041-41e5-808b-fb1e7e48e072', 'context': []} +09:53:27.117450 [info ] [MainThread]: Found 2 models, 4 tests, 0 snapshots, 0 analyses, 167 macros, 0 operations, 0 seed files, 0 sources, 0 exposures, 0 metrics +09:53:27.117567 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '1ad2e30b-6041-41e5-808b-fb1e7e48e072', 'context': []} +09:53:27.118079 [info ] [MainThread]: +09:53:27.118275 [debug] [MainThread]: Acquiring new postgres connection "master" +09:53:27.118622 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres" +09:53:27.123078 [debug] [ThreadPool]: Using postgres connection "list_postgres" +09:53:27.123155 [debug] [ThreadPool]: On list_postgres: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres"} */ + + select distinct nspname from pg_namespace + +09:53:27.123211 [debug] [ThreadPool]: Opening a new connection, currently in state init +09:53:27.809316 [debug] [ThreadPool]: Postgres adapter: Got an error when attempting to open a postgres connection: 'connection to server at "db.worshmnogctpuqtpvnss.supabase.co" (13.40.162.131), port 5432 failed: FATAL: password authentication failed for user "postgres" +connection to server at "db.worshmnogctpuqtpvnss.supabase.co" (13.40.162.131), port 5432 failed: FATAL: password authentication failed for user "postgres" +' +09:53:27.810386 [debug] [ThreadPool]: Postgres adapter: Error running SQL: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres"} */ + + select distinct nspname from pg_namespace + +09:53:27.810723 [debug] [ThreadPool]: Postgres adapter: Rolling back transaction. +09:53:27.811205 [debug] [ThreadPool]: Postgres adapter: Error running SQL: macro list_schemas +09:53:27.811523 [debug] [ThreadPool]: Postgres adapter: Rolling back transaction. +09:53:27.811905 [debug] [ThreadPool]: On list_postgres: No close available on handle +09:53:27.813826 [debug] [MainThread]: Connection 'master' was properly closed. +09:53:27.814274 [debug] [MainThread]: Connection 'list_postgres' was properly closed. +09:53:27.814922 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [, , ]} + + +============================== 2022-07-08 09:55:52.615289 | 05c6a72c-0a96-403b-a282-f2f5b0f18e0a ============================== +09:55:52.615304 [info ] [MainThread]: Running with dbt=1.1.1 +09:55:52.615996 [debug] [MainThread]: running dbt with arguments {'write_json': True, 'use_colors': True, 'printer_width': 80, 'version_check': True, 'partial_parse': True, 'static_parser': True, 'profiles_dir': '/Users/bruno.campos/.dbt', 'send_anonymous_usage_stats': True, 'event_buffer_size': 100000, 'quiet': False, 'no_print': False, 'which': 'run', 'rpc_method': 'run', 'indirect_selection': 'eager'} +09:55:52.616086 [debug] [MainThread]: Tracking: tracking +09:55:52.632234 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [, , ]} +09:55:52.642102 [info ] [MainThread]: Unable to do partial parsing because profile has changed +09:55:52.642275 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'partial_parser', 'label': '05c6a72c-0a96-403b-a282-f2f5b0f18e0a', 'context': []} +09:55:52.650864 [debug] [MainThread]: Parsing macros/catalog.sql +09:55:52.652584 [debug] [MainThread]: Parsing macros/relations.sql +09:55:52.653271 [debug] [MainThread]: Parsing macros/adapters.sql +09:55:52.664540 [debug] [MainThread]: Parsing macros/materializations/snapshot_merge.sql +09:55:52.665480 [debug] [MainThread]: Parsing macros/materializations/hooks.sql +09:55:52.667345 [debug] [MainThread]: Parsing macros/materializations/configs.sql +09:55:52.668507 [debug] [MainThread]: Parsing macros/materializations/snapshots/snapshot_merge.sql +09:55:52.669343 [debug] [MainThread]: Parsing macros/materializations/snapshots/strategies.sql +09:55:52.677529 [debug] [MainThread]: Parsing macros/materializations/snapshots/helpers.sql +09:55:52.684087 [debug] [MainThread]: Parsing macros/materializations/snapshots/snapshot.sql +09:55:52.689549 [debug] [MainThread]: Parsing macros/materializations/tests/test.sql +09:55:52.691622 [debug] [MainThread]: Parsing macros/materializations/tests/helpers.sql +09:55:52.692433 [debug] [MainThread]: Parsing macros/materializations/tests/where_subquery.sql +09:55:52.693244 [debug] [MainThread]: Parsing macros/materializations/models/incremental/column_helpers.sql +09:55:52.695251 [debug] [MainThread]: Parsing macros/materializations/models/incremental/merge.sql +09:55:52.703458 [debug] [MainThread]: Parsing macros/materializations/models/incremental/is_incremental.sql +09:55:52.704131 [debug] [MainThread]: Parsing macros/materializations/models/incremental/incremental.sql +09:55:52.708981 [debug] [MainThread]: Parsing macros/materializations/models/incremental/on_schema_change.sql +09:55:52.716564 [debug] [MainThread]: Parsing macros/materializations/models/table/table.sql +09:55:52.720276 [debug] [MainThread]: Parsing macros/materializations/models/table/create_table_as.sql +09:55:52.721570 [debug] [MainThread]: Parsing macros/materializations/models/view/view.sql +09:55:52.725133 [debug] [MainThread]: Parsing macros/materializations/models/view/helpers.sql +09:55:52.725701 [debug] [MainThread]: Parsing macros/materializations/models/view/create_or_replace_view.sql +09:55:52.726936 [debug] [MainThread]: Parsing macros/materializations/models/view/create_view_as.sql +09:55:52.727946 [debug] [MainThread]: Parsing macros/materializations/seeds/seed.sql +09:55:52.730768 [debug] [MainThread]: Parsing macros/materializations/seeds/helpers.sql +09:55:52.738819 [debug] [MainThread]: Parsing macros/get_custom_name/get_custom_alias.sql +09:55:52.739478 [debug] [MainThread]: Parsing macros/get_custom_name/get_custom_schema.sql +09:55:52.740595 [debug] [MainThread]: Parsing macros/get_custom_name/get_custom_database.sql +09:55:52.741302 [debug] [MainThread]: Parsing macros/generic_test_sql/relationships.sql +09:55:52.741707 [debug] [MainThread]: Parsing macros/generic_test_sql/not_null.sql +09:55:52.742084 [debug] [MainThread]: Parsing macros/generic_test_sql/unique.sql +09:55:52.742383 [debug] [MainThread]: Parsing macros/generic_test_sql/accepted_values.sql +09:55:52.742999 [debug] [MainThread]: Parsing macros/etc/statement.sql +09:55:52.745006 [debug] [MainThread]: Parsing macros/etc/datetime.sql +09:55:52.749006 [debug] [MainThread]: Parsing macros/adapters/schema.sql +09:55:52.749955 [debug] [MainThread]: Parsing macros/adapters/indexes.sql +09:55:52.751155 [debug] [MainThread]: Parsing macros/adapters/relation.sql +09:55:52.755578 [debug] [MainThread]: Parsing macros/adapters/freshness.sql +09:55:52.756871 [debug] [MainThread]: Parsing macros/adapters/persist_docs.sql +09:55:52.758872 [debug] [MainThread]: Parsing macros/adapters/metadata.sql +09:55:52.762232 [debug] [MainThread]: Parsing macros/adapters/columns.sql +09:55:52.766754 [debug] [MainThread]: Parsing tests/generic/builtin.sql +09:55:52.850703 [debug] [MainThread]: 1699: static parser successfully parsed example/my_first_dbt_model.sql +09:55:52.856358 [debug] [MainThread]: 1699: static parser successfully parsed example/my_second_dbt_model.sql +09:55:52.903108 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '05c6a72c-0a96-403b-a282-f2f5b0f18e0a', 'context': []} +09:55:52.905606 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '05c6a72c-0a96-403b-a282-f2f5b0f18e0a', 'context': []} +09:55:52.905731 [info ] [MainThread]: Found 2 models, 4 tests, 0 snapshots, 0 analyses, 167 macros, 0 operations, 0 seed files, 0 sources, 0 exposures, 0 metrics +09:55:52.905849 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '05c6a72c-0a96-403b-a282-f2f5b0f18e0a', 'context': []} +09:55:52.906373 [info ] [MainThread]: +09:55:52.906563 [debug] [MainThread]: Acquiring new postgres connection "master" +09:55:52.906890 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres" +09:55:52.911176 [debug] [ThreadPool]: Using postgres connection "list_postgres" +09:55:52.911255 [debug] [ThreadPool]: On list_postgres: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres"} */ + + select distinct nspname from pg_namespace + +09:55:52.911310 [debug] [ThreadPool]: Opening a new connection, currently in state init +09:55:53.410837 [debug] [ThreadPool]: SQL status: SELECT 10 in 0.5 seconds +09:55:53.414400 [debug] [ThreadPool]: On list_postgres: Close +09:55:53.415588 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres_public" +09:55:53.418745 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +09:55:53.418850 [debug] [ThreadPool]: On list_postgres_public: BEGIN +09:55:53.418910 [debug] [ThreadPool]: Opening a new connection, currently in state closed +09:55:53.758647 [debug] [ThreadPool]: SQL status: BEGIN in 0.34 seconds +09:55:53.759552 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +09:55:53.759761 [debug] [ThreadPool]: On list_postgres_public: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres_public"} */ +select + 'postgres' as database, + tablename as name, + schemaname as schema, + 'table' as type + from pg_tables + where schemaname ilike 'public' + union all + select + 'postgres' as database, + viewname as name, + schemaname as schema, + 'view' as type + from pg_views + where schemaname ilike 'public' + +09:55:53.785826 [debug] [ThreadPool]: SQL status: SELECT 16 in 0.03 seconds +09:55:53.789915 [debug] [ThreadPool]: On list_postgres_public: ROLLBACK +09:55:53.833972 [debug] [ThreadPool]: On list_postgres_public: Close +09:55:53.837874 [debug] [MainThread]: Using postgres connection "master" +09:55:53.838027 [debug] [MainThread]: On master: BEGIN +09:55:53.838091 [debug] [MainThread]: Opening a new connection, currently in state init +09:55:54.191274 [debug] [MainThread]: SQL status: BEGIN in 0.35 seconds +09:55:54.194462 [debug] [MainThread]: Using postgres connection "master" +09:55:54.194881 [debug] [MainThread]: On master: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "master"} */ +with relation as ( + select + pg_rewrite.ev_class as class, + pg_rewrite.oid as id + from pg_rewrite + ), + class as ( + select + oid as id, + relname as name, + relnamespace as schema, + relkind as kind + from pg_class + ), + dependency as ( + select distinct + pg_depend.objid as id, + pg_depend.refobjid as ref + from pg_depend + ), + schema as ( + select + pg_namespace.oid as id, + pg_namespace.nspname as name + from pg_namespace + where nspname != 'information_schema' and nspname not like 'pg\_%' + ), + referenced as ( + select + relation.id AS id, + referenced_class.name , + referenced_class.schema , + referenced_class.kind + from relation + join class as referenced_class on relation.class=referenced_class.id + where referenced_class.kind in ('r', 'v') + ), + relationships as ( + select + referenced.name as referenced_name, + referenced.schema as referenced_schema_id, + dependent_class.name as dependent_name, + dependent_class.schema as dependent_schema_id, + referenced.kind as kind + from referenced + join dependency on referenced.id=dependency.id + join class as dependent_class on dependency.ref=dependent_class.id + where + (referenced.name != dependent_class.name or + referenced.schema != dependent_class.schema) + ) + + select + referenced_schema.name as referenced_schema, + relationships.referenced_name as referenced_name, + dependent_schema.name as dependent_schema, + relationships.dependent_name as dependent_name + from relationships + join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id + join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id + group by referenced_schema, referenced_name, dependent_schema, dependent_name + order by referenced_schema, referenced_name, dependent_schema, dependent_name; +09:55:54.353893 [debug] [MainThread]: SQL status: SELECT 0 in 0.16 seconds +09:55:54.358157 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '05c6a72c-0a96-403b-a282-f2f5b0f18e0a', 'context': []} +09:55:54.358536 [debug] [MainThread]: On master: ROLLBACK +09:55:54.403621 [debug] [MainThread]: Using postgres connection "master" +09:55:54.404069 [debug] [MainThread]: On master: BEGIN +09:55:54.438375 [debug] [MainThread]: SQL status: BEGIN in 0.03 seconds +09:55:54.438992 [debug] [MainThread]: On master: COMMIT +09:55:54.439336 [debug] [MainThread]: Using postgres connection "master" +09:55:54.439662 [debug] [MainThread]: On master: COMMIT +09:55:54.458755 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +09:55:54.459283 [debug] [MainThread]: On master: Close +09:55:54.460407 [info ] [MainThread]: Concurrency: 10 threads (target='dev') +09:55:54.461078 [info ] [MainThread]: +09:55:54.465649 [debug] [Thread-1 ]: Began running node model.wrkplay_dbt.my_first_dbt_model +09:55:54.465855 [info ] [Thread-1 ]: 1 of 2 START table model public.my_first_dbt_model ............................. [RUN] +09:55:54.466091 [debug] [Thread-1 ]: Acquiring new postgres connection "model.wrkplay_dbt.my_first_dbt_model" +09:55:54.466162 [debug] [Thread-1 ]: Began compiling node model.wrkplay_dbt.my_first_dbt_model +09:55:54.466227 [debug] [Thread-1 ]: Compiling model.wrkplay_dbt.my_first_dbt_model +09:55:54.467418 [debug] [Thread-1 ]: Writing injected SQL for node "model.wrkplay_dbt.my_first_dbt_model" +09:55:54.467809 [debug] [Thread-1 ]: finished collecting timing info +09:55:54.467881 [debug] [Thread-1 ]: Began executing node model.wrkplay_dbt.my_first_dbt_model +09:55:54.480680 [debug] [Thread-1 ]: Writing runtime SQL for node "model.wrkplay_dbt.my_first_dbt_model" +09:55:54.481070 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +09:55:54.481134 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: BEGIN +09:55:54.481188 [debug] [Thread-1 ]: Opening a new connection, currently in state closed +09:55:54.791988 [debug] [Thread-1 ]: SQL status: BEGIN in 0.31 seconds +09:55:54.793354 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +09:55:54.793782 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ + + + create table "postgres"."public"."my_first_dbt_model__dbt_tmp" + as ( + /* + 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 + ); +09:55:54.840742 [debug] [Thread-1 ]: SQL status: SELECT 2 in 0.05 seconds +09:55:54.851114 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +09:55:54.851299 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ +alter table "postgres"."public"."my_first_dbt_model__dbt_tmp" rename to "my_first_dbt_model" +09:55:54.872673 [debug] [Thread-1 ]: SQL status: ALTER TABLE in 0.02 seconds +09:55:54.885111 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: COMMIT +09:55:54.885237 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +09:55:54.885297 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: COMMIT +09:55:54.903946 [debug] [Thread-1 ]: SQL status: COMMIT in 0.02 seconds +09:55:54.909745 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +09:55:54.909853 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ +drop table if exists "postgres"."public"."my_first_dbt_model__dbt_backup" cascade +09:55:54.947749 [debug] [Thread-1 ]: SQL status: DROP TABLE in 0.04 seconds +09:55:54.951502 [debug] [Thread-1 ]: finished collecting timing info +09:55:54.951814 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: Close +09:55:54.952309 [debug] [Thread-1 ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '05c6a72c-0a96-403b-a282-f2f5b0f18e0a', 'context': []} +09:55:54.952564 [info ] [Thread-1 ]: 1 of 2 OK created table model public.my_first_dbt_model ........................ [SELECT 2 in 0.49s] +09:55:54.952833 [debug] [Thread-1 ]: Finished running node model.wrkplay_dbt.my_first_dbt_model +09:55:54.953222 [debug] [Thread-3 ]: Began running node model.wrkplay_dbt.my_second_dbt_model +09:55:54.953507 [info ] [Thread-3 ]: 2 of 2 START view model public.my_second_dbt_model ............................. [RUN] +09:55:54.953761 [debug] [Thread-3 ]: Acquiring new postgres connection "model.wrkplay_dbt.my_second_dbt_model" +09:55:54.953833 [debug] [Thread-3 ]: Began compiling node model.wrkplay_dbt.my_second_dbt_model +09:55:54.953909 [debug] [Thread-3 ]: Compiling model.wrkplay_dbt.my_second_dbt_model +09:55:54.955280 [debug] [Thread-3 ]: Writing injected SQL for node "model.wrkplay_dbt.my_second_dbt_model" +09:55:54.955881 [debug] [Thread-3 ]: finished collecting timing info +09:55:54.955955 [debug] [Thread-3 ]: Began executing node model.wrkplay_dbt.my_second_dbt_model +09:55:54.963762 [debug] [Thread-3 ]: Writing runtime SQL for node "model.wrkplay_dbt.my_second_dbt_model" +09:55:54.963986 [debug] [Thread-3 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +09:55:54.964050 [debug] [Thread-3 ]: On model.wrkplay_dbt.my_second_dbt_model: BEGIN +09:55:54.964103 [debug] [Thread-3 ]: Opening a new connection, currently in state init +09:55:55.398484 [debug] [Thread-3 ]: SQL status: BEGIN in 0.43 seconds +09:55:55.399826 [debug] [Thread-3 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +09:55:55.400206 [debug] [Thread-3 ]: On model.wrkplay_dbt.my_second_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_second_dbt_model"} */ + + create view "postgres"."public"."my_second_dbt_model__dbt_tmp" as ( + -- Use the `ref` function to select from other models + +select * +from "postgres"."public"."my_first_dbt_model" +where id = 1 + ); +09:55:55.424095 [debug] [Thread-3 ]: SQL status: CREATE VIEW in 0.02 seconds +09:55:55.431421 [debug] [Thread-3 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +09:55:55.431614 [debug] [Thread-3 ]: On model.wrkplay_dbt.my_second_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_second_dbt_model"} */ +alter table "postgres"."public"."my_second_dbt_model__dbt_tmp" rename to "my_second_dbt_model" +09:55:55.451779 [debug] [Thread-3 ]: SQL status: ALTER TABLE in 0.02 seconds +09:55:55.457053 [debug] [Thread-3 ]: On model.wrkplay_dbt.my_second_dbt_model: COMMIT +09:55:55.457497 [debug] [Thread-3 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +09:55:55.457684 [debug] [Thread-3 ]: On model.wrkplay_dbt.my_second_dbt_model: COMMIT +09:55:55.478324 [debug] [Thread-3 ]: SQL status: COMMIT in 0.02 seconds +09:55:55.483012 [debug] [Thread-3 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +09:55:55.483115 [debug] [Thread-3 ]: On model.wrkplay_dbt.my_second_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_second_dbt_model"} */ +drop view if exists "postgres"."public"."my_second_dbt_model__dbt_backup" cascade +09:55:55.511355 [debug] [Thread-3 ]: SQL status: DROP VIEW in 0.03 seconds +09:55:55.514301 [debug] [Thread-3 ]: finished collecting timing info +09:55:55.514711 [debug] [Thread-3 ]: On model.wrkplay_dbt.my_second_dbt_model: Close +09:55:55.515528 [debug] [Thread-3 ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '05c6a72c-0a96-403b-a282-f2f5b0f18e0a', 'context': []} +09:55:55.515780 [info ] [Thread-3 ]: 2 of 2 OK created view model public.my_second_dbt_model ........................ [CREATE VIEW in 0.56s] +09:55:55.516032 [debug] [Thread-3 ]: Finished running node model.wrkplay_dbt.my_second_dbt_model +09:55:55.517003 [debug] [MainThread]: Acquiring new postgres connection "master" +09:55:55.517105 [debug] [MainThread]: Using postgres connection "master" +09:55:55.517164 [debug] [MainThread]: On master: BEGIN +09:55:55.517215 [debug] [MainThread]: Opening a new connection, currently in state closed +09:55:55.819962 [debug] [MainThread]: SQL status: BEGIN in 0.3 seconds +09:55:55.821053 [debug] [MainThread]: On master: COMMIT +09:55:55.821471 [debug] [MainThread]: Using postgres connection "master" +09:55:55.821830 [debug] [MainThread]: On master: COMMIT +09:55:55.870419 [debug] [MainThread]: SQL status: COMMIT in 0.05 seconds +09:55:55.870939 [debug] [MainThread]: On master: Close +09:55:55.871894 [info ] [MainThread]: +09:55:55.872267 [info ] [MainThread]: Finished running 1 table model, 1 view model in 2.97s. +09:55:55.872550 [debug] [MainThread]: Connection 'master' was properly closed. +09:55:55.872694 [debug] [MainThread]: Connection 'model.wrkplay_dbt.my_first_dbt_model' was properly closed. +09:55:55.872836 [debug] [MainThread]: Connection 'model.wrkplay_dbt.my_second_dbt_model' was properly closed. +09:55:55.876184 [info ] [MainThread]: +09:55:55.876343 [info ] [MainThread]: Completed successfully +09:55:55.876459 [info ] [MainThread]: +09:55:55.876549 [info ] [MainThread]: Done. PASS=2 WARN=0 ERROR=0 SKIP=0 TOTAL=2 +09:55:55.876687 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [, , ]} + + +============================== 2022-07-08 10:05:47.521631 | e30a08f4-5a1f-42f2-badf-08cd5c59afcf ============================== +10:05:47.521654 [info ] [MainThread]: Running with dbt=1.1.1 +10:05:47.522367 [debug] [MainThread]: running dbt with arguments {'write_json': True, 'use_colors': True, 'printer_width': 80, 'version_check': True, 'partial_parse': True, 'static_parser': True, 'profiles_dir': '/Users/bruno.campos/.dbt', 'send_anonymous_usage_stats': True, 'event_buffer_size': 100000, 'quiet': False, 'no_print': False, 'indirect_selection': 'eager', 'which': 'test', 'rpc_method': 'test'} +10:05:47.522456 [debug] [MainThread]: Tracking: tracking +10:05:47.542267 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [, , ]} +10:05:47.559809 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 0 files changed. +10:05:47.559920 [debug] [MainThread]: Partial parsing enabled, no changes found, skipping parsing +10:05:47.563052 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': 'e30a08f4-5a1f-42f2-badf-08cd5c59afcf', 'context': []} +10:05:47.566100 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': 'e30a08f4-5a1f-42f2-badf-08cd5c59afcf', 'context': []} +10:05:47.566236 [info ] [MainThread]: Found 2 models, 4 tests, 0 snapshots, 0 analyses, 167 macros, 0 operations, 0 seed files, 0 sources, 0 exposures, 0 metrics +10:05:47.566357 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': 'e30a08f4-5a1f-42f2-badf-08cd5c59afcf', 'context': []} +10:05:47.566983 [info ] [MainThread]: +10:05:47.567172 [debug] [MainThread]: Acquiring new postgres connection "master" +10:05:47.567573 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres_public" +10:05:47.572348 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +10:05:47.572487 [debug] [ThreadPool]: On list_postgres_public: BEGIN +10:05:47.572555 [debug] [ThreadPool]: Opening a new connection, currently in state init +10:05:47.852624 [debug] [ThreadPool]: SQL status: BEGIN in 0.28 seconds +10:05:47.854271 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +10:05:47.854657 [debug] [ThreadPool]: On list_postgres_public: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres_public"} */ +select + 'postgres' as database, + tablename as name, + schemaname as schema, + 'table' as type + from pg_tables + where schemaname ilike 'public' + union all + select + 'postgres' as database, + viewname as name, + schemaname as schema, + 'view' as type + from pg_views + where schemaname ilike 'public' + +10:05:47.885503 [debug] [ThreadPool]: SQL status: SELECT 18 in 0.03 seconds +10:05:47.888778 [debug] [ThreadPool]: On list_postgres_public: ROLLBACK +10:05:47.909733 [debug] [ThreadPool]: On list_postgres_public: Close +10:05:47.917286 [debug] [MainThread]: Using postgres connection "master" +10:05:47.917434 [debug] [MainThread]: On master: BEGIN +10:05:47.917496 [debug] [MainThread]: Opening a new connection, currently in state init +10:05:48.140255 [debug] [MainThread]: SQL status: BEGIN in 0.22 seconds +10:05:48.141094 [debug] [MainThread]: Using postgres connection "master" +10:05:48.141443 [debug] [MainThread]: On master: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "master"} */ +with relation as ( + select + pg_rewrite.ev_class as class, + pg_rewrite.oid as id + from pg_rewrite + ), + class as ( + select + oid as id, + relname as name, + relnamespace as schema, + relkind as kind + from pg_class + ), + dependency as ( + select distinct + pg_depend.objid as id, + pg_depend.refobjid as ref + from pg_depend + ), + schema as ( + select + pg_namespace.oid as id, + pg_namespace.nspname as name + from pg_namespace + where nspname != 'information_schema' and nspname not like 'pg\_%' + ), + referenced as ( + select + relation.id AS id, + referenced_class.name , + referenced_class.schema , + referenced_class.kind + from relation + join class as referenced_class on relation.class=referenced_class.id + where referenced_class.kind in ('r', 'v') + ), + relationships as ( + select + referenced.name as referenced_name, + referenced.schema as referenced_schema_id, + dependent_class.name as dependent_name, + dependent_class.schema as dependent_schema_id, + referenced.kind as kind + from referenced + join dependency on referenced.id=dependency.id + join class as dependent_class on dependency.ref=dependent_class.id + where + (referenced.name != dependent_class.name or + referenced.schema != dependent_class.schema) + ) + + select + referenced_schema.name as referenced_schema, + relationships.referenced_name as referenced_name, + dependent_schema.name as dependent_schema, + relationships.dependent_name as dependent_name + from relationships + join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id + join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id + group by referenced_schema, referenced_name, dependent_schema, dependent_name + order by referenced_schema, referenced_name, dependent_schema, dependent_name; +10:05:48.305642 [debug] [MainThread]: SQL status: SELECT 1 in 0.16 seconds +10:05:48.309413 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': 'e30a08f4-5a1f-42f2-badf-08cd5c59afcf', 'context': []} +10:05:48.310534 [debug] [MainThread]: On master: ROLLBACK +10:05:48.334733 [debug] [MainThread]: Using postgres connection "master" +10:05:48.335223 [debug] [MainThread]: On master: BEGIN +10:05:48.406326 [debug] [MainThread]: SQL status: BEGIN in 0.07 seconds +10:05:48.406872 [debug] [MainThread]: On master: COMMIT +10:05:48.407083 [debug] [MainThread]: Using postgres connection "master" +10:05:48.407271 [debug] [MainThread]: On master: COMMIT +10:05:48.426801 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +10:05:48.427287 [debug] [MainThread]: On master: Close +10:05:48.428089 [info ] [MainThread]: Concurrency: 10 threads (target='dev') +10:05:48.428508 [info ] [MainThread]: +10:05:48.433344 [debug] [Thread-1 ]: Began running node test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +10:05:48.433504 [info ] [Thread-1 ]: 1 of 4 START test not_null_my_first_dbt_model_id ............................... [RUN] +10:05:48.433734 [debug] [Thread-1 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +10:05:48.433809 [debug] [Thread-1 ]: Began compiling node test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +10:05:48.433896 [debug] [Thread-1 ]: Compiling test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +10:05:48.439178 [debug] [Thread-2 ]: Began running node test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +10:05:48.440448 [debug] [Thread-1 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +10:05:48.440526 [debug] [Thread-3 ]: Began running node test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +10:05:48.440642 [info ] [Thread-2 ]: 2 of 4 START test not_null_my_second_dbt_model_id .............................. [RUN] +10:05:48.440701 [debug] [Thread-4 ]: Began running node test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +10:05:48.440855 [info ] [Thread-3 ]: 3 of 4 START test unique_my_first_dbt_model_id ................................. [RUN] +10:05:48.441078 [debug] [Thread-2 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +10:05:48.441197 [info ] [Thread-4 ]: 4 of 4 START test unique_my_second_dbt_model_id ................................ [RUN] +10:05:48.441389 [debug] [Thread-3 ]: Acquiring new postgres connection "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +10:05:48.441463 [debug] [Thread-2 ]: Began compiling node test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +10:05:48.441627 [debug] [Thread-4 ]: Acquiring new postgres connection "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +10:05:48.441716 [debug] [Thread-3 ]: Began compiling node test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +10:05:48.441810 [debug] [Thread-2 ]: Compiling test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +10:05:48.441877 [debug] [Thread-1 ]: finished collecting timing info +10:05:48.441942 [debug] [Thread-4 ]: Began compiling node test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +10:05:48.441998 [debug] [Thread-3 ]: Compiling test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +10:05:48.443598 [debug] [Thread-2 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +10:05:48.443695 [debug] [Thread-1 ]: Began executing node test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +10:05:48.443759 [debug] [Thread-4 ]: Compiling test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +10:05:48.446482 [debug] [Thread-3 ]: Writing injected SQL for node "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +10:05:48.453352 [debug] [Thread-1 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +10:05:48.454969 [debug] [Thread-4 ]: Writing injected SQL for node "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +10:05:48.455116 [debug] [Thread-2 ]: finished collecting timing info +10:05:48.455340 [debug] [Thread-3 ]: finished collecting timing info +10:05:48.455433 [debug] [Thread-2 ]: Began executing node test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +10:05:48.455514 [debug] [Thread-1 ]: Using postgres connection "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +10:05:48.455618 [debug] [Thread-3 ]: Began executing node test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +10:05:48.455670 [debug] [Thread-4 ]: finished collecting timing info +10:05:48.456944 [debug] [Thread-2 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +10:05:48.457031 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710: BEGIN +10:05:48.457752 [debug] [Thread-3 ]: Writing runtime SQL for node "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +10:05:48.457830 [debug] [Thread-4 ]: Began executing node test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +10:05:48.457933 [debug] [Thread-1 ]: Opening a new connection, currently in state closed +10:05:48.458683 [debug] [Thread-4 ]: Writing runtime SQL for node "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +10:05:48.458769 [debug] [Thread-2 ]: Using postgres connection "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +10:05:48.458927 [debug] [Thread-3 ]: Using postgres connection "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +10:05:48.459015 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778: BEGIN +10:05:48.459098 [debug] [Thread-3 ]: On test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321: BEGIN +10:05:48.459160 [debug] [Thread-2 ]: Opening a new connection, currently in state init +10:05:48.459217 [debug] [Thread-4 ]: Using postgres connection "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +10:05:48.459272 [debug] [Thread-3 ]: Opening a new connection, currently in state init +10:05:48.459376 [debug] [Thread-4 ]: On test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493: BEGIN +10:05:48.459475 [debug] [Thread-4 ]: Opening a new connection, currently in state init +10:05:48.662071 [debug] [Thread-4 ]: SQL status: BEGIN in 0.2 seconds +10:05:48.662575 [debug] [Thread-1 ]: SQL status: BEGIN in 0.2 seconds +10:05:48.662882 [debug] [Thread-3 ]: SQL status: BEGIN in 0.2 seconds +10:05:48.663158 [debug] [Thread-2 ]: SQL status: BEGIN in 0.2 seconds +10:05:48.663614 [debug] [Thread-4 ]: Using postgres connection "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +10:05:48.663969 [debug] [Thread-1 ]: Using postgres connection "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +10:05:48.664300 [debug] [Thread-3 ]: Using postgres connection "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +10:05:48.664751 [debug] [Thread-2 ]: Using postgres connection "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +10:05:48.665091 [debug] [Thread-4 ]: On test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + +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 + + + + + ) dbt_internal_test +10:05:48.665417 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select id +from "postgres"."public"."my_first_dbt_model" +where id is null + + + + + ) dbt_internal_test +10:05:48.665788 [debug] [Thread-3 ]: On test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + +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 + + + + + ) dbt_internal_test +10:05:48.666149 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select id +from "postgres"."public"."my_second_dbt_model" +where id is null + + + + + ) dbt_internal_test +10:05:48.687794 [debug] [Thread-4 ]: SQL status: SELECT 1 in 0.02 seconds +10:05:48.692600 [debug] [Thread-4 ]: finished collecting timing info +10:05:48.692845 [debug] [Thread-2 ]: SQL status: SELECT 1 in 0.03 seconds +10:05:48.692954 [debug] [Thread-3 ]: SQL status: SELECT 1 in 0.03 seconds +10:05:48.693000 [debug] [Thread-1 ]: SQL status: SELECT 1 in 0.03 seconds +10:05:48.693147 [debug] [Thread-4 ]: On test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493: ROLLBACK +10:05:48.693834 [debug] [Thread-2 ]: finished collecting timing info +10:05:48.694350 [debug] [Thread-3 ]: finished collecting timing info +10:05:48.694872 [debug] [Thread-1 ]: finished collecting timing info +10:05:48.694990 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778: ROLLBACK +10:05:48.695073 [debug] [Thread-3 ]: On test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321: ROLLBACK +10:05:48.695140 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710: ROLLBACK +10:05:48.716666 [debug] [Thread-4 ]: On test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493: Close +10:05:48.717174 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710: Close +10:05:48.717456 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778: Close +10:05:48.717701 [debug] [Thread-3 ]: On test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321: Close +10:05:48.719380 [info ] [Thread-4 ]: 4 of 4 PASS unique_my_second_dbt_model_id ...................................... [PASS in 0.28s] +10:05:48.719855 [info ] [Thread-2 ]: 2 of 4 PASS not_null_my_second_dbt_model_id .................................... [PASS in 0.28s] +10:05:48.720366 [error] [Thread-1 ]: 1 of 4 FAIL 1 not_null_my_first_dbt_model_id ................................... [FAIL 1 in 0.29s] +10:05:48.720909 [debug] [Thread-4 ]: Finished running node test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +10:05:48.721096 [info ] [Thread-3 ]: 3 of 4 PASS unique_my_first_dbt_model_id ....................................... [PASS in 0.28s] +10:05:48.721293 [debug] [Thread-2 ]: Finished running node test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +10:05:48.721459 [debug] [Thread-1 ]: Finished running node test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +10:05:48.721660 [debug] [Thread-3 ]: Finished running node test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +10:05:48.722690 [debug] [MainThread]: Acquiring new postgres connection "master" +10:05:48.722793 [debug] [MainThread]: Using postgres connection "master" +10:05:48.722852 [debug] [MainThread]: On master: BEGIN +10:05:48.722904 [debug] [MainThread]: Opening a new connection, currently in state closed +10:05:48.917347 [debug] [MainThread]: SQL status: BEGIN in 0.19 seconds +10:05:48.924982 [debug] [MainThread]: On master: COMMIT +10:05:48.925596 [debug] [MainThread]: Using postgres connection "master" +10:05:48.925944 [debug] [MainThread]: On master: COMMIT +10:05:48.944193 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +10:05:48.945094 [debug] [MainThread]: On master: Close +10:05:48.947039 [info ] [MainThread]: +10:05:48.947715 [info ] [MainThread]: Finished running 4 tests in 1.38s. +10:05:48.948150 [debug] [MainThread]: Connection 'master' was properly closed. +10:05:48.948398 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710' was properly closed. +10:05:48.948700 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778' was properly closed. +10:05:48.948792 [debug] [MainThread]: Connection 'test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321' was properly closed. +10:05:48.948843 [debug] [MainThread]: Connection 'test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493' was properly closed. +10:05:48.954737 [info ] [MainThread]: +10:05:48.954859 [info ] [MainThread]: Completed with 1 error and 0 warnings: +10:05:48.954966 [info ] [MainThread]: +10:05:48.955053 [error] [MainThread]: Failure in test not_null_my_first_dbt_model_id (models/example/schema.yml) +10:05:48.955142 [error] [MainThread]: Got 1 result, configured to fail if != 0 +10:05:48.955223 [info ] [MainThread]: +10:05:48.955308 [info ] [MainThread]: compiled SQL at target/compiled/wrkplay_dbt/models/example/schema.yml/not_null_my_first_dbt_model_id.sql +10:05:48.955395 [info ] [MainThread]: +10:05:48.955479 [info ] [MainThread]: Done. PASS=3 WARN=0 ERROR=1 SKIP=0 TOTAL=4 +10:05:48.955634 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [, , ]} + + +============================== 2022-07-08 10:16:42.177568 | 1c575006-2303-4061-a8e0-faf352209c3d ============================== +10:16:42.177586 [info ] [MainThread]: Running with dbt=1.1.1 +10:16:42.178303 [debug] [MainThread]: running dbt with arguments {'write_json': True, 'use_colors': True, 'printer_width': 80, 'version_check': True, 'partial_parse': True, 'static_parser': True, 'profiles_dir': '/Users/bruno.campos/.dbt', 'send_anonymous_usage_stats': True, 'event_buffer_size': 100000, 'quiet': False, 'no_print': False, 'which': 'run', 'rpc_method': 'run', 'indirect_selection': 'eager'} +10:16:42.178384 [debug] [MainThread]: Tracking: tracking +10:16:42.200663 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [, , ]} +10:16:42.218746 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 1 files changed. +10:16:42.218976 [debug] [MainThread]: Partial parsing: updated file: wrkplay_dbt://models/example/my_first_dbt_model.sql +10:16:42.225177 [debug] [MainThread]: 1699: static parser successfully parsed example/my_first_dbt_model.sql +10:16:42.248706 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '1c575006-2303-4061-a8e0-faf352209c3d', 'context': []} +10:16:42.252197 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '1c575006-2303-4061-a8e0-faf352209c3d', 'context': []} +10:16:42.252388 [info ] [MainThread]: Found 2 models, 4 tests, 0 snapshots, 0 analyses, 167 macros, 0 operations, 0 seed files, 0 sources, 0 exposures, 0 metrics +10:16:42.252529 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '1c575006-2303-4061-a8e0-faf352209c3d', 'context': []} +10:16:42.253369 [info ] [MainThread]: +10:16:42.253591 [debug] [MainThread]: Acquiring new postgres connection "master" +10:16:42.254011 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres" +10:16:42.259000 [debug] [ThreadPool]: Using postgres connection "list_postgres" +10:16:42.259125 [debug] [ThreadPool]: On list_postgres: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres"} */ + + select distinct nspname from pg_namespace + +10:16:42.259189 [debug] [ThreadPool]: Opening a new connection, currently in state init +10:16:42.511837 [debug] [ThreadPool]: SQL status: SELECT 10 in 0.25 seconds +10:16:42.515028 [debug] [ThreadPool]: On list_postgres: Close +10:16:42.517836 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres_public" +10:16:42.522124 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +10:16:42.522311 [debug] [ThreadPool]: On list_postgres_public: BEGIN +10:16:42.522370 [debug] [ThreadPool]: Opening a new connection, currently in state closed +10:16:42.725374 [debug] [ThreadPool]: SQL status: BEGIN in 0.2 seconds +10:16:42.726015 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +10:16:42.726272 [debug] [ThreadPool]: On list_postgres_public: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres_public"} */ +select + 'postgres' as database, + tablename as name, + schemaname as schema, + 'table' as type + from pg_tables + where schemaname ilike 'public' + union all + select + 'postgres' as database, + viewname as name, + schemaname as schema, + 'view' as type + from pg_views + where schemaname ilike 'public' + +10:16:42.750496 [debug] [ThreadPool]: SQL status: SELECT 18 in 0.02 seconds +10:16:42.756056 [debug] [ThreadPool]: On list_postgres_public: ROLLBACK +10:16:42.780984 [debug] [ThreadPool]: On list_postgres_public: Close +10:16:42.790266 [debug] [MainThread]: Using postgres connection "master" +10:16:42.790450 [debug] [MainThread]: On master: BEGIN +10:16:42.790514 [debug] [MainThread]: Opening a new connection, currently in state init +10:16:42.985861 [debug] [MainThread]: SQL status: BEGIN in 0.2 seconds +10:16:42.986763 [debug] [MainThread]: Using postgres connection "master" +10:16:42.987133 [debug] [MainThread]: On master: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "master"} */ +with relation as ( + select + pg_rewrite.ev_class as class, + pg_rewrite.oid as id + from pg_rewrite + ), + class as ( + select + oid as id, + relname as name, + relnamespace as schema, + relkind as kind + from pg_class + ), + dependency as ( + select distinct + pg_depend.objid as id, + pg_depend.refobjid as ref + from pg_depend + ), + schema as ( + select + pg_namespace.oid as id, + pg_namespace.nspname as name + from pg_namespace + where nspname != 'information_schema' and nspname not like 'pg\_%' + ), + referenced as ( + select + relation.id AS id, + referenced_class.name , + referenced_class.schema , + referenced_class.kind + from relation + join class as referenced_class on relation.class=referenced_class.id + where referenced_class.kind in ('r', 'v') + ), + relationships as ( + select + referenced.name as referenced_name, + referenced.schema as referenced_schema_id, + dependent_class.name as dependent_name, + dependent_class.schema as dependent_schema_id, + referenced.kind as kind + from referenced + join dependency on referenced.id=dependency.id + join class as dependent_class on dependency.ref=dependent_class.id + where + (referenced.name != dependent_class.name or + referenced.schema != dependent_class.schema) + ) + + select + referenced_schema.name as referenced_schema, + relationships.referenced_name as referenced_name, + dependent_schema.name as dependent_schema, + relationships.dependent_name as dependent_name + from relationships + join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id + join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id + group by referenced_schema, referenced_name, dependent_schema, dependent_name + order by referenced_schema, referenced_name, dependent_schema, dependent_name; +10:16:43.153680 [debug] [MainThread]: SQL status: SELECT 1 in 0.17 seconds +10:16:43.156946 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '1c575006-2303-4061-a8e0-faf352209c3d', 'context': []} +10:16:43.157479 [debug] [MainThread]: On master: ROLLBACK +10:16:43.173987 [debug] [MainThread]: Using postgres connection "master" +10:16:43.174474 [debug] [MainThread]: On master: BEGIN +10:16:43.212401 [debug] [MainThread]: SQL status: BEGIN in 0.04 seconds +10:16:43.213240 [debug] [MainThread]: On master: COMMIT +10:16:43.213736 [debug] [MainThread]: Using postgres connection "master" +10:16:43.214190 [debug] [MainThread]: On master: COMMIT +10:16:43.231089 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +10:16:43.231802 [debug] [MainThread]: On master: Close +10:16:43.233474 [info ] [MainThread]: Concurrency: 10 threads (target='dev') +10:16:43.234195 [info ] [MainThread]: +10:16:43.241159 [debug] [Thread-1 ]: Began running node model.wrkplay_dbt.my_first_dbt_model +10:16:43.241469 [info ] [Thread-1 ]: 1 of 2 START view model public.my_first_dbt_model .............................. [RUN] +10:16:43.241805 [debug] [Thread-1 ]: Acquiring new postgres connection "model.wrkplay_dbt.my_first_dbt_model" +10:16:43.241891 [debug] [Thread-1 ]: Began compiling node model.wrkplay_dbt.my_first_dbt_model +10:16:43.241992 [debug] [Thread-1 ]: Compiling model.wrkplay_dbt.my_first_dbt_model +10:16:43.243793 [debug] [Thread-1 ]: Writing injected SQL for node "model.wrkplay_dbt.my_first_dbt_model" +10:16:43.244472 [debug] [Thread-1 ]: finished collecting timing info +10:16:43.244577 [debug] [Thread-1 ]: Began executing node model.wrkplay_dbt.my_first_dbt_model +10:16:43.255187 [debug] [Thread-1 ]: Writing runtime SQL for node "model.wrkplay_dbt.my_first_dbt_model" +10:16:43.255454 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +10:16:43.255516 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: BEGIN +10:16:43.255567 [debug] [Thread-1 ]: Opening a new connection, currently in state closed +10:16:43.456363 [debug] [Thread-1 ]: SQL status: BEGIN in 0.2 seconds +10:16:43.457845 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +10:16:43.458242 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ + + create view "postgres"."public"."my_first_dbt_model__dbt_tmp" as ( + /* + 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 + ); +10:16:43.481245 [debug] [Thread-1 ]: SQL status: CREATE VIEW in 0.02 seconds +10:16:43.488984 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +10:16:43.489190 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ +alter table "postgres"."public"."my_first_dbt_model" rename to "my_first_dbt_model__dbt_backup" +10:16:43.508626 [debug] [Thread-1 ]: SQL status: ALTER TABLE in 0.02 seconds +10:16:43.509608 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +10:16:43.509669 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ +alter table "postgres"."public"."my_first_dbt_model__dbt_tmp" rename to "my_first_dbt_model" +10:16:43.529102 [debug] [Thread-1 ]: SQL status: ALTER TABLE in 0.02 seconds +10:16:43.531971 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: COMMIT +10:16:43.532047 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +10:16:43.532099 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: COMMIT +10:16:43.551668 [debug] [Thread-1 ]: SQL status: COMMIT in 0.02 seconds +10:16:43.558520 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +10:16:43.558612 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ +drop table if exists "postgres"."public"."my_first_dbt_model__dbt_backup" cascade +10:16:43.587896 [debug] [Thread-1 ]: SQL status: DROP TABLE in 0.03 seconds +10:16:43.591229 [debug] [Thread-1 ]: finished collecting timing info +10:16:43.591419 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: Close +10:16:43.592010 [debug] [Thread-1 ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1c575006-2303-4061-a8e0-faf352209c3d', 'context': []} +10:16:43.592322 [info ] [Thread-1 ]: 1 of 2 OK created view model public.my_first_dbt_model ......................... [CREATE VIEW in 0.35s] +10:16:43.592667 [debug] [Thread-1 ]: Finished running node model.wrkplay_dbt.my_first_dbt_model +10:16:43.593164 [debug] [Thread-3 ]: Began running node model.wrkplay_dbt.my_second_dbt_model +10:16:43.593298 [info ] [Thread-3 ]: 2 of 2 START view model public.my_second_dbt_model ............................. [RUN] +10:16:43.593618 [debug] [Thread-3 ]: Acquiring new postgres connection "model.wrkplay_dbt.my_second_dbt_model" +10:16:43.593714 [debug] [Thread-3 ]: Began compiling node model.wrkplay_dbt.my_second_dbt_model +10:16:43.593804 [debug] [Thread-3 ]: Compiling model.wrkplay_dbt.my_second_dbt_model +10:16:43.595055 [debug] [Thread-3 ]: Writing injected SQL for node "model.wrkplay_dbt.my_second_dbt_model" +10:16:43.595346 [debug] [Thread-3 ]: finished collecting timing info +10:16:43.595413 [debug] [Thread-3 ]: Began executing node model.wrkplay_dbt.my_second_dbt_model +10:16:43.596517 [debug] [Thread-3 ]: Writing runtime SQL for node "model.wrkplay_dbt.my_second_dbt_model" +10:16:43.596705 [debug] [Thread-3 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +10:16:43.596760 [debug] [Thread-3 ]: On model.wrkplay_dbt.my_second_dbt_model: BEGIN +10:16:43.596811 [debug] [Thread-3 ]: Opening a new connection, currently in state init +10:16:43.788304 [debug] [Thread-3 ]: SQL status: BEGIN in 0.19 seconds +10:16:43.788903 [debug] [Thread-3 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +10:16:43.789123 [debug] [Thread-3 ]: On model.wrkplay_dbt.my_second_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_second_dbt_model"} */ + + create view "postgres"."public"."my_second_dbt_model__dbt_tmp" as ( + -- Use the `ref` function to select from other models + +select * +from "postgres"."public"."my_first_dbt_model" +where id = 1 + ); +10:16:43.809984 [debug] [Thread-3 ]: SQL status: CREATE VIEW in 0.02 seconds +10:16:43.815723 [debug] [Thread-3 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +10:16:43.815871 [debug] [Thread-3 ]: On model.wrkplay_dbt.my_second_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_second_dbt_model"} */ +alter table "postgres"."public"."my_second_dbt_model__dbt_tmp" rename to "my_second_dbt_model" +10:16:43.835196 [debug] [Thread-3 ]: SQL status: ALTER TABLE in 0.02 seconds +10:16:43.835810 [debug] [Thread-3 ]: On model.wrkplay_dbt.my_second_dbt_model: COMMIT +10:16:43.835872 [debug] [Thread-3 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +10:16:43.835923 [debug] [Thread-3 ]: On model.wrkplay_dbt.my_second_dbt_model: COMMIT +10:16:43.855297 [debug] [Thread-3 ]: SQL status: COMMIT in 0.02 seconds +10:16:43.858724 [debug] [Thread-3 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +10:16:43.859190 [debug] [Thread-3 ]: On model.wrkplay_dbt.my_second_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_second_dbt_model"} */ +drop view if exists "postgres"."public"."my_second_dbt_model__dbt_backup" cascade +10:16:43.877305 [debug] [Thread-3 ]: SQL status: DROP VIEW in 0.02 seconds +10:16:43.914481 [debug] [Thread-3 ]: finished collecting timing info +10:16:43.914651 [debug] [Thread-3 ]: On model.wrkplay_dbt.my_second_dbt_model: Close +10:16:43.914931 [debug] [Thread-3 ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '1c575006-2303-4061-a8e0-faf352209c3d', 'context': []} +10:16:43.915088 [info ] [Thread-3 ]: 2 of 2 OK created view model public.my_second_dbt_model ........................ [CREATE VIEW in 0.32s] +10:16:43.915264 [debug] [Thread-3 ]: Finished running node model.wrkplay_dbt.my_second_dbt_model +10:16:43.915931 [debug] [MainThread]: Acquiring new postgres connection "master" +10:16:43.916030 [debug] [MainThread]: Using postgres connection "master" +10:16:43.916097 [debug] [MainThread]: On master: BEGIN +10:16:43.916150 [debug] [MainThread]: Opening a new connection, currently in state closed +10:16:44.099792 [debug] [MainThread]: SQL status: BEGIN in 0.18 seconds +10:16:44.101279 [debug] [MainThread]: On master: COMMIT +10:16:44.101649 [debug] [MainThread]: Using postgres connection "master" +10:16:44.102009 [debug] [MainThread]: On master: COMMIT +10:16:44.119982 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +10:16:44.120863 [debug] [MainThread]: On master: Close +10:16:44.122862 [info ] [MainThread]: +10:16:44.123594 [info ] [MainThread]: Finished running 2 view models in 1.87s. +10:16:44.124134 [debug] [MainThread]: Connection 'master' was properly closed. +10:16:44.124310 [debug] [MainThread]: Connection 'model.wrkplay_dbt.my_first_dbt_model' was properly closed. +10:16:44.124487 [debug] [MainThread]: Connection 'model.wrkplay_dbt.my_second_dbt_model' was properly closed. +10:16:44.130192 [info ] [MainThread]: +10:16:44.130397 [info ] [MainThread]: Completed successfully +10:16:44.130531 [info ] [MainThread]: +10:16:44.130622 [info ] [MainThread]: Done. PASS=2 WARN=0 ERROR=0 SKIP=0 TOTAL=2 +10:16:44.130764 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [, , ]} + + +============================== 2022-07-08 10:16:50.508733 | a4d15fa2-8bc6-47e6-9193-671cade9a329 ============================== +10:16:50.508759 [info ] [MainThread]: Running with dbt=1.1.1 +10:16:50.509117 [debug] [MainThread]: running dbt with arguments {'write_json': True, 'use_colors': True, 'printer_width': 80, 'version_check': True, 'partial_parse': True, 'static_parser': True, 'profiles_dir': '/Users/bruno.campos/.dbt', 'send_anonymous_usage_stats': True, 'event_buffer_size': 100000, 'quiet': False, 'no_print': False, 'indirect_selection': 'eager', 'which': 'test', 'rpc_method': 'test'} +10:16:50.509197 [debug] [MainThread]: Tracking: tracking +10:16:50.522434 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [, , ]} +10:16:50.536691 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 0 files changed. +10:16:50.536793 [debug] [MainThread]: Partial parsing enabled, no changes found, skipping parsing +10:16:50.539806 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': 'a4d15fa2-8bc6-47e6-9193-671cade9a329', 'context': []} +10:16:50.542202 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': 'a4d15fa2-8bc6-47e6-9193-671cade9a329', 'context': []} +10:16:50.542334 [info ] [MainThread]: Found 2 models, 4 tests, 0 snapshots, 0 analyses, 167 macros, 0 operations, 0 seed files, 0 sources, 0 exposures, 0 metrics +10:16:50.542451 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': 'a4d15fa2-8bc6-47e6-9193-671cade9a329', 'context': []} +10:16:50.543074 [info ] [MainThread]: +10:16:50.543267 [debug] [MainThread]: Acquiring new postgres connection "master" +10:16:50.543661 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres_public" +10:16:50.547994 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +10:16:50.548080 [debug] [ThreadPool]: On list_postgres_public: BEGIN +10:16:50.548140 [debug] [ThreadPool]: Opening a new connection, currently in state init +10:16:50.724026 [debug] [ThreadPool]: SQL status: BEGIN in 0.18 seconds +10:16:50.724433 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +10:16:50.724505 [debug] [ThreadPool]: On list_postgres_public: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres_public"} */ +select + 'postgres' as database, + tablename as name, + schemaname as schema, + 'table' as type + from pg_tables + where schemaname ilike 'public' + union all + select + 'postgres' as database, + viewname as name, + schemaname as schema, + 'view' as type + from pg_views + where schemaname ilike 'public' + +10:16:50.746183 [debug] [ThreadPool]: SQL status: SELECT 18 in 0.02 seconds +10:16:50.747624 [debug] [ThreadPool]: On list_postgres_public: ROLLBACK +10:16:50.764770 [debug] [ThreadPool]: On list_postgres_public: Close +10:16:50.772106 [debug] [MainThread]: Using postgres connection "master" +10:16:50.772230 [debug] [MainThread]: On master: BEGIN +10:16:50.772293 [debug] [MainThread]: Opening a new connection, currently in state init +10:16:50.974201 [debug] [MainThread]: SQL status: BEGIN in 0.2 seconds +10:16:50.975141 [debug] [MainThread]: Using postgres connection "master" +10:16:50.975501 [debug] [MainThread]: On master: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "master"} */ +with relation as ( + select + pg_rewrite.ev_class as class, + pg_rewrite.oid as id + from pg_rewrite + ), + class as ( + select + oid as id, + relname as name, + relnamespace as schema, + relkind as kind + from pg_class + ), + dependency as ( + select distinct + pg_depend.objid as id, + pg_depend.refobjid as ref + from pg_depend + ), + schema as ( + select + pg_namespace.oid as id, + pg_namespace.nspname as name + from pg_namespace + where nspname != 'information_schema' and nspname not like 'pg\_%' + ), + referenced as ( + select + relation.id AS id, + referenced_class.name , + referenced_class.schema , + referenced_class.kind + from relation + join class as referenced_class on relation.class=referenced_class.id + where referenced_class.kind in ('r', 'v') + ), + relationships as ( + select + referenced.name as referenced_name, + referenced.schema as referenced_schema_id, + dependent_class.name as dependent_name, + dependent_class.schema as dependent_schema_id, + referenced.kind as kind + from referenced + join dependency on referenced.id=dependency.id + join class as dependent_class on dependency.ref=dependent_class.id + where + (referenced.name != dependent_class.name or + referenced.schema != dependent_class.schema) + ) + + select + referenced_schema.name as referenced_schema, + relationships.referenced_name as referenced_name, + dependent_schema.name as dependent_schema, + relationships.dependent_name as dependent_name + from relationships + join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id + join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id + group by referenced_schema, referenced_name, dependent_schema, dependent_name + order by referenced_schema, referenced_name, dependent_schema, dependent_name; +10:16:51.140967 [debug] [MainThread]: SQL status: SELECT 1 in 0.17 seconds +10:16:51.146112 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': 'a4d15fa2-8bc6-47e6-9193-671cade9a329', 'context': []} +10:16:51.146908 [debug] [MainThread]: On master: ROLLBACK +10:16:51.167050 [debug] [MainThread]: Using postgres connection "master" +10:16:51.167881 [debug] [MainThread]: On master: BEGIN +10:16:51.213375 [debug] [MainThread]: SQL status: BEGIN in 0.05 seconds +10:16:51.214370 [debug] [MainThread]: On master: COMMIT +10:16:51.214806 [debug] [MainThread]: Using postgres connection "master" +10:16:51.215333 [debug] [MainThread]: On master: COMMIT +10:16:51.236382 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +10:16:51.237257 [debug] [MainThread]: On master: Close +10:16:51.239090 [info ] [MainThread]: Concurrency: 10 threads (target='dev') +10:16:51.239562 [info ] [MainThread]: +10:16:51.243871 [debug] [Thread-1 ]: Began running node test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +10:16:51.244078 [debug] [Thread-2 ]: Began running node test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +10:16:51.244181 [info ] [Thread-1 ]: 1 of 4 START test not_null_my_first_dbt_model_id ............................... [RUN] +10:16:51.244249 [debug] [Thread-3 ]: Began running node test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +10:16:51.244333 [debug] [Thread-4 ]: Began running node test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +10:16:51.244386 [info ] [Thread-2 ]: 2 of 4 START test not_null_my_second_dbt_model_id .............................. [RUN] +10:16:51.244689 [debug] [Thread-1 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +10:16:51.244764 [info ] [Thread-3 ]: 3 of 4 START test unique_my_first_dbt_model_id ................................. [RUN] +10:16:51.244864 [info ] [Thread-4 ]: 4 of 4 START test unique_my_second_dbt_model_id ................................ [RUN] +10:16:51.245104 [debug] [Thread-2 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +10:16:51.245216 [debug] [Thread-1 ]: Began compiling node test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +10:16:51.245453 [debug] [Thread-3 ]: Acquiring new postgres connection "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +10:16:51.245692 [debug] [Thread-4 ]: Acquiring new postgres connection "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +10:16:51.245747 [debug] [Thread-2 ]: Began compiling node test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +10:16:51.245847 [debug] [Thread-1 ]: Compiling test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +10:16:51.245904 [debug] [Thread-3 ]: Began compiling node test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +10:16:51.245957 [debug] [Thread-4 ]: Began compiling node test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +10:16:51.246009 [debug] [Thread-2 ]: Compiling test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +10:16:51.252298 [debug] [Thread-1 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +10:16:51.252411 [debug] [Thread-3 ]: Compiling test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +10:16:51.252471 [debug] [Thread-4 ]: Compiling test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +10:16:51.254029 [debug] [Thread-2 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +10:16:51.256757 [debug] [Thread-3 ]: Writing injected SQL for node "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +10:16:51.258178 [debug] [Thread-4 ]: Writing injected SQL for node "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +10:16:51.258392 [debug] [Thread-1 ]: finished collecting timing info +10:16:51.258479 [debug] [Thread-1 ]: Began executing node test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +10:16:51.264956 [debug] [Thread-1 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +10:16:51.265122 [debug] [Thread-4 ]: finished collecting timing info +10:16:51.265192 [debug] [Thread-4 ]: Began executing node test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +10:16:51.266378 [debug] [Thread-4 ]: Writing runtime SQL for node "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +10:16:51.266451 [debug] [Thread-3 ]: finished collecting timing info +10:16:51.266512 [debug] [Thread-2 ]: finished collecting timing info +10:16:51.266614 [debug] [Thread-3 ]: Began executing node test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +10:16:51.266696 [debug] [Thread-1 ]: Using postgres connection "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +10:16:51.266783 [debug] [Thread-2 ]: Began executing node test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +10:16:51.267532 [debug] [Thread-3 ]: Writing runtime SQL for node "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +10:16:51.267604 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710: BEGIN +10:16:51.267664 [debug] [Thread-4 ]: Using postgres connection "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +10:16:51.268342 [debug] [Thread-2 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +10:16:51.268453 [debug] [Thread-1 ]: Opening a new connection, currently in state closed +10:16:51.268532 [debug] [Thread-4 ]: On test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493: BEGIN +10:16:51.268639 [debug] [Thread-3 ]: Using postgres connection "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +10:16:51.268783 [debug] [Thread-4 ]: Opening a new connection, currently in state init +10:16:51.268843 [debug] [Thread-2 ]: Using postgres connection "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +10:16:51.268901 [debug] [Thread-3 ]: On test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321: BEGIN +10:16:51.269017 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778: BEGIN +10:16:51.269071 [debug] [Thread-3 ]: Opening a new connection, currently in state init +10:16:51.269126 [debug] [Thread-2 ]: Opening a new connection, currently in state init +10:16:51.465791 [debug] [Thread-2 ]: SQL status: BEGIN in 0.2 seconds +10:16:51.466360 [debug] [Thread-2 ]: Using postgres connection "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +10:16:51.466622 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select id +from "postgres"."public"."my_second_dbt_model" +where id is null + + + + + ) dbt_internal_test +10:16:51.467179 [debug] [Thread-1 ]: SQL status: BEGIN in 0.2 seconds +10:16:51.467423 [debug] [Thread-1 ]: Using postgres connection "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +10:16:51.467647 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select id +from "postgres"."public"."my_first_dbt_model" +where id is null + + + + + ) dbt_internal_test +10:16:51.468550 [debug] [Thread-4 ]: SQL status: BEGIN in 0.2 seconds +10:16:51.468920 [debug] [Thread-4 ]: Using postgres connection "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +10:16:51.469158 [debug] [Thread-4 ]: On test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + +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 + + + + + ) dbt_internal_test +10:16:51.469993 [debug] [Thread-3 ]: SQL status: BEGIN in 0.2 seconds +10:16:51.470403 [debug] [Thread-3 ]: Using postgres connection "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +10:16:51.470745 [debug] [Thread-3 ]: On test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + +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 + + + + + ) dbt_internal_test +10:16:51.487119 [debug] [Thread-2 ]: SQL status: SELECT 1 in 0.02 seconds +10:16:51.487471 [debug] [Thread-1 ]: SQL status: SELECT 1 in 0.02 seconds +10:16:51.492966 [debug] [Thread-2 ]: finished collecting timing info +10:16:51.493178 [debug] [Thread-3 ]: SQL status: SELECT 1 in 0.02 seconds +10:16:51.493368 [debug] [Thread-4 ]: SQL status: SELECT 1 in 0.02 seconds +10:16:51.494886 [debug] [Thread-1 ]: finished collecting timing info +10:16:51.495060 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778: ROLLBACK +10:16:51.495667 [debug] [Thread-3 ]: finished collecting timing info +10:16:51.496216 [debug] [Thread-4 ]: finished collecting timing info +10:16:51.496295 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710: ROLLBACK +10:16:51.496397 [debug] [Thread-3 ]: On test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321: ROLLBACK +10:16:51.496471 [debug] [Thread-4 ]: On test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493: ROLLBACK +10:16:51.514508 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778: Close +10:16:51.514871 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710: Close +10:16:51.516291 [info ] [Thread-2 ]: 2 of 4 PASS not_null_my_second_dbt_model_id .................................... [PASS in 0.27s] +10:16:51.516980 [info ] [Thread-1 ]: 1 of 4 PASS not_null_my_first_dbt_model_id ..................................... [PASS in 0.27s] +10:16:51.519117 [debug] [Thread-1 ]: Finished running node test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +10:16:51.517975 [debug] [Thread-2 ]: Finished running node test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +10:16:51.519718 [debug] [Thread-3 ]: On test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321: Close +10:16:51.520042 [debug] [Thread-4 ]: On test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493: Close +10:16:51.521026 [info ] [Thread-3 ]: 3 of 4 PASS unique_my_first_dbt_model_id ....................................... [PASS in 0.28s] +10:16:51.521412 [info ] [Thread-4 ]: 4 of 4 PASS unique_my_second_dbt_model_id ...................................... [PASS in 0.28s] +10:16:51.522036 [debug] [Thread-3 ]: Finished running node test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +10:16:51.522271 [debug] [Thread-4 ]: Finished running node test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +10:16:51.523171 [debug] [MainThread]: Acquiring new postgres connection "master" +10:16:51.523266 [debug] [MainThread]: Using postgres connection "master" +10:16:51.523323 [debug] [MainThread]: On master: BEGIN +10:16:51.523377 [debug] [MainThread]: Opening a new connection, currently in state closed +10:16:51.710760 [debug] [MainThread]: SQL status: BEGIN in 0.19 seconds +10:16:51.712304 [debug] [MainThread]: On master: COMMIT +10:16:51.712665 [debug] [MainThread]: Using postgres connection "master" +10:16:51.713021 [debug] [MainThread]: On master: COMMIT +10:16:51.733673 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +10:16:51.734569 [debug] [MainThread]: On master: Close +10:16:51.736377 [info ] [MainThread]: +10:16:51.736912 [info ] [MainThread]: Finished running 4 tests in 1.19s. +10:16:51.737285 [debug] [MainThread]: Connection 'master' was properly closed. +10:16:51.737469 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710' was properly closed. +10:16:51.737650 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778' was properly closed. +10:16:51.737818 [debug] [MainThread]: Connection 'test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321' was properly closed. +10:16:51.738012 [debug] [MainThread]: Connection 'test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493' was properly closed. +10:16:51.744522 [info ] [MainThread]: +10:16:51.744743 [info ] [MainThread]: Completed successfully +10:16:51.744876 [info ] [MainThread]: +10:16:51.744965 [info ] [MainThread]: Done. PASS=4 WARN=0 ERROR=0 SKIP=0 TOTAL=4 +10:16:51.745169 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [, , ]} + + +============================== 2022-07-08 10:31:46.474724 | 07e7e14c-50e6-4837-8939-b7e6e47a30ed ============================== +10:31:46.474729 [info ] [MainThread]: Running with dbt=1.1.1 +10:31:46.475146 [debug] [MainThread]: running dbt with arguments {'write_json': True, 'use_colors': True, 'printer_width': 80, 'version_check': True, 'partial_parse': True, 'static_parser': True, 'profiles_dir': '/Users/bruno.campos/.dbt', 'send_anonymous_usage_stats': True, 'event_buffer_size': 100000, 'quiet': False, 'no_print': False, 'config_dir': False, 'which': 'debug', 'indirect_selection': 'eager'} +10:31:46.475212 [debug] [MainThread]: Tracking: tracking +10:31:46.493447 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [, , ]} +10:31:46.535641 [debug] [MainThread]: Executing "git --help" +10:31:46.550129 [debug] [MainThread]: STDOUT: "b"usage: git [-v | --version] [-h | --help] [-C ] [-c =]\n [--exec-path[=]] [--html-path] [--man-path] [--info-path]\n [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]\n [--git-dir=] [--work-tree=] [--namespace=]\n [--super-prefix=] [--config-env==]\n []\n\nThese are common Git commands used in various situations:\n\nstart a working area (see also: git help tutorial)\n clone Clone a repository into a new directory\n init Create an empty Git repository or reinitialize an existing one\n\nwork on the current change (see also: git help everyday)\n add Add file contents to the index\n mv Move or rename a file, a directory, or a symlink\n restore Restore working tree files\n rm Remove files from the working tree and from the index\n\nexamine the history and state (see also: git help revisions)\n bisect Use binary search to find the commit that introduced a bug\n diff Show changes between commits, commit and working tree, etc\n grep Print lines matching a pattern\n log Show commit logs\n show Show various types of objects\n status Show the working tree status\n\ngrow, mark and tweak your common history\n branch List, create, or delete branches\n commit Record changes to the repository\n merge Join two or more development histories together\n rebase Reapply commits on top of another base tip\n reset Reset current HEAD to the specified state\n switch Switch branches\n tag Create, list, delete or verify a tag object signed with GPG\n\ncollaborate (see also: git help workflows)\n fetch Download objects and refs from another repository\n pull Fetch from and integrate with another repository or a local branch\n push Update remote refs along with associated objects\n\n'git help -a' and 'git help -g' list available subcommands and some\nconcept guides. See 'git help ' or 'git help '\nto read about a specific subcommand or concept.\nSee 'git help git' for an overview of the system.\n"" +10:31:46.550610 [debug] [MainThread]: STDERR: "b''" +10:31:46.554164 [debug] [MainThread]: Acquiring new postgres connection "debug" +10:31:46.554597 [debug] [MainThread]: Using postgres connection "debug" +10:31:46.554664 [debug] [MainThread]: On debug: select 1 as id +10:31:46.554736 [debug] [MainThread]: Opening a new connection, currently in state init +10:31:46.862049 [debug] [MainThread]: SQL status: SELECT 1 in 0.31 seconds +10:31:46.867655 [debug] [MainThread]: On debug: Close +10:31:46.868215 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [, , ]} +10:31:47.537882 [debug] [MainThread]: Connection 'debug' was properly closed. + + +============================== 2022-07-08 14:51:14.812917 | 743020ff-c185-48ca-a311-eb594eaaf8be ============================== +14:51:14.812940 [info ] [MainThread]: Running with dbt=1.1.1 +14:51:14.813482 [debug] [MainThread]: running dbt with arguments {'write_json': True, 'use_colors': True, 'printer_width': 80, 'version_check': True, 'partial_parse': True, 'static_parser': True, 'profiles_dir': '/Users/bruno.campos/.dbt', 'send_anonymous_usage_stats': True, 'event_buffer_size': 100000, 'quiet': False, 'no_print': False, 'which': 'run', 'rpc_method': 'run', 'indirect_selection': 'eager'} +14:51:14.813559 [debug] [MainThread]: Tracking: tracking +14:51:14.833981 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [, , ]} +14:51:14.845420 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [, , ]} + + +============================== 2022-07-08 14:53:54.000177 | 3730e3db-2124-418d-8bf7-57ea26603a03 ============================== +14:53:54.000202 [info ] [MainThread]: Running with dbt=1.1.1 +14:53:54.001355 [debug] [MainThread]: running dbt with arguments {'write_json': True, 'use_colors': True, 'printer_width': 80, 'version_check': True, 'partial_parse': True, 'static_parser': True, 'profiles_dir': '/Users/bruno.campos/.dbt', 'send_anonymous_usage_stats': True, 'event_buffer_size': 100000, 'quiet': False, 'no_print': False, 'which': 'run', 'rpc_method': 'run', 'indirect_selection': 'eager'} +14:53:54.001480 [debug] [MainThread]: Tracking: tracking +14:53:54.021685 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [, , ]} +14:53:54.041092 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 2 files added, 0 files changed. +14:53:54.041274 [debug] [MainThread]: Partial parsing: added file: wrkplay_dbt://models/wins_losses.sql +14:53:54.041403 [debug] [MainThread]: Partial parsing: added file: wrkplay_dbt://models/schema.yml +14:53:54.047493 [debug] [MainThread]: 1699: static parser successfully parsed wins_losses.sql +14:53:54.077888 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '3730e3db-2124-418d-8bf7-57ea26603a03', 'context': []} +14:53:54.081034 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '3730e3db-2124-418d-8bf7-57ea26603a03', 'context': []} +14:53:54.081185 [info ] [MainThread]: Found 3 models, 10 tests, 0 snapshots, 0 analyses, 167 macros, 0 operations, 0 seed files, 0 sources, 0 exposures, 0 metrics +14:53:54.081330 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '3730e3db-2124-418d-8bf7-57ea26603a03', 'context': []} +14:53:54.082073 [info ] [MainThread]: +14:53:54.082269 [debug] [MainThread]: Acquiring new postgres connection "master" +14:53:54.082665 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres" +14:53:54.086988 [debug] [ThreadPool]: Using postgres connection "list_postgres" +14:53:54.087066 [debug] [ThreadPool]: On list_postgres: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres"} */ + + select distinct nspname from pg_namespace + +14:53:54.087127 [debug] [ThreadPool]: Opening a new connection, currently in state init +14:53:54.625092 [debug] [ThreadPool]: SQL status: SELECT 10 in 0.54 seconds +14:53:54.629367 [debug] [ThreadPool]: On list_postgres: Close +14:53:54.630423 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres_public" +14:53:54.633807 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +14:53:54.633894 [debug] [ThreadPool]: On list_postgres_public: BEGIN +14:53:54.633953 [debug] [ThreadPool]: Opening a new connection, currently in state closed +14:53:55.048364 [debug] [ThreadPool]: SQL status: BEGIN in 0.41 seconds +14:53:55.049866 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +14:53:55.050327 [debug] [ThreadPool]: On list_postgres_public: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres_public"} */ +select + 'postgres' as database, + tablename as name, + schemaname as schema, + 'table' as type + from pg_tables + where schemaname ilike 'public' + union all + select + 'postgres' as database, + viewname as name, + schemaname as schema, + 'view' as type + from pg_views + where schemaname ilike 'public' + +14:53:55.080954 [debug] [ThreadPool]: SQL status: SELECT 18 in 0.03 seconds +14:53:55.085670 [debug] [ThreadPool]: On list_postgres_public: ROLLBACK +14:53:55.126185 [debug] [ThreadPool]: On list_postgres_public: Close +14:53:55.133824 [debug] [MainThread]: Using postgres connection "master" +14:53:55.133964 [debug] [MainThread]: On master: BEGIN +14:53:55.134029 [debug] [MainThread]: Opening a new connection, currently in state init +14:53:55.577062 [debug] [MainThread]: SQL status: BEGIN in 0.44 seconds +14:53:55.578155 [debug] [MainThread]: Using postgres connection "master" +14:53:55.578352 [debug] [MainThread]: On master: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "master"} */ +with relation as ( + select + pg_rewrite.ev_class as class, + pg_rewrite.oid as id + from pg_rewrite + ), + class as ( + select + oid as id, + relname as name, + relnamespace as schema, + relkind as kind + from pg_class + ), + dependency as ( + select distinct + pg_depend.objid as id, + pg_depend.refobjid as ref + from pg_depend + ), + schema as ( + select + pg_namespace.oid as id, + pg_namespace.nspname as name + from pg_namespace + where nspname != 'information_schema' and nspname not like 'pg\_%' + ), + referenced as ( + select + relation.id AS id, + referenced_class.name , + referenced_class.schema , + referenced_class.kind + from relation + join class as referenced_class on relation.class=referenced_class.id + where referenced_class.kind in ('r', 'v') + ), + relationships as ( + select + referenced.name as referenced_name, + referenced.schema as referenced_schema_id, + dependent_class.name as dependent_name, + dependent_class.schema as dependent_schema_id, + referenced.kind as kind + from referenced + join dependency on referenced.id=dependency.id + join class as dependent_class on dependency.ref=dependent_class.id + where + (referenced.name != dependent_class.name or + referenced.schema != dependent_class.schema) + ) + + select + referenced_schema.name as referenced_schema, + relationships.referenced_name as referenced_name, + dependent_schema.name as dependent_schema, + relationships.dependent_name as dependent_name + from relationships + join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id + join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id + group by referenced_schema, referenced_name, dependent_schema, dependent_name + order by referenced_schema, referenced_name, dependent_schema, dependent_name; +14:53:55.741989 [debug] [MainThread]: SQL status: SELECT 1 in 0.16 seconds +14:53:55.746773 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '3730e3db-2124-418d-8bf7-57ea26603a03', 'context': []} +14:53:55.747213 [debug] [MainThread]: On master: ROLLBACK +14:53:55.765799 [debug] [MainThread]: Using postgres connection "master" +14:53:55.766615 [debug] [MainThread]: On master: BEGIN +14:53:55.818021 [debug] [MainThread]: SQL status: BEGIN in 0.05 seconds +14:53:55.819101 [debug] [MainThread]: On master: COMMIT +14:53:55.819384 [debug] [MainThread]: Using postgres connection "master" +14:53:55.819703 [debug] [MainThread]: On master: COMMIT +14:53:55.839144 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +14:53:55.840009 [debug] [MainThread]: On master: Close +14:53:55.842060 [info ] [MainThread]: Concurrency: 10 threads (target='dev') +14:53:55.842548 [info ] [MainThread]: +14:53:55.848643 [debug] [Thread-1 ]: Began running node model.wrkplay_dbt.my_first_dbt_model +14:53:55.848772 [debug] [Thread-2 ]: Began running node model.wrkplay_dbt.wins_losses +14:53:55.848973 [info ] [Thread-1 ]: 1 of 3 START view model public.my_first_dbt_model .............................. [RUN] +14:53:55.849093 [info ] [Thread-2 ]: 2 of 3 START view model public.wins_losses ..................................... [RUN] +14:53:55.849349 [debug] [Thread-1 ]: Acquiring new postgres connection "model.wrkplay_dbt.my_first_dbt_model" +14:53:55.849522 [debug] [Thread-2 ]: Acquiring new postgres connection "model.wrkplay_dbt.wins_losses" +14:53:55.849596 [debug] [Thread-1 ]: Began compiling node model.wrkplay_dbt.my_first_dbt_model +14:53:55.849659 [debug] [Thread-2 ]: Began compiling node model.wrkplay_dbt.wins_losses +14:53:55.849764 [debug] [Thread-1 ]: Compiling model.wrkplay_dbt.my_first_dbt_model +14:53:55.849825 [debug] [Thread-2 ]: Compiling model.wrkplay_dbt.wins_losses +14:53:55.851626 [debug] [Thread-1 ]: Writing injected SQL for node "model.wrkplay_dbt.my_first_dbt_model" +14:53:55.852276 [debug] [Thread-2 ]: Writing injected SQL for node "model.wrkplay_dbt.wins_losses" +14:53:55.852941 [debug] [Thread-2 ]: finished collecting timing info +14:53:55.853055 [debug] [Thread-2 ]: Began executing node model.wrkplay_dbt.wins_losses +14:53:55.863672 [debug] [Thread-2 ]: Writing runtime SQL for node "model.wrkplay_dbt.wins_losses" +14:53:55.863764 [debug] [Thread-1 ]: finished collecting timing info +14:53:55.863867 [debug] [Thread-1 ]: Began executing node model.wrkplay_dbt.my_first_dbt_model +14:53:55.864964 [debug] [Thread-1 ]: Writing runtime SQL for node "model.wrkplay_dbt.my_first_dbt_model" +14:53:55.865136 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +14:53:55.865226 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: BEGIN +14:53:55.865293 [debug] [Thread-2 ]: Opening a new connection, currently in state init +14:53:55.865353 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +14:53:55.865482 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: BEGIN +14:53:55.865535 [debug] [Thread-1 ]: Opening a new connection, currently in state closed +14:53:56.214600 [debug] [Thread-1 ]: SQL status: BEGIN in 0.35 seconds +14:53:56.215955 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +14:53:56.216338 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ + + create view "postgres"."public"."my_first_dbt_model__dbt_tmp" as ( + /* + 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 + ); +14:53:56.249061 [debug] [Thread-1 ]: SQL status: CREATE VIEW in 0.03 seconds +14:53:56.249500 [debug] [Thread-2 ]: SQL status: BEGIN in 0.38 seconds +14:53:56.259313 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +14:53:56.259403 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +14:53:56.259493 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ +alter table "postgres"."public"."my_first_dbt_model" rename to "my_first_dbt_model__dbt_backup" +14:53:56.259552 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ + + create view "postgres"."public"."wins_losses__dbt_tmp" as ( + --number of wins and losses per player per game (per office) per season +WITH loss_table AS ( + SELECT + SUM(lt.left_losses) AS "total_losses" + , lt.left_player_id AS "loss_player_id" + , lt.gameid + , lt.seasonid + FROM + ( + SELECT + * + FROM + ( + --Begin DONE + WITH left_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore > m.rightscore THEN 0 + ELSE 1 + END) AS "left_loss" + , l."A" + , l."B" + , m."gameid" + , m."seasonid" + FROM + "_left" l + JOIN "Match" m ON + l."A" = m.id + GROUP BY + l."A" + , l."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.left_loss) AS "left_losses" + , a."B" AS "left_player_id" + , a."gameid" + , a."seasonid" + FROM + left_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + --End DONE + ) ll + UNION ALL + SELECT + * + FROM + ( + --Begin DONE + WITH right_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore < m.rightscore THEN 0 + ELSE 1 + END) AS "right_loss" + , r."A" + , r."B" + , m."gameid" + , m."seasonid" + FROM + "_right" r + JOIN "Match" m ON + r."A" = m.id + GROUP BY + r."A" + , r."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.right_loss) AS "right_losses" + , a."B" AS "right_player_id" + , a."gameid" + , a."seasonid" + FROM + right_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + --End DONE + ) rl + ) lt + -- WHERE lt.left_player_id = '' + GROUP BY + lt.left_player_id + , lt.gameid + , lt.seasonid +) +, +win_table AS ( + --number of wins for a player and gameid + SELECT + SUM(rt.right_wins) AS "total_wins" + , rt.right_player_id AS "win_player_id" + , rt.gameid + , rt."seasonid" + FROM + ( + SELECT + * + FROM + ( + WITH right_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore < m.rightscore THEN 1 + ELSE 0 + END) AS "right_won" + , r."A" + , r."B" + , m."gameid" + , m."seasonid" + FROM + "_right" r + JOIN "Match" m ON + r."A" = m.id + GROUP BY + r."A" + , r."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.right_won) AS "right_wins" + , a."B" AS "right_player_id" + , a."gameid" + , a."seasonid" + FROM + right_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + ) rw + UNION ALL + SELECT + * + FROM + ( + WITH left_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore > m.rightscore THEN 1 + ELSE 0 + END) AS "left_won" + , l."A" + , l."B" + , m."gameid" + , m."seasonid" + FROM + "_left" l + JOIN "Match" m ON + l."A" = m.id + GROUP BY + l."A" + , l."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.left_won) AS "left_wins" + , a."B" AS "left_player_id" + , a."gameid" + , a."seasonid" + FROM + left_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + ) lw + ) rt + -- WHERE rt.right_player_id = '' + GROUP BY + rt.right_player_id + , rt.gameid + , rt."seasonid" +) +SELECT + COALESCE(lt.loss_player_id, wt.win_player_id) AS "player_id" + , COALESCE(lt."gameid", wt."gameid") AS "gameid" + , COALESCE(lt.seasonid, wt.seasonid) AS "seasonid" + , wt."total_wins" + , lt."total_losses" +FROM + loss_table lt +FULL OUTER JOIN win_table wt ON + lt."loss_player_id" = wt."win_player_id" + AND lt."gameid" = wt."gameid" + AND lt."seasonid" = wt."seasonid" + ); +14:53:56.278438 [debug] [Thread-1 ]: SQL status: ALTER TABLE in 0.02 seconds +14:53:56.303204 [debug] [Thread-2 ]: SQL status: CREATE VIEW in 0.04 seconds +14:53:56.303767 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +14:53:56.304769 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +14:53:56.304850 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ +alter table "postgres"."public"."my_first_dbt_model__dbt_tmp" rename to "my_first_dbt_model" +14:53:56.304911 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ +alter table "postgres"."public"."wins_losses__dbt_tmp" rename to "wins_losses" +14:53:56.411620 [debug] [Thread-1 ]: SQL status: ALTER TABLE in 0.11 seconds +14:53:56.414103 [debug] [Thread-2 ]: SQL status: ALTER TABLE in 0.11 seconds +14:53:56.424057 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: COMMIT +14:53:56.424737 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: COMMIT +14:53:56.424833 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +14:53:56.424899 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +14:53:56.424958 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: COMMIT +14:53:56.425013 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: COMMIT +14:53:56.443822 [debug] [Thread-1 ]: SQL status: COMMIT in 0.02 seconds +14:53:56.450382 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +14:53:56.450522 [debug] [Thread-2 ]: SQL status: COMMIT in 0.03 seconds +14:53:56.450607 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ +drop view if exists "postgres"."public"."my_first_dbt_model__dbt_backup" cascade +14:53:56.451409 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +14:53:56.451557 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ +drop view if exists "postgres"."public"."wins_losses__dbt_backup" cascade +14:53:56.495968 [debug] [Thread-1 ]: SQL status: DROP VIEW in 0.04 seconds +14:53:56.496431 [debug] [Thread-2 ]: SQL status: DROP VIEW in 0.04 seconds +14:53:56.499747 [debug] [Thread-1 ]: finished collecting timing info +14:53:56.501673 [debug] [Thread-2 ]: finished collecting timing info +14:53:56.502328 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: Close +14:53:56.502559 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: Close +14:53:56.503076 [debug] [Thread-1 ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '3730e3db-2124-418d-8bf7-57ea26603a03', 'context': []} +14:53:56.503266 [debug] [Thread-2 ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '3730e3db-2124-418d-8bf7-57ea26603a03', 'context': []} +14:53:56.503507 [info ] [Thread-1 ]: 1 of 3 OK created view model public.my_first_dbt_model ......................... [CREATE VIEW in 0.65s] +14:53:56.503661 [info ] [Thread-2 ]: 2 of 3 OK created view model public.wins_losses ................................ [CREATE VIEW in 0.65s] +14:53:56.503921 [debug] [Thread-1 ]: Finished running node model.wrkplay_dbt.my_first_dbt_model +14:53:56.504080 [debug] [Thread-2 ]: Finished running node model.wrkplay_dbt.wins_losses +14:53:56.504400 [debug] [Thread-2 ]: Began running node model.wrkplay_dbt.my_second_dbt_model +14:53:56.504510 [info ] [Thread-2 ]: 3 of 3 START view model public.my_second_dbt_model ............................. [RUN] +14:53:56.504710 [debug] [Thread-2 ]: Acquiring new postgres connection "model.wrkplay_dbt.my_second_dbt_model" +14:53:56.504782 [debug] [Thread-2 ]: Began compiling node model.wrkplay_dbt.my_second_dbt_model +14:53:56.504863 [debug] [Thread-2 ]: Compiling model.wrkplay_dbt.my_second_dbt_model +14:53:56.506492 [debug] [Thread-2 ]: Writing injected SQL for node "model.wrkplay_dbt.my_second_dbt_model" +14:53:56.506833 [debug] [Thread-2 ]: finished collecting timing info +14:53:56.506924 [debug] [Thread-2 ]: Began executing node model.wrkplay_dbt.my_second_dbt_model +14:53:56.508107 [debug] [Thread-2 ]: Writing runtime SQL for node "model.wrkplay_dbt.my_second_dbt_model" +14:53:56.508309 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +14:53:56.508374 [debug] [Thread-2 ]: On model.wrkplay_dbt.my_second_dbt_model: BEGIN +14:53:56.508427 [debug] [Thread-2 ]: Opening a new connection, currently in state closed +14:53:56.739241 [debug] [Thread-2 ]: SQL status: BEGIN in 0.23 seconds +14:53:56.740719 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +14:53:56.741103 [debug] [Thread-2 ]: On model.wrkplay_dbt.my_second_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_second_dbt_model"} */ + + create view "postgres"."public"."my_second_dbt_model__dbt_tmp" as ( + -- Use the `ref` function to select from other models + +select * +from "postgres"."public"."my_first_dbt_model" +where id = 1 + ); +14:53:56.762489 [debug] [Thread-2 ]: SQL status: CREATE VIEW in 0.02 seconds +14:53:56.768302 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +14:53:56.768510 [debug] [Thread-2 ]: On model.wrkplay_dbt.my_second_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_second_dbt_model"} */ +alter table "postgres"."public"."my_second_dbt_model__dbt_tmp" rename to "my_second_dbt_model" +14:53:56.814770 [debug] [Thread-2 ]: SQL status: ALTER TABLE in 0.05 seconds +14:53:56.818733 [debug] [Thread-2 ]: On model.wrkplay_dbt.my_second_dbt_model: COMMIT +14:53:56.818978 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +14:53:56.819232 [debug] [Thread-2 ]: On model.wrkplay_dbt.my_second_dbt_model: COMMIT +14:53:56.839798 [debug] [Thread-2 ]: SQL status: COMMIT in 0.02 seconds +14:53:56.843874 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +14:53:56.843978 [debug] [Thread-2 ]: On model.wrkplay_dbt.my_second_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_second_dbt_model"} */ +drop view if exists "postgres"."public"."my_second_dbt_model__dbt_backup" cascade +14:53:56.861618 [debug] [Thread-2 ]: SQL status: DROP VIEW in 0.02 seconds +14:53:56.862586 [debug] [Thread-2 ]: finished collecting timing info +14:53:56.862695 [debug] [Thread-2 ]: On model.wrkplay_dbt.my_second_dbt_model: Close +14:53:56.863138 [debug] [Thread-2 ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '3730e3db-2124-418d-8bf7-57ea26603a03', 'context': []} +14:53:56.863381 [info ] [Thread-2 ]: 3 of 3 OK created view model public.my_second_dbt_model ........................ [CREATE VIEW in 0.36s] +14:53:56.863639 [debug] [Thread-2 ]: Finished running node model.wrkplay_dbt.my_second_dbt_model +14:53:56.864650 [debug] [MainThread]: Acquiring new postgres connection "master" +14:53:56.864808 [debug] [MainThread]: Using postgres connection "master" +14:53:56.864876 [debug] [MainThread]: On master: BEGIN +14:53:56.864935 [debug] [MainThread]: Opening a new connection, currently in state closed +14:53:57.262853 [debug] [MainThread]: SQL status: BEGIN in 0.4 seconds +14:53:57.263384 [debug] [MainThread]: On master: COMMIT +14:53:57.263562 [debug] [MainThread]: Using postgres connection "master" +14:53:57.263726 [debug] [MainThread]: On master: COMMIT +14:53:57.281912 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +14:53:57.282406 [debug] [MainThread]: On master: Close +14:53:57.283235 [info ] [MainThread]: +14:53:57.283565 [info ] [MainThread]: Finished running 3 view models in 3.20s. +14:53:57.283828 [debug] [MainThread]: Connection 'master' was properly closed. +14:53:57.283977 [debug] [MainThread]: Connection 'model.wrkplay_dbt.my_first_dbt_model' was properly closed. +14:53:57.284119 [debug] [MainThread]: Connection 'model.wrkplay_dbt.my_second_dbt_model' was properly closed. +14:53:57.290112 [info ] [MainThread]: +14:53:57.290280 [info ] [MainThread]: Completed successfully +14:53:57.290399 [info ] [MainThread]: +14:53:57.290486 [info ] [MainThread]: Done. PASS=3 WARN=0 ERROR=0 SKIP=0 TOTAL=3 +14:53:57.290623 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [, , ]} + + +============================== 2022-07-08 15:21:45.635234 | d2c16bcc-ac86-46db-a9aa-1cd82dcc8a3f ============================== +15:21:45.635259 [info ] [MainThread]: Running with dbt=1.1.1 +15:21:45.635902 [debug] [MainThread]: running dbt with arguments {'write_json': True, 'use_colors': True, 'printer_width': 80, 'version_check': True, 'partial_parse': True, 'static_parser': True, 'profiles_dir': '/Users/bruno.campos/.dbt', 'send_anonymous_usage_stats': True, 'event_buffer_size': 100000, 'quiet': False, 'no_print': False, 'which': 'run', 'rpc_method': 'run', 'indirect_selection': 'eager'} +15:21:45.635995 [debug] [MainThread]: Tracking: tracking +15:21:45.662596 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [, , ]} +15:21:45.680887 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 1 files changed. +15:21:45.681131 [debug] [MainThread]: Partial parsing: updated file: wrkplay_dbt://models/wins_losses.sql +15:21:45.688543 [debug] [MainThread]: 1699: static parser successfully parsed wins_losses.sql +15:21:45.717451 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': 'd2c16bcc-ac86-46db-a9aa-1cd82dcc8a3f', 'context': []} +15:21:45.720806 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': 'd2c16bcc-ac86-46db-a9aa-1cd82dcc8a3f', 'context': []} +15:21:45.720947 [info ] [MainThread]: Found 3 models, 10 tests, 0 snapshots, 0 analyses, 167 macros, 0 operations, 0 seed files, 0 sources, 0 exposures, 0 metrics +15:21:45.721087 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': 'd2c16bcc-ac86-46db-a9aa-1cd82dcc8a3f', 'context': []} +15:21:45.721781 [info ] [MainThread]: +15:21:45.721995 [debug] [MainThread]: Acquiring new postgres connection "master" +15:21:45.722375 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres" +15:21:45.726603 [debug] [ThreadPool]: Using postgres connection "list_postgres" +15:21:45.726706 [debug] [ThreadPool]: On list_postgres: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres"} */ + + select distinct nspname from pg_namespace + +15:21:45.726776 [debug] [ThreadPool]: Opening a new connection, currently in state init +15:21:46.005364 [debug] [ThreadPool]: SQL status: SELECT 10 in 0.28 seconds +15:21:46.010288 [debug] [ThreadPool]: On list_postgres: Close +15:21:46.011417 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres_public" +15:21:46.014928 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +15:21:46.015012 [debug] [ThreadPool]: On list_postgres_public: BEGIN +15:21:46.015073 [debug] [ThreadPool]: Opening a new connection, currently in state closed +15:21:46.206908 [debug] [ThreadPool]: SQL status: BEGIN in 0.19 seconds +15:21:46.207404 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +15:21:46.207726 [debug] [ThreadPool]: On list_postgres_public: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres_public"} */ +select + 'postgres' as database, + tablename as name, + schemaname as schema, + 'table' as type + from pg_tables + where schemaname ilike 'public' + union all + select + 'postgres' as database, + viewname as name, + schemaname as schema, + 'view' as type + from pg_views + where schemaname ilike 'public' + +15:21:46.230220 [debug] [ThreadPool]: SQL status: SELECT 19 in 0.02 seconds +15:21:46.233607 [debug] [ThreadPool]: On list_postgres_public: ROLLBACK +15:21:46.251820 [debug] [ThreadPool]: On list_postgres_public: Close +15:21:46.259790 [debug] [MainThread]: Using postgres connection "master" +15:21:46.259998 [debug] [MainThread]: On master: BEGIN +15:21:46.260065 [debug] [MainThread]: Opening a new connection, currently in state init +15:21:46.437986 [debug] [MainThread]: SQL status: BEGIN in 0.18 seconds +15:21:46.438700 [debug] [MainThread]: Using postgres connection "master" +15:21:46.439051 [debug] [MainThread]: On master: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "master"} */ +with relation as ( + select + pg_rewrite.ev_class as class, + pg_rewrite.oid as id + from pg_rewrite + ), + class as ( + select + oid as id, + relname as name, + relnamespace as schema, + relkind as kind + from pg_class + ), + dependency as ( + select distinct + pg_depend.objid as id, + pg_depend.refobjid as ref + from pg_depend + ), + schema as ( + select + pg_namespace.oid as id, + pg_namespace.nspname as name + from pg_namespace + where nspname != 'information_schema' and nspname not like 'pg\_%' + ), + referenced as ( + select + relation.id AS id, + referenced_class.name , + referenced_class.schema , + referenced_class.kind + from relation + join class as referenced_class on relation.class=referenced_class.id + where referenced_class.kind in ('r', 'v') + ), + relationships as ( + select + referenced.name as referenced_name, + referenced.schema as referenced_schema_id, + dependent_class.name as dependent_name, + dependent_class.schema as dependent_schema_id, + referenced.kind as kind + from referenced + join dependency on referenced.id=dependency.id + join class as dependent_class on dependency.ref=dependent_class.id + where + (referenced.name != dependent_class.name or + referenced.schema != dependent_class.schema) + ) + + select + referenced_schema.name as referenced_schema, + relationships.referenced_name as referenced_name, + dependent_schema.name as dependent_schema, + relationships.dependent_name as dependent_name + from relationships + join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id + join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id + group by referenced_schema, referenced_name, dependent_schema, dependent_name + order by referenced_schema, referenced_name, dependent_schema, dependent_name; +15:21:46.605211 [debug] [MainThread]: SQL status: SELECT 4 in 0.17 seconds +15:21:46.607950 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': 'd2c16bcc-ac86-46db-a9aa-1cd82dcc8a3f', 'context': []} +15:21:46.608369 [debug] [MainThread]: On master: ROLLBACK +15:21:46.626392 [debug] [MainThread]: Using postgres connection "master" +15:21:46.627167 [debug] [MainThread]: On master: BEGIN +15:21:46.664576 [debug] [MainThread]: SQL status: BEGIN in 0.04 seconds +15:21:46.665299 [debug] [MainThread]: On master: COMMIT +15:21:46.665524 [debug] [MainThread]: Using postgres connection "master" +15:21:46.665721 [debug] [MainThread]: On master: COMMIT +15:21:46.683106 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +15:21:46.683483 [debug] [MainThread]: On master: Close +15:21:46.684209 [info ] [MainThread]: Concurrency: 10 threads (target='dev') +15:21:46.684574 [info ] [MainThread]: +15:21:46.689739 [debug] [Thread-1 ]: Began running node model.wrkplay_dbt.my_first_dbt_model +15:21:46.689930 [info ] [Thread-1 ]: 1 of 3 START view model public.my_first_dbt_model .............................. [RUN] +15:21:46.690150 [debug] [Thread-1 ]: Acquiring new postgres connection "model.wrkplay_dbt.my_first_dbt_model" +15:21:46.690221 [debug] [Thread-1 ]: Began compiling node model.wrkplay_dbt.my_first_dbt_model +15:21:46.690291 [debug] [Thread-1 ]: Compiling model.wrkplay_dbt.my_first_dbt_model +15:21:46.691462 [debug] [Thread-1 ]: Writing injected SQL for node "model.wrkplay_dbt.my_first_dbt_model" +15:21:46.691601 [debug] [Thread-2 ]: Began running node model.wrkplay_dbt.wins_losses +15:21:46.691727 [info ] [Thread-2 ]: 2 of 3 START table model public.wins_losses .................................... [RUN] +15:21:46.691928 [debug] [Thread-2 ]: Acquiring new postgres connection "model.wrkplay_dbt.wins_losses" +15:21:46.691991 [debug] [Thread-2 ]: Began compiling node model.wrkplay_dbt.wins_losses +15:21:46.692050 [debug] [Thread-2 ]: Compiling model.wrkplay_dbt.wins_losses +15:21:46.693250 [debug] [Thread-2 ]: Writing injected SQL for node "model.wrkplay_dbt.wins_losses" +15:21:46.693608 [debug] [Thread-1 ]: finished collecting timing info +15:21:46.693684 [debug] [Thread-1 ]: Began executing node model.wrkplay_dbt.my_first_dbt_model +15:21:46.704169 [debug] [Thread-1 ]: Writing runtime SQL for node "model.wrkplay_dbt.my_first_dbt_model" +15:21:46.704262 [debug] [Thread-2 ]: finished collecting timing info +15:21:46.704418 [debug] [Thread-2 ]: Began executing node model.wrkplay_dbt.wins_losses +15:21:46.714601 [debug] [Thread-2 ]: Writing runtime SQL for node "model.wrkplay_dbt.wins_losses" +15:21:46.714716 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +15:21:46.714810 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: BEGIN +15:21:46.714888 [debug] [Thread-1 ]: Opening a new connection, currently in state closed +15:21:46.715026 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +15:21:46.715082 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: BEGIN +15:21:46.715132 [debug] [Thread-2 ]: Opening a new connection, currently in state init +15:21:46.892816 [debug] [Thread-1 ]: SQL status: BEGIN in 0.18 seconds +15:21:46.893830 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +15:21:46.894052 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ + + create view "postgres"."public"."my_first_dbt_model__dbt_tmp" as ( + /* + 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 + ); +15:21:46.913020 [debug] [Thread-2 ]: SQL status: BEGIN in 0.2 seconds +15:21:46.913908 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +15:21:46.914268 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ + + + create table "postgres"."public"."wins_losses__dbt_tmp" + as ( + + +--number of wins and losses per player per game (per office) per season +WITH loss_table AS ( + SELECT + SUM(lt.left_losses) AS "total_losses" + , lt.left_player_id AS "loss_player_id" + , lt.gameid + , lt.seasonid + FROM + ( + SELECT + * + FROM + ( + --Begin DONE + WITH left_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore > m.rightscore THEN 0 + ELSE 1 + END) AS "left_loss" + , l."A" + , l."B" + , m."gameid" + , m."seasonid" + FROM + "_left" l + JOIN "Match" m ON + l."A" = m.id + GROUP BY + l."A" + , l."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.left_loss) AS "left_losses" + , a."B" AS "left_player_id" + , a."gameid" + , a."seasonid" + FROM + left_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + --End DONE + ) ll + UNION ALL + SELECT + * + FROM + ( + --Begin DONE + WITH right_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore < m.rightscore THEN 0 + ELSE 1 + END) AS "right_loss" + , r."A" + , r."B" + , m."gameid" + , m."seasonid" + FROM + "_right" r + JOIN "Match" m ON + r."A" = m.id + GROUP BY + r."A" + , r."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.right_loss) AS "right_losses" + , a."B" AS "right_player_id" + , a."gameid" + , a."seasonid" + FROM + right_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + --End DONE + ) rl + ) lt + -- WHERE lt.left_player_id = '' + GROUP BY + lt.left_player_id + , lt.gameid + , lt.seasonid +) +, +win_table AS ( + --number of wins for a player and gameid + SELECT + SUM(rt.right_wins) AS "total_wins" + , rt.right_player_id AS "win_player_id" + , rt.gameid + , rt."seasonid" + FROM + ( + SELECT + * + FROM + ( + WITH right_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore < m.rightscore THEN 1 + ELSE 0 + END) AS "right_won" + , r."A" + , r."B" + , m."gameid" + , m."seasonid" + FROM + "_right" r + JOIN "Match" m ON + r."A" = m.id + GROUP BY + r."A" + , r."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.right_won) AS "right_wins" + , a."B" AS "right_player_id" + , a."gameid" + , a."seasonid" + FROM + right_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + ) rw + UNION ALL + SELECT + * + FROM + ( + WITH left_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore > m.rightscore THEN 1 + ELSE 0 + END) AS "left_won" + , l."A" + , l."B" + , m."gameid" + , m."seasonid" + FROM + "_left" l + JOIN "Match" m ON + l."A" = m.id + GROUP BY + l."A" + , l."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.left_won) AS "left_wins" + , a."B" AS "left_player_id" + , a."gameid" + , a."seasonid" + FROM + left_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + ) lw + ) rt + -- WHERE rt.right_player_id = '' + GROUP BY + rt.right_player_id + , rt.gameid + , rt."seasonid" +) +SELECT + COALESCE(lt.loss_player_id, wt.win_player_id) AS "player_id" + , COALESCE(lt."gameid", wt."gameid") AS "gameid" + , COALESCE(lt.seasonid, wt.seasonid) AS "seasonid" + , wt."total_wins" + , lt."total_losses" +FROM + loss_table lt +FULL OUTER JOIN win_table wt ON + lt."loss_player_id" = wt."win_player_id" + AND lt."gameid" = wt."gameid" + AND lt."seasonid" = wt."seasonid" + ); +15:21:46.915654 [debug] [Thread-1 ]: SQL status: CREATE VIEW in 0.02 seconds +15:21:46.954736 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +15:21:46.954895 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ +alter table "postgres"."public"."my_first_dbt_model" rename to "my_first_dbt_model__dbt_backup" +15:21:46.959302 [debug] [Thread-2 ]: SQL status: SELECT 190 in 0.04 seconds +15:21:46.960343 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +15:21:46.960412 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ +alter table "postgres"."public"."wins_losses" rename to "wins_losses__dbt_backup" +15:21:46.973154 [debug] [Thread-1 ]: SQL status: ALTER TABLE in 0.02 seconds +15:21:46.974025 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +15:21:46.974082 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ +alter table "postgres"."public"."my_first_dbt_model__dbt_tmp" rename to "my_first_dbt_model" +15:21:46.980057 [debug] [Thread-2 ]: SQL status: ALTER TABLE in 0.02 seconds +15:21:46.980906 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +15:21:46.980963 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ +alter table "postgres"."public"."wins_losses__dbt_tmp" rename to "wins_losses" +15:21:46.992211 [debug] [Thread-1 ]: SQL status: ALTER TABLE in 0.02 seconds +15:21:46.995054 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: COMMIT +15:21:46.995128 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +15:21:46.995182 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: COMMIT +15:21:46.999520 [debug] [Thread-2 ]: SQL status: ALTER TABLE in 0.02 seconds +15:21:47.001792 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: COMMIT +15:21:47.001857 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +15:21:47.001910 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: COMMIT +15:21:47.013855 [debug] [Thread-1 ]: SQL status: COMMIT in 0.02 seconds +15:21:47.015829 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +15:21:47.015898 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ +drop view if exists "postgres"."public"."my_first_dbt_model__dbt_backup" cascade +15:21:47.021227 [debug] [Thread-2 ]: SQL status: COMMIT in 0.02 seconds +15:21:47.021873 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +15:21:47.021931 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ +drop view if exists "postgres"."public"."wins_losses__dbt_backup" cascade +15:21:47.036480 [debug] [Thread-1 ]: SQL status: DROP VIEW in 0.02 seconds +15:21:47.036925 [debug] [Thread-1 ]: finished collecting timing info +15:21:47.037000 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: Close +15:21:47.037231 [debug] [Thread-1 ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd2c16bcc-ac86-46db-a9aa-1cd82dcc8a3f', 'context': []} +15:21:47.037381 [info ] [Thread-1 ]: 1 of 3 OK created view model public.my_first_dbt_model ......................... [CREATE VIEW in 0.35s] +15:21:47.037559 [debug] [Thread-1 ]: Finished running node model.wrkplay_dbt.my_first_dbt_model +15:21:47.037725 [debug] [Thread-4 ]: Began running node model.wrkplay_dbt.my_second_dbt_model +15:21:47.037823 [info ] [Thread-4 ]: 3 of 3 START view model public.my_second_dbt_model ............................. [RUN] +15:21:47.037987 [debug] [Thread-4 ]: Acquiring new postgres connection "model.wrkplay_dbt.my_second_dbt_model" +15:21:47.038048 [debug] [Thread-4 ]: Began compiling node model.wrkplay_dbt.my_second_dbt_model +15:21:47.038105 [debug] [Thread-4 ]: Compiling model.wrkplay_dbt.my_second_dbt_model +15:21:47.039067 [debug] [Thread-4 ]: Writing injected SQL for node "model.wrkplay_dbt.my_second_dbt_model" +15:21:47.039378 [debug] [Thread-4 ]: finished collecting timing info +15:21:47.039439 [debug] [Thread-4 ]: Began executing node model.wrkplay_dbt.my_second_dbt_model +15:21:47.040513 [debug] [Thread-4 ]: Writing runtime SQL for node "model.wrkplay_dbt.my_second_dbt_model" +15:21:47.040705 [debug] [Thread-4 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +15:21:47.040768 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: BEGIN +15:21:47.040817 [debug] [Thread-4 ]: Opening a new connection, currently in state init +15:21:47.044321 [debug] [Thread-2 ]: SQL status: DROP VIEW in 0.02 seconds +15:21:47.044773 [debug] [Thread-2 ]: finished collecting timing info +15:21:47.044842 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: Close +15:21:47.045054 [debug] [Thread-2 ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd2c16bcc-ac86-46db-a9aa-1cd82dcc8a3f', 'context': []} +15:21:47.045178 [info ] [Thread-2 ]: 2 of 3 OK created table model public.wins_losses ............................... [SELECT 190 in 0.35s] +15:21:47.045337 [debug] [Thread-2 ]: Finished running node model.wrkplay_dbt.wins_losses +15:21:47.240405 [debug] [Thread-4 ]: SQL status: BEGIN in 0.2 seconds +15:21:47.240939 [debug] [Thread-4 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +15:21:47.241199 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_second_dbt_model"} */ + + create view "postgres"."public"."my_second_dbt_model__dbt_tmp" as ( + -- Use the `ref` function to select from other models + +select * +from "postgres"."public"."my_first_dbt_model" +where id = 1 + ); +15:21:47.261583 [debug] [Thread-4 ]: SQL status: CREATE VIEW in 0.02 seconds +15:21:47.265937 [debug] [Thread-4 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +15:21:47.266339 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_second_dbt_model"} */ +alter table "postgres"."public"."my_second_dbt_model__dbt_tmp" rename to "my_second_dbt_model" +15:21:47.284702 [debug] [Thread-4 ]: SQL status: ALTER TABLE in 0.02 seconds +15:21:47.288055 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: COMMIT +15:21:47.288362 [debug] [Thread-4 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +15:21:47.288547 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: COMMIT +15:21:47.307055 [debug] [Thread-4 ]: SQL status: COMMIT in 0.02 seconds +15:21:47.312147 [debug] [Thread-4 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +15:21:47.312718 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_second_dbt_model"} */ +drop view if exists "postgres"."public"."my_second_dbt_model__dbt_backup" cascade +15:21:47.329928 [debug] [Thread-4 ]: SQL status: DROP VIEW in 0.02 seconds +15:21:47.331906 [debug] [Thread-4 ]: finished collecting timing info +15:21:47.332158 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: Close +15:21:47.332885 [debug] [Thread-4 ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'd2c16bcc-ac86-46db-a9aa-1cd82dcc8a3f', 'context': []} +15:21:47.333324 [info ] [Thread-4 ]: 3 of 3 OK created view model public.my_second_dbt_model ........................ [CREATE VIEW in 0.29s] +15:21:47.333912 [debug] [Thread-4 ]: Finished running node model.wrkplay_dbt.my_second_dbt_model +15:21:47.335220 [debug] [MainThread]: Acquiring new postgres connection "master" +15:21:47.335387 [debug] [MainThread]: Using postgres connection "master" +15:21:47.335451 [debug] [MainThread]: On master: BEGIN +15:21:47.335505 [debug] [MainThread]: Opening a new connection, currently in state closed +15:21:47.524345 [debug] [MainThread]: SQL status: BEGIN in 0.19 seconds +15:21:47.525073 [debug] [MainThread]: On master: COMMIT +15:21:47.525437 [debug] [MainThread]: Using postgres connection "master" +15:21:47.525774 [debug] [MainThread]: On master: COMMIT +15:21:47.547050 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +15:21:47.547635 [debug] [MainThread]: On master: Close +15:21:47.548824 [info ] [MainThread]: +15:21:47.549510 [info ] [MainThread]: Finished running 2 view models, 1 table model in 1.83s. +15:21:47.550096 [debug] [MainThread]: Connection 'master' was properly closed. +15:21:47.550412 [debug] [MainThread]: Connection 'model.wrkplay_dbt.my_first_dbt_model' was properly closed. +15:21:47.550714 [debug] [MainThread]: Connection 'model.wrkplay_dbt.wins_losses' was properly closed. +15:21:47.550888 [debug] [MainThread]: Connection 'model.wrkplay_dbt.my_second_dbt_model' was properly closed. +15:21:47.555857 [info ] [MainThread]: +15:21:47.556047 [info ] [MainThread]: Completed successfully +15:21:47.556180 [info ] [MainThread]: +15:21:47.556275 [info ] [MainThread]: Done. PASS=3 WARN=0 ERROR=0 SKIP=0 TOTAL=3 +15:21:47.556448 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [, , ]} + + +============================== 2022-07-08 15:26:00.480355 | a64aca8e-9649-4e28-87de-0655145090d2 ============================== +15:26:00.480375 [info ] [MainThread]: Running with dbt=1.1.1 +15:26:00.481048 [debug] [MainThread]: running dbt with arguments {'write_json': True, 'use_colors': True, 'printer_width': 80, 'version_check': True, 'partial_parse': True, 'static_parser': True, 'profiles_dir': '/Users/bruno.campos/.dbt', 'send_anonymous_usage_stats': True, 'event_buffer_size': 100000, 'quiet': False, 'no_print': False, 'indirect_selection': 'eager', 'which': 'test', 'rpc_method': 'test'} +15:26:00.481153 [debug] [MainThread]: Tracking: tracking +15:26:00.504072 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [, , ]} +15:26:00.526829 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 0 files changed. +15:26:00.526981 [debug] [MainThread]: Partial parsing enabled, no changes found, skipping parsing +15:26:00.531052 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': 'a64aca8e-9649-4e28-87de-0655145090d2', 'context': []} +15:26:00.535107 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': 'a64aca8e-9649-4e28-87de-0655145090d2', 'context': []} +15:26:00.535300 [info ] [MainThread]: Found 3 models, 10 tests, 0 snapshots, 0 analyses, 167 macros, 0 operations, 0 seed files, 0 sources, 0 exposures, 0 metrics +15:26:00.535435 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': 'a64aca8e-9649-4e28-87de-0655145090d2', 'context': []} +15:26:00.536291 [info ] [MainThread]: +15:26:00.536528 [debug] [MainThread]: Acquiring new postgres connection "master" +15:26:00.537160 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres_public" +15:26:00.542327 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +15:26:00.542433 [debug] [ThreadPool]: On list_postgres_public: BEGIN +15:26:00.542498 [debug] [ThreadPool]: Opening a new connection, currently in state init +15:26:00.807206 [debug] [ThreadPool]: SQL status: BEGIN in 0.26 seconds +15:26:00.810002 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +15:26:00.812748 [debug] [ThreadPool]: On list_postgres_public: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres_public"} */ +select + 'postgres' as database, + tablename as name, + schemaname as schema, + 'table' as type + from pg_tables + where schemaname ilike 'public' + union all + select + 'postgres' as database, + viewname as name, + schemaname as schema, + 'view' as type + from pg_views + where schemaname ilike 'public' + +15:26:00.836261 [debug] [ThreadPool]: SQL status: SELECT 19 in 0.02 seconds +15:26:00.852177 [debug] [ThreadPool]: On list_postgres_public: ROLLBACK +15:26:00.873209 [debug] [ThreadPool]: On list_postgres_public: Close +15:26:00.890108 [debug] [MainThread]: Using postgres connection "master" +15:26:00.890744 [debug] [MainThread]: On master: BEGIN +15:26:00.891145 [debug] [MainThread]: Opening a new connection, currently in state init +15:26:01.104360 [debug] [MainThread]: SQL status: BEGIN in 0.21 seconds +15:26:01.104959 [debug] [MainThread]: Using postgres connection "master" +15:26:01.105237 [debug] [MainThread]: On master: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "master"} */ +with relation as ( + select + pg_rewrite.ev_class as class, + pg_rewrite.oid as id + from pg_rewrite + ), + class as ( + select + oid as id, + relname as name, + relnamespace as schema, + relkind as kind + from pg_class + ), + dependency as ( + select distinct + pg_depend.objid as id, + pg_depend.refobjid as ref + from pg_depend + ), + schema as ( + select + pg_namespace.oid as id, + pg_namespace.nspname as name + from pg_namespace + where nspname != 'information_schema' and nspname not like 'pg\_%' + ), + referenced as ( + select + relation.id AS id, + referenced_class.name , + referenced_class.schema , + referenced_class.kind + from relation + join class as referenced_class on relation.class=referenced_class.id + where referenced_class.kind in ('r', 'v') + ), + relationships as ( + select + referenced.name as referenced_name, + referenced.schema as referenced_schema_id, + dependent_class.name as dependent_name, + dependent_class.schema as dependent_schema_id, + referenced.kind as kind + from referenced + join dependency on referenced.id=dependency.id + join class as dependent_class on dependency.ref=dependent_class.id + where + (referenced.name != dependent_class.name or + referenced.schema != dependent_class.schema) + ) + + select + referenced_schema.name as referenced_schema, + relationships.referenced_name as referenced_name, + dependent_schema.name as dependent_schema, + relationships.dependent_name as dependent_name + from relationships + join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id + join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id + group by referenced_schema, referenced_name, dependent_schema, dependent_name + order by referenced_schema, referenced_name, dependent_schema, dependent_name; +15:26:01.273403 [debug] [MainThread]: SQL status: SELECT 1 in 0.17 seconds +15:26:01.276966 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': 'a64aca8e-9649-4e28-87de-0655145090d2', 'context': []} +15:26:01.277714 [debug] [MainThread]: On master: ROLLBACK +15:26:01.295867 [debug] [MainThread]: Using postgres connection "master" +15:26:01.296376 [debug] [MainThread]: On master: BEGIN +15:26:01.332073 [debug] [MainThread]: SQL status: BEGIN in 0.04 seconds +15:26:01.332723 [debug] [MainThread]: On master: COMMIT +15:26:01.333096 [debug] [MainThread]: Using postgres connection "master" +15:26:01.333642 [debug] [MainThread]: On master: COMMIT +15:26:01.352043 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +15:26:01.352797 [debug] [MainThread]: On master: Close +15:26:01.354676 [info ] [MainThread]: Concurrency: 10 threads (target='dev') +15:26:01.355767 [info ] [MainThread]: +15:26:01.364181 [debug] [Thread-1 ]: Began running node test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +15:26:01.364880 [debug] [Thread-2 ]: Began running node test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +15:26:01.365151 [info ] [Thread-1 ]: 1 of 10 START test not_null_my_first_dbt_model_id .............................. [RUN] +15:26:01.365462 [debug] [Thread-3 ]: Began running node test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +15:26:01.367993 [info ] [Thread-3 ]: 3 of 10 START test not_null_wins_losses_gameid ................................. [RUN] +15:26:01.365778 [debug] [Thread-4 ]: Began running node test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +15:26:01.369389 [info ] [Thread-4 ]: 4 of 10 START test not_null_wins_losses_player_id .............................. [RUN] +15:26:01.369948 [debug] [Thread-4 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +15:26:01.370152 [debug] [Thread-4 ]: Began compiling node test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +15:26:01.370630 [debug] [Thread-4 ]: Compiling test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +15:26:01.366317 [debug] [Thread-5 ]: Began running node test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +15:26:01.369119 [debug] [Thread-8 ]: Began running node test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +15:26:01.382283 [debug] [Thread-9 ]: Began running node test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +15:26:01.366003 [info ] [Thread-2 ]: 2 of 10 START test not_null_my_second_dbt_model_id ............................. [RUN] +15:26:01.366722 [debug] [Thread-6 ]: Began running node test.wrkplay_dbt.positive_wins_losses_total_losses.159f570741 +15:26:01.367651 [debug] [Thread-1 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +15:26:01.368555 [debug] [Thread-3 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +15:26:01.368953 [debug] [Thread-7 ]: Began running node test.wrkplay_dbt.positive_wins_losses_total_wins.1e3c0d0dd6 +15:26:01.387516 [debug] [Thread-4 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +15:26:01.387610 [debug] [Thread-10 ]: Began running node test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb +15:26:01.387744 [info ] [Thread-5 ]: 5 of 10 START test not_null_wins_losses_seasonid ............................... [RUN] +15:26:01.387824 [info ] [Thread-8 ]: 8 of 10 START test unique_my_first_dbt_model_id ................................ [RUN] +15:26:01.387890 [info ] [Thread-9 ]: 9 of 10 START test unique_my_second_dbt_model_id ............................... [RUN] +15:26:01.388087 [debug] [Thread-2 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +15:26:01.388161 [info ] [Thread-6 ]: 6 of 10 START test positive_wins_losses_total_losses ........................... [RUN] +15:26:01.388231 [debug] [Thread-1 ]: Began compiling node test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +15:26:01.388293 [debug] [Thread-3 ]: Began compiling node test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +15:26:01.388357 [info ] [Thread-7 ]: 7 of 10 START test positive_wins_losses_total_wins ............................. [RUN] +15:26:01.388513 [info ] [Thread-10 ]: 10 of 10 START test unique_wins_losses_seasonid ................................ [RUN] +15:26:01.388730 [debug] [Thread-5 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +15:26:01.388944 [debug] [Thread-8 ]: Acquiring new postgres connection "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +15:26:01.389105 [debug] [Thread-9 ]: Acquiring new postgres connection "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +15:26:01.389167 [debug] [Thread-2 ]: Began compiling node test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +15:26:01.389258 [debug] [Thread-4 ]: finished collecting timing info +15:26:01.389410 [debug] [Thread-6 ]: Acquiring new postgres connection "test.wrkplay_dbt.positive_wins_losses_total_losses.159f570741" +15:26:01.389472 [debug] [Thread-1 ]: Compiling test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +15:26:01.389527 [debug] [Thread-3 ]: Compiling test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +15:26:01.389666 [debug] [Thread-7 ]: Acquiring new postgres connection "test.wrkplay_dbt.positive_wins_losses_total_wins.1e3c0d0dd6" +15:26:01.389804 [debug] [Thread-10 ]: Acquiring new postgres connection "test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb" +15:26:01.389860 [debug] [Thread-5 ]: Began compiling node test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +15:26:01.389913 [debug] [Thread-8 ]: Began compiling node test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +15:26:01.389966 [debug] [Thread-9 ]: Began compiling node test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +15:26:01.390017 [debug] [Thread-2 ]: Compiling test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +15:26:01.390081 [debug] [Thread-4 ]: Began executing node test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +15:26:01.390136 [debug] [Thread-6 ]: Began compiling node test.wrkplay_dbt.positive_wins_losses_total_losses.159f570741 +15:26:01.391767 [debug] [Thread-1 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +15:26:01.393249 [debug] [Thread-3 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +15:26:01.393335 [debug] [Thread-7 ]: Began compiling node test.wrkplay_dbt.positive_wins_losses_total_wins.1e3c0d0dd6 +15:26:01.393423 [debug] [Thread-10 ]: Began compiling node test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb +15:26:01.393502 [debug] [Thread-5 ]: Compiling test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +15:26:01.393572 [debug] [Thread-8 ]: Compiling test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +15:26:01.393654 [debug] [Thread-9 ]: Compiling test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +15:26:01.395693 [debug] [Thread-2 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +15:26:01.402240 [debug] [Thread-4 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +15:26:01.402340 [debug] [Thread-6 ]: Compiling test.wrkplay_dbt.positive_wins_losses_total_losses.159f570741 +15:26:01.402804 [debug] [Thread-7 ]: Compiling test.wrkplay_dbt.positive_wins_losses_total_wins.1e3c0d0dd6 +15:26:01.402958 [debug] [Thread-10 ]: Compiling test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb +15:26:01.403086 [debug] [Thread-3 ]: finished collecting timing info +15:26:01.404804 [debug] [Thread-5 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +15:26:01.407754 [debug] [Thread-8 ]: Writing injected SQL for node "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +15:26:01.407863 [debug] [Thread-1 ]: finished collecting timing info +15:26:01.409598 [debug] [Thread-9 ]: Writing injected SQL for node "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +15:26:01.414152 [debug] [Thread-10 ]: Writing injected SQL for node "test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb" +15:26:01.414366 [debug] [Thread-3 ]: Began executing node test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +15:26:01.414531 [debug] [Thread-2 ]: finished collecting timing info +15:26:01.414640 [debug] [Thread-4 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +15:26:01.414834 [debug] [Thread-1 ]: Began executing node test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +15:26:01.415019 [debug] [Thread-8 ]: finished collecting timing info +15:26:01.415258 [debug] [Thread-6 ]: finished collecting timing info +15:26:01.415386 [debug] [Thread-7 ]: finished collecting timing info +15:26:01.415450 [debug] [Thread-5 ]: finished collecting timing info +15:26:01.416377 [debug] [Thread-3 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +15:26:01.416520 [debug] [Thread-2 ]: Began executing node test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +15:26:01.416584 [debug] [Thread-9 ]: finished collecting timing info +15:26:01.416637 [debug] [Thread-10 ]: finished collecting timing info +15:26:01.416704 [debug] [Thread-4 ]: On test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15: BEGIN +15:26:01.417520 [debug] [Thread-1 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +15:26:01.417625 [debug] [Thread-8 ]: Began executing node test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +15:26:01.417820 [debug] [Thread-6 ]: Compilation Error in test positive_wins_losses_total_losses (models/schema.yml) + 'test_positive' is undefined. This can happen when calling a macro that does not exist. Check for typos and/or install package dependencies with "dbt deps". +15:26:01.418001 [debug] [Thread-7 ]: Compilation Error in test positive_wins_losses_total_wins (models/schema.yml) + 'test_positive' is undefined. This can happen when calling a macro that does not exist. Check for typos and/or install package dependencies with "dbt deps". +15:26:01.418088 [debug] [Thread-5 ]: Began executing node test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +15:26:01.419140 [debug] [Thread-2 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +15:26:01.419359 [debug] [Thread-9 ]: Began executing node test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +15:26:01.419471 [debug] [Thread-10 ]: Began executing node test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb +15:26:01.419568 [debug] [Thread-3 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +15:26:01.419634 [debug] [Thread-4 ]: Opening a new connection, currently in state init +15:26:01.420567 [debug] [Thread-8 ]: Writing runtime SQL for node "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +15:26:01.420771 [error] [Thread-6 ]: 6 of 10 ERROR positive_wins_losses_total_losses ................................ [ERROR in 0.03s] +15:26:01.420890 [debug] [Thread-1 ]: Using postgres connection "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +15:26:01.420984 [error] [Thread-7 ]: 7 of 10 ERROR positive_wins_losses_total_wins .................................. [ERROR in 0.03s] +15:26:01.421842 [debug] [Thread-5 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +15:26:01.423349 [debug] [Thread-9 ]: Writing runtime SQL for node "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +15:26:01.445968 [debug] [Thread-10 ]: Writing runtime SQL for node "test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb" +15:26:01.446094 [debug] [Thread-2 ]: Using postgres connection "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +15:26:01.446195 [debug] [Thread-3 ]: On test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1: BEGIN +15:26:01.446552 [debug] [Thread-6 ]: Finished running node test.wrkplay_dbt.positive_wins_losses_total_losses.159f570741 +15:26:01.446643 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710: BEGIN +15:26:01.446805 [debug] [Thread-7 ]: Finished running node test.wrkplay_dbt.positive_wins_losses_total_wins.1e3c0d0dd6 +15:26:01.446872 [debug] [Thread-8 ]: Using postgres connection "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +15:26:01.447181 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778: BEGIN +15:26:01.447263 [debug] [Thread-5 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +15:26:01.447354 [debug] [Thread-10 ]: Using postgres connection "test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb" +15:26:01.447417 [debug] [Thread-3 ]: Opening a new connection, currently in state init +15:26:01.447479 [debug] [Thread-9 ]: Using postgres connection "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +15:26:01.447635 [debug] [Thread-1 ]: Opening a new connection, currently in state closed +15:26:01.447764 [debug] [Thread-8 ]: On test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321: BEGIN +15:26:01.447837 [debug] [Thread-2 ]: Opening a new connection, currently in state init +15:26:01.447903 [debug] [Thread-5 ]: On test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813: BEGIN +15:26:01.447965 [debug] [Thread-10 ]: On test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb: BEGIN +15:26:01.448090 [debug] [Thread-9 ]: On test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493: BEGIN +15:26:01.448226 [debug] [Thread-8 ]: Opening a new connection, currently in state init +15:26:01.448351 [debug] [Thread-5 ]: Opening a new connection, currently in state init +15:26:01.448413 [debug] [Thread-10 ]: Opening a new connection, currently in state init +15:26:01.448477 [debug] [Thread-9 ]: Opening a new connection, currently in state init +15:26:01.648537 [debug] [Thread-3 ]: SQL status: BEGIN in 0.2 seconds +15:26:01.649715 [debug] [Thread-3 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +15:26:01.650039 [debug] [Thread-3 ]: On test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select gameid +from "postgres"."public"."wins_losses" +where gameid is null + + + + + ) dbt_internal_test +15:26:01.653991 [debug] [Thread-4 ]: SQL status: BEGIN in 0.23 seconds +15:26:01.654734 [debug] [Thread-4 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +15:26:01.655026 [debug] [Thread-4 ]: On test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select player_id +from "postgres"."public"."wins_losses" +where player_id is null + + + + + ) dbt_internal_test +15:26:01.666916 [debug] [Thread-8 ]: SQL status: BEGIN in 0.22 seconds +15:26:01.667405 [debug] [Thread-8 ]: Using postgres connection "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +15:26:01.667605 [debug] [Thread-8 ]: On test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + +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 + + + + + ) dbt_internal_test +15:26:01.670006 [debug] [Thread-3 ]: SQL status: SELECT 1 in 0.02 seconds +15:26:01.674044 [debug] [Thread-3 ]: finished collecting timing info +15:26:01.674662 [debug] [Thread-3 ]: On test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1: ROLLBACK +15:26:01.675725 [debug] [Thread-5 ]: SQL status: BEGIN in 0.23 seconds +15:26:01.675940 [debug] [Thread-2 ]: SQL status: BEGIN in 0.23 seconds +15:26:01.676088 [debug] [Thread-4 ]: SQL status: SELECT 1 in 0.02 seconds +15:26:01.676207 [debug] [Thread-9 ]: SQL status: BEGIN in 0.23 seconds +15:26:01.676318 [debug] [Thread-1 ]: SQL status: BEGIN in 0.23 seconds +15:26:01.676542 [debug] [Thread-5 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +15:26:01.676674 [debug] [Thread-10 ]: SQL status: BEGIN in 0.23 seconds +15:26:01.676877 [debug] [Thread-2 ]: Using postgres connection "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +15:26:01.678731 [debug] [Thread-4 ]: finished collecting timing info +15:26:01.679051 [debug] [Thread-9 ]: Using postgres connection "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +15:26:01.679289 [debug] [Thread-1 ]: Using postgres connection "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +15:26:01.679533 [debug] [Thread-5 ]: On test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select seasonid +from "postgres"."public"."wins_losses" +where seasonid is null + + + + + ) dbt_internal_test +15:26:01.679742 [debug] [Thread-10 ]: Using postgres connection "test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb" +15:26:01.679928 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select id +from "postgres"."public"."my_second_dbt_model" +where id is null + + + + + ) dbt_internal_test +15:26:01.680147 [debug] [Thread-4 ]: On test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15: ROLLBACK +15:26:01.680367 [debug] [Thread-9 ]: On test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + +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 + + + + + ) dbt_internal_test +15:26:01.680602 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select id +from "postgres"."public"."my_first_dbt_model" +where id is null + + + + + ) dbt_internal_test +15:26:01.680931 [debug] [Thread-10 ]: On test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + +select + seasonid as unique_field, + count(*) as n_records + +from "postgres"."public"."wins_losses" +where seasonid is not null +group by seasonid +having count(*) > 1 + + + + + ) dbt_internal_test +15:26:01.686952 [debug] [Thread-8 ]: SQL status: SELECT 1 in 0.02 seconds +15:26:01.688996 [debug] [Thread-8 ]: finished collecting timing info +15:26:01.689517 [debug] [Thread-8 ]: On test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321: ROLLBACK +15:26:01.695488 [debug] [Thread-3 ]: On test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1: Close +15:26:01.696472 [info ] [Thread-3 ]: 3 of 10 PASS not_null_wins_losses_gameid ....................................... [PASS in 0.33s] +15:26:01.697137 [debug] [Thread-3 ]: Finished running node test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +15:26:01.698895 [debug] [Thread-4 ]: On test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15: Close +15:26:01.699770 [info ] [Thread-4 ]: 4 of 10 PASS not_null_wins_losses_player_id .................................... [PASS in 0.33s] +15:26:01.699960 [debug] [Thread-5 ]: SQL status: SELECT 1 in 0.02 seconds +15:26:01.700626 [debug] [Thread-4 ]: Finished running node test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +15:26:01.702656 [debug] [Thread-5 ]: finished collecting timing info +15:26:01.702850 [debug] [Thread-2 ]: SQL status: SELECT 1 in 0.02 seconds +15:26:01.703482 [debug] [Thread-5 ]: On test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813: ROLLBACK +15:26:01.703732 [debug] [Thread-9 ]: SQL status: SELECT 1 in 0.02 seconds +15:26:01.703866 [debug] [Thread-1 ]: SQL status: SELECT 1 in 0.02 seconds +15:26:01.703980 [debug] [Thread-10 ]: SQL status: SELECT 1 in 0.02 seconds +15:26:01.705810 [debug] [Thread-2 ]: finished collecting timing info +15:26:01.708689 [debug] [Thread-9 ]: finished collecting timing info +15:26:01.709776 [debug] [Thread-8 ]: On test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321: Close +15:26:01.711629 [debug] [Thread-1 ]: finished collecting timing info +15:26:01.716566 [debug] [Thread-10 ]: finished collecting timing info +15:26:01.716977 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778: ROLLBACK +15:26:01.717273 [debug] [Thread-9 ]: On test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493: ROLLBACK +15:26:01.717459 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710: ROLLBACK +15:26:01.717676 [info ] [Thread-8 ]: 8 of 10 PASS unique_my_first_dbt_model_id ...................................... [PASS in 0.33s] +15:26:01.717792 [debug] [Thread-10 ]: On test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb: ROLLBACK +15:26:01.718342 [debug] [Thread-8 ]: Finished running node test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +15:26:01.725430 [debug] [Thread-5 ]: On test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813: Close +15:26:01.727309 [info ] [Thread-5 ]: 5 of 10 PASS not_null_wins_losses_seasonid ..................................... [PASS in 0.34s] +15:26:01.728170 [debug] [Thread-5 ]: Finished running node test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +15:26:01.735692 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778: Close +15:26:01.735819 [debug] [Thread-10 ]: On test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb: Close +15:26:01.736228 [info ] [Thread-2 ]: 2 of 10 PASS not_null_my_second_dbt_model_id ................................... [PASS in 0.35s] +15:26:01.736460 [debug] [Thread-2 ]: Finished running node test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +15:26:01.736658 [error] [Thread-10 ]: 10 of 10 FAIL 15 unique_wins_losses_seasonid ................................... [FAIL 15 in 0.35s] +15:26:01.736816 [debug] [Thread-10 ]: Finished running node test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb +15:26:01.737339 [debug] [Thread-9 ]: On test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493: Close +15:26:01.738770 [info ] [Thread-9 ]: 9 of 10 PASS unique_my_second_dbt_model_id ..................................... [PASS in 0.35s] +15:26:01.739715 [debug] [Thread-9 ]: Finished running node test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +15:26:01.739968 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710: Close +15:26:01.740982 [info ] [Thread-1 ]: 1 of 10 PASS not_null_my_first_dbt_model_id .................................... [PASS in 0.37s] +15:26:01.741382 [debug] [Thread-1 ]: Finished running node test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +15:26:01.742203 [debug] [MainThread]: Acquiring new postgres connection "master" +15:26:01.742366 [debug] [MainThread]: Using postgres connection "master" +15:26:01.742430 [debug] [MainThread]: On master: BEGIN +15:26:01.742483 [debug] [MainThread]: Opening a new connection, currently in state closed +15:26:01.926302 [debug] [MainThread]: SQL status: BEGIN in 0.18 seconds +15:26:01.927980 [debug] [MainThread]: On master: COMMIT +15:26:01.928384 [debug] [MainThread]: Using postgres connection "master" +15:26:01.929264 [debug] [MainThread]: On master: COMMIT +15:26:01.947970 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +15:26:01.948702 [debug] [MainThread]: On master: Close +15:26:01.950358 [info ] [MainThread]: +15:26:01.950898 [info ] [MainThread]: Finished running 10 tests in 1.41s. +15:26:01.951209 [debug] [MainThread]: Connection 'master' was properly closed. +15:26:01.951364 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710' was properly closed. +15:26:01.951518 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1' was properly closed. +15:26:01.951664 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15' was properly closed. +15:26:01.951820 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778' was properly closed. +15:26:01.951962 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813' was properly closed. +15:26:01.952105 [debug] [MainThread]: Connection 'test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321' was properly closed. +15:26:01.952247 [debug] [MainThread]: Connection 'test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493' was properly closed. +15:26:01.952393 [debug] [MainThread]: Connection 'test.wrkplay_dbt.positive_wins_losses_total_losses.159f570741' was properly closed. +15:26:01.952537 [debug] [MainThread]: Connection 'test.wrkplay_dbt.positive_wins_losses_total_wins.1e3c0d0dd6' was properly closed. +15:26:01.952680 [debug] [MainThread]: Connection 'test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb' was properly closed. +15:26:01.975444 [info ] [MainThread]: +15:26:01.976237 [info ] [MainThread]: Completed with 3 errors and 0 warnings: +15:26:01.976708 [info ] [MainThread]: +15:26:01.977051 [error] [MainThread]: Compilation Error in test positive_wins_losses_total_losses (models/schema.yml) +15:26:01.977520 [error] [MainThread]: 'test_positive' is undefined. This can happen when calling a macro that does not exist. Check for typos and/or install package dependencies with "dbt deps". +15:26:01.977856 [info ] [MainThread]: +15:26:01.979731 [error] [MainThread]: Compilation Error in test positive_wins_losses_total_wins (models/schema.yml) +15:26:01.980080 [error] [MainThread]: 'test_positive' is undefined. This can happen when calling a macro that does not exist. Check for typos and/or install package dependencies with "dbt deps". +15:26:01.980721 [info ] [MainThread]: +15:26:01.981208 [error] [MainThread]: Failure in test unique_wins_losses_seasonid (models/schema.yml) +15:26:01.981599 [error] [MainThread]: Got 15 results, configured to fail if != 0 +15:26:01.981956 [info ] [MainThread]: +15:26:01.982258 [info ] [MainThread]: compiled SQL at target/compiled/wrkplay_dbt/models/schema.yml/unique_wins_losses_seasonid.sql +15:26:01.983203 [info ] [MainThread]: +15:26:01.983524 [info ] [MainThread]: Done. PASS=7 WARN=0 ERROR=3 SKIP=0 TOTAL=10 +15:26:01.984137 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [, , ]} + + +============================== 2022-07-08 15:28:27.156884 | 57706dac-d331-49bd-83b8-ae32e839e3a1 ============================== +15:28:27.156920 [info ] [MainThread]: Running with dbt=1.1.1 +15:28:27.159450 [debug] [MainThread]: running dbt with arguments {'write_json': True, 'use_colors': True, 'printer_width': 80, 'version_check': True, 'partial_parse': True, 'static_parser': True, 'profiles_dir': '/Users/bruno.campos/.dbt', 'send_anonymous_usage_stats': True, 'event_buffer_size': 100000, 'quiet': False, 'no_print': False, 'which': 'run', 'rpc_method': 'run', 'indirect_selection': 'eager'} +15:28:27.159614 [debug] [MainThread]: Tracking: tracking +15:28:27.178752 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [, , ]} +15:28:27.195727 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 0 files changed. +15:28:27.195836 [debug] [MainThread]: Partial parsing enabled, no changes found, skipping parsing +15:28:27.199108 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '57706dac-d331-49bd-83b8-ae32e839e3a1', 'context': []} +15:28:27.201795 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '57706dac-d331-49bd-83b8-ae32e839e3a1', 'context': []} +15:28:27.201931 [info ] [MainThread]: Found 3 models, 10 tests, 0 snapshots, 0 analyses, 167 macros, 0 operations, 0 seed files, 0 sources, 0 exposures, 0 metrics +15:28:27.202055 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '57706dac-d331-49bd-83b8-ae32e839e3a1', 'context': []} +15:28:27.202748 [info ] [MainThread]: +15:28:27.202953 [debug] [MainThread]: Acquiring new postgres connection "master" +15:28:27.203355 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres" +15:28:27.207953 [debug] [ThreadPool]: Using postgres connection "list_postgres" +15:28:27.208117 [debug] [ThreadPool]: On list_postgres: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres"} */ + + select distinct nspname from pg_namespace + +15:28:27.208184 [debug] [ThreadPool]: Opening a new connection, currently in state init +15:28:27.439832 [debug] [ThreadPool]: SQL status: SELECT 10 in 0.23 seconds +15:28:27.445676 [debug] [ThreadPool]: On list_postgres: Close +15:28:27.448146 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres_public" +15:28:27.451727 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +15:28:27.451825 [debug] [ThreadPool]: On list_postgres_public: BEGIN +15:28:27.451884 [debug] [ThreadPool]: Opening a new connection, currently in state closed +15:28:27.645285 [debug] [ThreadPool]: SQL status: BEGIN in 0.19 seconds +15:28:27.646223 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +15:28:27.646634 [debug] [ThreadPool]: On list_postgres_public: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres_public"} */ +select + 'postgres' as database, + tablename as name, + schemaname as schema, + 'table' as type + from pg_tables + where schemaname ilike 'public' + union all + select + 'postgres' as database, + viewname as name, + schemaname as schema, + 'view' as type + from pg_views + where schemaname ilike 'public' + +15:28:27.670044 [debug] [ThreadPool]: SQL status: SELECT 19 in 0.02 seconds +15:28:27.674704 [debug] [ThreadPool]: On list_postgres_public: ROLLBACK +15:28:27.693321 [debug] [ThreadPool]: On list_postgres_public: Close +15:28:27.699037 [debug] [MainThread]: Using postgres connection "master" +15:28:27.699181 [debug] [MainThread]: On master: BEGIN +15:28:27.699242 [debug] [MainThread]: Opening a new connection, currently in state init +15:28:27.904838 [debug] [MainThread]: SQL status: BEGIN in 0.21 seconds +15:28:27.906231 [debug] [MainThread]: Using postgres connection "master" +15:28:27.906591 [debug] [MainThread]: On master: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "master"} */ +with relation as ( + select + pg_rewrite.ev_class as class, + pg_rewrite.oid as id + from pg_rewrite + ), + class as ( + select + oid as id, + relname as name, + relnamespace as schema, + relkind as kind + from pg_class + ), + dependency as ( + select distinct + pg_depend.objid as id, + pg_depend.refobjid as ref + from pg_depend + ), + schema as ( + select + pg_namespace.oid as id, + pg_namespace.nspname as name + from pg_namespace + where nspname != 'information_schema' and nspname not like 'pg\_%' + ), + referenced as ( + select + relation.id AS id, + referenced_class.name , + referenced_class.schema , + referenced_class.kind + from relation + join class as referenced_class on relation.class=referenced_class.id + where referenced_class.kind in ('r', 'v') + ), + relationships as ( + select + referenced.name as referenced_name, + referenced.schema as referenced_schema_id, + dependent_class.name as dependent_name, + dependent_class.schema as dependent_schema_id, + referenced.kind as kind + from referenced + join dependency on referenced.id=dependency.id + join class as dependent_class on dependency.ref=dependent_class.id + where + (referenced.name != dependent_class.name or + referenced.schema != dependent_class.schema) + ) + + select + referenced_schema.name as referenced_schema, + relationships.referenced_name as referenced_name, + dependent_schema.name as dependent_schema, + relationships.dependent_name as dependent_name + from relationships + join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id + join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id + group by referenced_schema, referenced_name, dependent_schema, dependent_name + order by referenced_schema, referenced_name, dependent_schema, dependent_name; +15:28:28.077845 [debug] [MainThread]: SQL status: SELECT 1 in 0.17 seconds +15:28:28.081460 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '57706dac-d331-49bd-83b8-ae32e839e3a1', 'context': []} +15:28:28.082096 [debug] [MainThread]: On master: ROLLBACK +15:28:28.102158 [debug] [MainThread]: Using postgres connection "master" +15:28:28.103003 [debug] [MainThread]: On master: BEGIN +15:28:28.143775 [debug] [MainThread]: SQL status: BEGIN in 0.04 seconds +15:28:28.144702 [debug] [MainThread]: On master: COMMIT +15:28:28.145097 [debug] [MainThread]: Using postgres connection "master" +15:28:28.145426 [debug] [MainThread]: On master: COMMIT +15:28:28.166296 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +15:28:28.167134 [debug] [MainThread]: On master: Close +15:28:28.168723 [info ] [MainThread]: Concurrency: 10 threads (target='dev') +15:28:28.169470 [info ] [MainThread]: +15:28:28.175987 [debug] [Thread-1 ]: Began running node model.wrkplay_dbt.my_first_dbt_model +15:28:28.176229 [info ] [Thread-1 ]: 1 of 3 START view model public.my_first_dbt_model .............................. [RUN] +15:28:28.176522 [debug] [Thread-1 ]: Acquiring new postgres connection "model.wrkplay_dbt.my_first_dbt_model" +15:28:28.176601 [debug] [Thread-1 ]: Began compiling node model.wrkplay_dbt.my_first_dbt_model +15:28:28.176702 [debug] [Thread-1 ]: Compiling model.wrkplay_dbt.my_first_dbt_model +15:28:28.178029 [debug] [Thread-1 ]: Writing injected SQL for node "model.wrkplay_dbt.my_first_dbt_model" +15:28:28.178132 [debug] [Thread-2 ]: Began running node model.wrkplay_dbt.wins_losses +15:28:28.178253 [info ] [Thread-2 ]: 2 of 3 START table model public.wins_losses .................................... [RUN] +15:28:28.178439 [debug] [Thread-2 ]: Acquiring new postgres connection "model.wrkplay_dbt.wins_losses" +15:28:28.178523 [debug] [Thread-2 ]: Began compiling node model.wrkplay_dbt.wins_losses +15:28:28.178587 [debug] [Thread-2 ]: Compiling model.wrkplay_dbt.wins_losses +15:28:28.178641 [debug] [Thread-1 ]: finished collecting timing info +15:28:28.179855 [debug] [Thread-2 ]: Writing injected SQL for node "model.wrkplay_dbt.wins_losses" +15:28:28.179967 [debug] [Thread-1 ]: Began executing node model.wrkplay_dbt.my_first_dbt_model +15:28:28.190453 [debug] [Thread-1 ]: Writing runtime SQL for node "model.wrkplay_dbt.my_first_dbt_model" +15:28:28.190659 [debug] [Thread-2 ]: finished collecting timing info +15:28:28.190747 [debug] [Thread-2 ]: Began executing node model.wrkplay_dbt.wins_losses +15:28:28.200699 [debug] [Thread-2 ]: Writing runtime SQL for node "model.wrkplay_dbt.wins_losses" +15:28:28.200813 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +15:28:28.200908 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: BEGIN +15:28:28.200969 [debug] [Thread-1 ]: Opening a new connection, currently in state closed +15:28:28.201126 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +15:28:28.201191 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: BEGIN +15:28:28.201244 [debug] [Thread-2 ]: Opening a new connection, currently in state init +15:28:28.387803 [debug] [Thread-2 ]: SQL status: BEGIN in 0.19 seconds +15:28:28.388314 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +15:28:28.388404 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ + + + create table "postgres"."public"."wins_losses__dbt_tmp" + as ( + + +--number of wins and losses per player per game (per office) per season +WITH loss_table AS ( + SELECT + SUM(lt.left_losses) AS "total_losses" + , lt.left_player_id AS "loss_player_id" + , lt.gameid + , lt.seasonid + FROM + ( + SELECT + * + FROM + ( + --Begin DONE + WITH left_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore > m.rightscore THEN 0 + ELSE 1 + END) AS "left_loss" + , l."A" + , l."B" + , m."gameid" + , m."seasonid" + FROM + "_left" l + JOIN "Match" m ON + l."A" = m.id + GROUP BY + l."A" + , l."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.left_loss) AS "left_losses" + , a."B" AS "left_player_id" + , a."gameid" + , a."seasonid" + FROM + left_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + --End DONE + ) ll + UNION ALL + SELECT + * + FROM + ( + --Begin DONE + WITH right_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore < m.rightscore THEN 0 + ELSE 1 + END) AS "right_loss" + , r."A" + , r."B" + , m."gameid" + , m."seasonid" + FROM + "_right" r + JOIN "Match" m ON + r."A" = m.id + GROUP BY + r."A" + , r."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.right_loss) AS "right_losses" + , a."B" AS "right_player_id" + , a."gameid" + , a."seasonid" + FROM + right_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + --End DONE + ) rl + ) lt + -- WHERE lt.left_player_id = '' + GROUP BY + lt.left_player_id + , lt.gameid + , lt.seasonid +) +, +win_table AS ( + --number of wins for a player and gameid + SELECT + SUM(rt.right_wins) AS "total_wins" + , rt.right_player_id AS "win_player_id" + , rt.gameid + , rt."seasonid" + FROM + ( + SELECT + * + FROM + ( + WITH right_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore < m.rightscore THEN 1 + ELSE 0 + END) AS "right_won" + , r."A" + , r."B" + , m."gameid" + , m."seasonid" + FROM + "_right" r + JOIN "Match" m ON + r."A" = m.id + GROUP BY + r."A" + , r."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.right_won) AS "right_wins" + , a."B" AS "right_player_id" + , a."gameid" + , a."seasonid" + FROM + right_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + ) rw + UNION ALL + SELECT + * + FROM + ( + WITH left_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore > m.rightscore THEN 1 + ELSE 0 + END) AS "left_won" + , l."A" + , l."B" + , m."gameid" + , m."seasonid" + FROM + "_left" l + JOIN "Match" m ON + l."A" = m.id + GROUP BY + l."A" + , l."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.left_won) AS "left_wins" + , a."B" AS "left_player_id" + , a."gameid" + , a."seasonid" + FROM + left_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + ) lw + ) rt + -- WHERE rt.right_player_id = '' + GROUP BY + rt.right_player_id + , rt.gameid + , rt."seasonid" +) +SELECT + COALESCE(lt.loss_player_id, wt.win_player_id) AS "player_id" + , COALESCE(lt."gameid", wt."gameid") AS "gameid" + , COALESCE(lt.seasonid, wt.seasonid) AS "seasonid" + , wt."total_wins" + , lt."total_losses" +FROM + loss_table lt +FULL OUTER JOIN win_table wt ON + lt."loss_player_id" = wt."win_player_id" + AND lt."gameid" = wt."gameid" + AND lt."seasonid" = wt."seasonid" + ); +15:28:28.408389 [debug] [Thread-1 ]: SQL status: BEGIN in 0.21 seconds +15:28:28.408704 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +15:28:28.408777 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ + + create view "postgres"."public"."my_first_dbt_model__dbt_tmp" as ( + /* + 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 + ); +15:28:28.434110 [debug] [Thread-2 ]: SQL status: SELECT 190 in 0.05 seconds +15:28:28.434391 [debug] [Thread-1 ]: SQL status: CREATE VIEW in 0.03 seconds +15:28:28.441345 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +15:28:28.442823 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +15:28:28.442914 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ +alter table "postgres"."public"."wins_losses" rename to "wins_losses__dbt_backup" +15:28:28.442979 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ +alter table "postgres"."public"."my_first_dbt_model" rename to "my_first_dbt_model__dbt_backup" +15:28:28.462600 [debug] [Thread-2 ]: SQL status: ALTER TABLE in 0.02 seconds +15:28:28.467481 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +15:28:28.467603 [debug] [Thread-1 ]: SQL status: ALTER TABLE in 0.02 seconds +15:28:28.467714 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ +alter table "postgres"."public"."wins_losses__dbt_tmp" rename to "wins_losses" +15:28:28.468846 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +15:28:28.468959 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ +alter table "postgres"."public"."my_first_dbt_model__dbt_tmp" rename to "my_first_dbt_model" +15:28:28.488604 [debug] [Thread-2 ]: SQL status: ALTER TABLE in 0.02 seconds +15:28:28.494900 [debug] [Thread-1 ]: SQL status: ALTER TABLE in 0.03 seconds +15:28:28.498837 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: COMMIT +15:28:28.499555 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: COMMIT +15:28:28.499642 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +15:28:28.499709 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +15:28:28.499766 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: COMMIT +15:28:28.499822 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: COMMIT +15:28:28.518960 [debug] [Thread-2 ]: SQL status: COMMIT in 0.02 seconds +15:28:28.526471 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +15:28:28.526586 [debug] [Thread-1 ]: SQL status: COMMIT in 0.03 seconds +15:28:28.526680 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ +drop table if exists "postgres"."public"."wins_losses__dbt_backup" cascade +15:28:28.527468 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +15:28:28.527575 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ +drop view if exists "postgres"."public"."my_first_dbt_model__dbt_backup" cascade +15:28:28.549260 [debug] [Thread-1 ]: SQL status: DROP VIEW in 0.02 seconds +15:28:28.551270 [debug] [Thread-1 ]: finished collecting timing info +15:28:28.551640 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: Close +15:28:28.552027 [debug] [Thread-2 ]: SQL status: DROP TABLE in 0.02 seconds +15:28:28.553452 [debug] [Thread-2 ]: finished collecting timing info +15:28:28.553805 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: Close +15:28:28.554447 [debug] [Thread-1 ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '57706dac-d331-49bd-83b8-ae32e839e3a1', 'context': []} +15:28:28.554647 [debug] [Thread-2 ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '57706dac-d331-49bd-83b8-ae32e839e3a1', 'context': []} +15:28:28.554879 [info ] [Thread-1 ]: 1 of 3 OK created view model public.my_first_dbt_model ......................... [CREATE VIEW in 0.38s] +15:28:28.555028 [info ] [Thread-2 ]: 2 of 3 OK created table model public.wins_losses ............................... [SELECT 190 in 0.38s] +15:28:28.555230 [debug] [Thread-1 ]: Finished running node model.wrkplay_dbt.my_first_dbt_model +15:28:28.555371 [debug] [Thread-2 ]: Finished running node model.wrkplay_dbt.wins_losses +15:28:28.555606 [debug] [Thread-4 ]: Began running node model.wrkplay_dbt.my_second_dbt_model +15:28:28.555741 [info ] [Thread-4 ]: 3 of 3 START view model public.my_second_dbt_model ............................. [RUN] +15:28:28.555917 [debug] [Thread-4 ]: Acquiring new postgres connection "model.wrkplay_dbt.my_second_dbt_model" +15:28:28.555980 [debug] [Thread-4 ]: Began compiling node model.wrkplay_dbt.my_second_dbt_model +15:28:28.556063 [debug] [Thread-4 ]: Compiling model.wrkplay_dbt.my_second_dbt_model +15:28:28.557184 [debug] [Thread-4 ]: Writing injected SQL for node "model.wrkplay_dbt.my_second_dbt_model" +15:28:28.557520 [debug] [Thread-4 ]: finished collecting timing info +15:28:28.557592 [debug] [Thread-4 ]: Began executing node model.wrkplay_dbt.my_second_dbt_model +15:28:28.558868 [debug] [Thread-4 ]: Writing runtime SQL for node "model.wrkplay_dbt.my_second_dbt_model" +15:28:28.559113 [debug] [Thread-4 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +15:28:28.559174 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: BEGIN +15:28:28.559226 [debug] [Thread-4 ]: Opening a new connection, currently in state init +15:28:28.749744 [debug] [Thread-4 ]: SQL status: BEGIN in 0.19 seconds +15:28:28.750782 [debug] [Thread-4 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +15:28:28.751022 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_second_dbt_model"} */ + + create view "postgres"."public"."my_second_dbt_model__dbt_tmp" as ( + -- Use the `ref` function to select from other models + +select * +from "postgres"."public"."my_first_dbt_model" +where id = 1 + ); +15:28:28.773475 [debug] [Thread-4 ]: SQL status: CREATE VIEW in 0.02 seconds +15:28:28.779167 [debug] [Thread-4 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +15:28:28.779363 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_second_dbt_model"} */ +alter table "postgres"."public"."my_second_dbt_model__dbt_tmp" rename to "my_second_dbt_model" +15:28:28.800079 [debug] [Thread-4 ]: SQL status: ALTER TABLE in 0.02 seconds +15:28:28.805168 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: COMMIT +15:28:28.805720 [debug] [Thread-4 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +15:28:28.806075 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: COMMIT +15:28:28.824824 [debug] [Thread-4 ]: SQL status: COMMIT in 0.02 seconds +15:28:28.829437 [debug] [Thread-4 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +15:28:28.830046 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_second_dbt_model"} */ +drop view if exists "postgres"."public"."my_second_dbt_model__dbt_backup" cascade +15:28:28.850615 [debug] [Thread-4 ]: SQL status: DROP VIEW in 0.02 seconds +15:28:28.854414 [debug] [Thread-4 ]: finished collecting timing info +15:28:28.854969 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: Close +15:28:28.856619 [debug] [Thread-4 ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '57706dac-d331-49bd-83b8-ae32e839e3a1', 'context': []} +15:28:28.857339 [info ] [Thread-4 ]: 3 of 3 OK created view model public.my_second_dbt_model ........................ [CREATE VIEW in 0.30s] +15:28:28.858082 [debug] [Thread-4 ]: Finished running node model.wrkplay_dbt.my_second_dbt_model +15:28:28.859325 [debug] [MainThread]: Acquiring new postgres connection "master" +15:28:28.859468 [debug] [MainThread]: Using postgres connection "master" +15:28:28.859530 [debug] [MainThread]: On master: BEGIN +15:28:28.859586 [debug] [MainThread]: Opening a new connection, currently in state closed +15:28:29.046432 [debug] [MainThread]: SQL status: BEGIN in 0.19 seconds +15:28:29.047939 [debug] [MainThread]: On master: COMMIT +15:28:29.048239 [debug] [MainThread]: Using postgres connection "master" +15:28:29.048451 [debug] [MainThread]: On master: COMMIT +15:28:29.073590 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +15:28:29.074190 [debug] [MainThread]: On master: Close +15:28:29.075890 [info ] [MainThread]: +15:28:29.076519 [info ] [MainThread]: Finished running 2 view models, 1 table model in 1.87s. +15:28:29.076868 [debug] [MainThread]: Connection 'master' was properly closed. +15:28:29.077023 [debug] [MainThread]: Connection 'model.wrkplay_dbt.my_first_dbt_model' was properly closed. +15:28:29.077169 [debug] [MainThread]: Connection 'model.wrkplay_dbt.wins_losses' was properly closed. +15:28:29.077309 [debug] [MainThread]: Connection 'model.wrkplay_dbt.my_second_dbt_model' was properly closed. +15:28:29.080978 [info ] [MainThread]: +15:28:29.081192 [info ] [MainThread]: Completed successfully +15:28:29.081323 [info ] [MainThread]: +15:28:29.081418 [info ] [MainThread]: Done. PASS=3 WARN=0 ERROR=0 SKIP=0 TOTAL=3 +15:28:29.081585 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [, , ]} + + +============================== 2022-07-08 15:29:25.882004 | e59d41be-104b-4649-b36f-38b582ed2bb9 ============================== +15:29:25.882046 [info ] [MainThread]: Running with dbt=1.1.1 +15:29:25.882597 [debug] [MainThread]: running dbt with arguments {'write_json': True, 'use_colors': True, 'printer_width': 80, 'version_check': True, 'partial_parse': True, 'static_parser': True, 'profiles_dir': '/Users/bruno.campos/.dbt', 'send_anonymous_usage_stats': True, 'event_buffer_size': 100000, 'quiet': False, 'no_print': False, 'which': 'run', 'rpc_method': 'run', 'indirect_selection': 'eager'} +15:29:25.882679 [debug] [MainThread]: Tracking: tracking +15:29:25.900512 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [, , ]} +15:29:25.917818 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 1 files changed. +15:29:25.918058 [debug] [MainThread]: Partial parsing: updated file: wrkplay_dbt://models/wins_losses.sql +15:29:25.924199 [debug] [MainThread]: 1699: static parser successfully parsed wins_losses.sql +15:29:25.953304 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': 'e59d41be-104b-4649-b36f-38b582ed2bb9', 'context': []} +15:29:25.956356 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': 'e59d41be-104b-4649-b36f-38b582ed2bb9', 'context': []} +15:29:25.956498 [info ] [MainThread]: Found 3 models, 10 tests, 0 snapshots, 0 analyses, 167 macros, 0 operations, 0 seed files, 0 sources, 0 exposures, 0 metrics +15:29:25.956628 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': 'e59d41be-104b-4649-b36f-38b582ed2bb9', 'context': []} +15:29:25.957348 [info ] [MainThread]: +15:29:25.957572 [debug] [MainThread]: Acquiring new postgres connection "master" +15:29:25.957984 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres" +15:29:25.962295 [debug] [ThreadPool]: Using postgres connection "list_postgres" +15:29:25.962371 [debug] [ThreadPool]: On list_postgres: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres"} */ + + select distinct nspname from pg_namespace + +15:29:25.962432 [debug] [ThreadPool]: Opening a new connection, currently in state init +15:29:26.182995 [debug] [ThreadPool]: SQL status: SELECT 10 in 0.22 seconds +15:29:26.184597 [debug] [ThreadPool]: On list_postgres: Close +15:29:26.186028 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres_public" +15:29:26.189270 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +15:29:26.204703 [debug] [ThreadPool]: On list_postgres_public: BEGIN +15:29:26.204768 [debug] [ThreadPool]: Opening a new connection, currently in state closed +15:29:26.398375 [debug] [ThreadPool]: SQL status: BEGIN in 0.19 seconds +15:29:26.399326 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +15:29:26.399811 [debug] [ThreadPool]: On list_postgres_public: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres_public"} */ +select + 'postgres' as database, + tablename as name, + schemaname as schema, + 'table' as type + from pg_tables + where schemaname ilike 'public' + union all + select + 'postgres' as database, + viewname as name, + schemaname as schema, + 'view' as type + from pg_views + where schemaname ilike 'public' + +15:29:26.424228 [debug] [ThreadPool]: SQL status: SELECT 19 in 0.02 seconds +15:29:26.430521 [debug] [ThreadPool]: On list_postgres_public: ROLLBACK +15:29:26.450194 [debug] [ThreadPool]: On list_postgres_public: Close +15:29:26.455493 [debug] [MainThread]: Using postgres connection "master" +15:29:26.455621 [debug] [MainThread]: On master: BEGIN +15:29:26.455678 [debug] [MainThread]: Opening a new connection, currently in state init +15:29:26.640561 [debug] [MainThread]: SQL status: BEGIN in 0.18 seconds +15:29:26.642020 [debug] [MainThread]: Using postgres connection "master" +15:29:26.642436 [debug] [MainThread]: On master: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "master"} */ +with relation as ( + select + pg_rewrite.ev_class as class, + pg_rewrite.oid as id + from pg_rewrite + ), + class as ( + select + oid as id, + relname as name, + relnamespace as schema, + relkind as kind + from pg_class + ), + dependency as ( + select distinct + pg_depend.objid as id, + pg_depend.refobjid as ref + from pg_depend + ), + schema as ( + select + pg_namespace.oid as id, + pg_namespace.nspname as name + from pg_namespace + where nspname != 'information_schema' and nspname not like 'pg\_%' + ), + referenced as ( + select + relation.id AS id, + referenced_class.name , + referenced_class.schema , + referenced_class.kind + from relation + join class as referenced_class on relation.class=referenced_class.id + where referenced_class.kind in ('r', 'v') + ), + relationships as ( + select + referenced.name as referenced_name, + referenced.schema as referenced_schema_id, + dependent_class.name as dependent_name, + dependent_class.schema as dependent_schema_id, + referenced.kind as kind + from referenced + join dependency on referenced.id=dependency.id + join class as dependent_class on dependency.ref=dependent_class.id + where + (referenced.name != dependent_class.name or + referenced.schema != dependent_class.schema) + ) + + select + referenced_schema.name as referenced_schema, + relationships.referenced_name as referenced_name, + dependent_schema.name as dependent_schema, + relationships.dependent_name as dependent_name + from relationships + join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id + join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id + group by referenced_schema, referenced_name, dependent_schema, dependent_name + order by referenced_schema, referenced_name, dependent_schema, dependent_name; +15:29:26.810232 [debug] [MainThread]: SQL status: SELECT 1 in 0.17 seconds +15:29:26.813255 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': 'e59d41be-104b-4649-b36f-38b582ed2bb9', 'context': []} +15:29:26.813762 [debug] [MainThread]: On master: ROLLBACK +15:29:26.831780 [debug] [MainThread]: Using postgres connection "master" +15:29:26.832268 [debug] [MainThread]: On master: BEGIN +15:29:26.868605 [debug] [MainThread]: SQL status: BEGIN in 0.04 seconds +15:29:26.869190 [debug] [MainThread]: On master: COMMIT +15:29:26.869559 [debug] [MainThread]: Using postgres connection "master" +15:29:26.869894 [debug] [MainThread]: On master: COMMIT +15:29:26.888015 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +15:29:26.888865 [debug] [MainThread]: On master: Close +15:29:26.891040 [info ] [MainThread]: Concurrency: 10 threads (target='dev') +15:29:26.891677 [info ] [MainThread]: +15:29:26.897544 [debug] [Thread-1 ]: Began running node model.wrkplay_dbt.my_first_dbt_model +15:29:26.897755 [debug] [Thread-2 ]: Began running node model.wrkplay_dbt.wins_losses +15:29:26.897934 [info ] [Thread-1 ]: 1 of 3 START view model public.my_first_dbt_model .............................. [RUN] +15:29:26.898055 [info ] [Thread-2 ]: 2 of 3 START view model public.wins_losses ..................................... [RUN] +15:29:26.898333 [debug] [Thread-1 ]: Acquiring new postgres connection "model.wrkplay_dbt.my_first_dbt_model" +15:29:26.898508 [debug] [Thread-2 ]: Acquiring new postgres connection "model.wrkplay_dbt.wins_losses" +15:29:26.898583 [debug] [Thread-1 ]: Began compiling node model.wrkplay_dbt.my_first_dbt_model +15:29:26.898649 [debug] [Thread-2 ]: Began compiling node model.wrkplay_dbt.wins_losses +15:29:26.898743 [debug] [Thread-1 ]: Compiling model.wrkplay_dbt.my_first_dbt_model +15:29:26.898798 [debug] [Thread-2 ]: Compiling model.wrkplay_dbt.wins_losses +15:29:26.900582 [debug] [Thread-1 ]: Writing injected SQL for node "model.wrkplay_dbt.my_first_dbt_model" +15:29:26.901775 [debug] [Thread-2 ]: Writing injected SQL for node "model.wrkplay_dbt.wins_losses" +15:29:26.902275 [debug] [Thread-1 ]: finished collecting timing info +15:29:26.902363 [debug] [Thread-1 ]: Began executing node model.wrkplay_dbt.my_first_dbt_model +15:29:26.908703 [debug] [Thread-2 ]: finished collecting timing info +15:29:26.912886 [debug] [Thread-1 ]: Writing runtime SQL for node "model.wrkplay_dbt.my_first_dbt_model" +15:29:26.912997 [debug] [Thread-2 ]: Began executing node model.wrkplay_dbt.wins_losses +15:29:26.914203 [debug] [Thread-2 ]: Writing runtime SQL for node "model.wrkplay_dbt.wins_losses" +15:29:26.914434 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +15:29:26.914515 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: BEGIN +15:29:26.914572 [debug] [Thread-1 ]: Opening a new connection, currently in state closed +15:29:26.914721 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +15:29:26.914785 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: BEGIN +15:29:26.914836 [debug] [Thread-2 ]: Opening a new connection, currently in state init +15:29:27.104442 [debug] [Thread-2 ]: SQL status: BEGIN in 0.19 seconds +15:29:27.105226 [debug] [Thread-1 ]: SQL status: BEGIN in 0.19 seconds +15:29:27.105982 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +15:29:27.106350 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +15:29:27.106726 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ + + create view "postgres"."public"."wins_losses__dbt_tmp" as ( + + +--number of wins and losses per player per game (per office) per season +WITH loss_table AS ( + SELECT + SUM(lt.left_losses) AS "total_losses" + , lt.left_player_id AS "loss_player_id" + , lt.gameid + , lt.seasonid + FROM + ( + SELECT + * + FROM + ( + --Begin DONE + WITH left_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore > m.rightscore THEN 0 + ELSE 1 + END) AS "left_loss" + , l."A" + , l."B" + , m."gameid" + , m."seasonid" + FROM + "_left" l + JOIN "Match" m ON + l."A" = m.id + GROUP BY + l."A" + , l."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.left_loss) AS "left_losses" + , a."B" AS "left_player_id" + , a."gameid" + , a."seasonid" + FROM + left_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + --End DONE + ) ll + UNION ALL + SELECT + * + FROM + ( + --Begin DONE + WITH right_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore < m.rightscore THEN 0 + ELSE 1 + END) AS "right_loss" + , r."A" + , r."B" + , m."gameid" + , m."seasonid" + FROM + "_right" r + JOIN "Match" m ON + r."A" = m.id + GROUP BY + r."A" + , r."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.right_loss) AS "right_losses" + , a."B" AS "right_player_id" + , a."gameid" + , a."seasonid" + FROM + right_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + --End DONE + ) rl + ) lt + -- WHERE lt.left_player_id = '' + GROUP BY + lt.left_player_id + , lt.gameid + , lt.seasonid +) +, +win_table AS ( + --number of wins for a player and gameid + SELECT + SUM(rt.right_wins) AS "total_wins" + , rt.right_player_id AS "win_player_id" + , rt.gameid + , rt."seasonid" + FROM + ( + SELECT + * + FROM + ( + WITH right_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore < m.rightscore THEN 1 + ELSE 0 + END) AS "right_won" + , r."A" + , r."B" + , m."gameid" + , m."seasonid" + FROM + "_right" r + JOIN "Match" m ON + r."A" = m.id + GROUP BY + r."A" + , r."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.right_won) AS "right_wins" + , a."B" AS "right_player_id" + , a."gameid" + , a."seasonid" + FROM + right_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + ) rw + UNION ALL + SELECT + * + FROM + ( + WITH left_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore > m.rightscore THEN 1 + ELSE 0 + END) AS "left_won" + , l."A" + , l."B" + , m."gameid" + , m."seasonid" + FROM + "_left" l + JOIN "Match" m ON + l."A" = m.id + GROUP BY + l."A" + , l."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.left_won) AS "left_wins" + , a."B" AS "left_player_id" + , a."gameid" + , a."seasonid" + FROM + left_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + ) lw + ) rt + -- WHERE rt.right_player_id = '' + GROUP BY + rt.right_player_id + , rt.gameid + , rt."seasonid" +) +SELECT + COALESCE(lt.loss_player_id, wt.win_player_id) AS "player_id" + , COALESCE(lt."gameid", wt."gameid") AS "gameid" + , COALESCE(lt.seasonid, wt.seasonid) AS "seasonid" + , wt."total_wins" + , lt."total_losses" +FROM + loss_table lt +FULL OUTER JOIN win_table wt ON + lt."loss_player_id" = wt."win_player_id" + AND lt."gameid" = wt."gameid" + AND lt."seasonid" = wt."seasonid" + ); +15:29:27.107060 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ + + create view "postgres"."public"."my_first_dbt_model__dbt_tmp" as ( + /* + 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 + ); +15:29:27.129095 [debug] [Thread-1 ]: SQL status: CREATE VIEW in 0.02 seconds +15:29:27.137831 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +15:29:27.137971 [debug] [Thread-2 ]: SQL status: CREATE VIEW in 0.03 seconds +15:29:27.138124 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ +alter table "postgres"."public"."my_first_dbt_model" rename to "my_first_dbt_model__dbt_backup" +15:29:27.159129 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +15:29:27.159338 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ +alter table "postgres"."public"."wins_losses" rename to "wins_losses__dbt_backup" +15:29:27.178420 [debug] [Thread-1 ]: SQL status: ALTER TABLE in 0.02 seconds +15:29:27.179434 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +15:29:27.179505 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ +alter table "postgres"."public"."my_first_dbt_model__dbt_tmp" rename to "my_first_dbt_model" +15:29:27.179583 [debug] [Thread-2 ]: SQL status: ALTER TABLE in 0.02 seconds +15:29:27.180521 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +15:29:27.180590 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ +alter table "postgres"."public"."wins_losses__dbt_tmp" rename to "wins_losses" +15:29:27.197692 [debug] [Thread-1 ]: SQL status: ALTER TABLE in 0.02 seconds +15:29:27.200648 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: COMMIT +15:29:27.200721 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +15:29:27.200777 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: COMMIT +15:29:27.201468 [debug] [Thread-2 ]: SQL status: ALTER TABLE in 0.02 seconds +15:29:27.201974 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: COMMIT +15:29:27.202036 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +15:29:27.202088 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: COMMIT +15:29:27.219653 [debug] [Thread-1 ]: SQL status: COMMIT in 0.02 seconds +15:29:27.221657 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +15:29:27.221728 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ +drop view if exists "postgres"."public"."my_first_dbt_model__dbt_backup" cascade +15:29:27.231955 [debug] [Thread-2 ]: SQL status: COMMIT in 0.03 seconds +15:29:27.232614 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +15:29:27.232677 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ +drop table if exists "postgres"."public"."wins_losses__dbt_backup" cascade +15:29:27.246160 [debug] [Thread-1 ]: SQL status: DROP VIEW in 0.02 seconds +15:29:27.246633 [debug] [Thread-1 ]: finished collecting timing info +15:29:27.246709 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: Close +15:29:27.246943 [debug] [Thread-1 ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e59d41be-104b-4649-b36f-38b582ed2bb9', 'context': []} +15:29:27.247086 [info ] [Thread-1 ]: 1 of 3 OK created view model public.my_first_dbt_model ......................... [CREATE VIEW in 0.35s] +15:29:27.247268 [debug] [Thread-1 ]: Finished running node model.wrkplay_dbt.my_first_dbt_model +15:29:27.247421 [debug] [Thread-4 ]: Began running node model.wrkplay_dbt.my_second_dbt_model +15:29:27.247517 [info ] [Thread-4 ]: 3 of 3 START view model public.my_second_dbt_model ............................. [RUN] +15:29:27.247680 [debug] [Thread-4 ]: Acquiring new postgres connection "model.wrkplay_dbt.my_second_dbt_model" +15:29:27.247739 [debug] [Thread-4 ]: Began compiling node model.wrkplay_dbt.my_second_dbt_model +15:29:27.247797 [debug] [Thread-4 ]: Compiling model.wrkplay_dbt.my_second_dbt_model +15:29:27.248746 [debug] [Thread-4 ]: Writing injected SQL for node "model.wrkplay_dbt.my_second_dbt_model" +15:29:27.249062 [debug] [Thread-4 ]: finished collecting timing info +15:29:27.249125 [debug] [Thread-4 ]: Began executing node model.wrkplay_dbt.my_second_dbt_model +15:29:27.250209 [debug] [Thread-4 ]: Writing runtime SQL for node "model.wrkplay_dbt.my_second_dbt_model" +15:29:27.250393 [debug] [Thread-4 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +15:29:27.250455 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: BEGIN +15:29:27.250506 [debug] [Thread-4 ]: Opening a new connection, currently in state init +15:29:27.254881 [debug] [Thread-2 ]: SQL status: DROP TABLE in 0.02 seconds +15:29:27.255340 [debug] [Thread-2 ]: finished collecting timing info +15:29:27.255411 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: Close +15:29:27.255617 [debug] [Thread-2 ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e59d41be-104b-4649-b36f-38b582ed2bb9', 'context': []} +15:29:27.255740 [info ] [Thread-2 ]: 2 of 3 OK created view model public.wins_losses ................................ [CREATE VIEW in 0.36s] +15:29:27.255897 [debug] [Thread-2 ]: Finished running node model.wrkplay_dbt.wins_losses +15:29:27.447306 [debug] [Thread-4 ]: SQL status: BEGIN in 0.2 seconds +15:29:27.448318 [debug] [Thread-4 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +15:29:27.448841 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_second_dbt_model"} */ + + create view "postgres"."public"."my_second_dbt_model__dbt_tmp" as ( + -- Use the `ref` function to select from other models + +select * +from "postgres"."public"."my_first_dbt_model" +where id = 1 + ); +15:29:27.472252 [debug] [Thread-4 ]: SQL status: CREATE VIEW in 0.02 seconds +15:29:27.478821 [debug] [Thread-4 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +15:29:27.478997 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_second_dbt_model"} */ +alter table "postgres"."public"."my_second_dbt_model__dbt_tmp" rename to "my_second_dbt_model" +15:29:27.501834 [debug] [Thread-4 ]: SQL status: ALTER TABLE in 0.02 seconds +15:29:27.506056 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: COMMIT +15:29:27.506583 [debug] [Thread-4 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +15:29:27.506778 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: COMMIT +15:29:27.527833 [debug] [Thread-4 ]: SQL status: COMMIT in 0.02 seconds +15:29:27.531962 [debug] [Thread-4 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +15:29:27.532234 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_second_dbt_model"} */ +drop view if exists "postgres"."public"."my_second_dbt_model__dbt_backup" cascade +15:29:27.551406 [debug] [Thread-4 ]: SQL status: DROP VIEW in 0.02 seconds +15:29:27.555082 [debug] [Thread-4 ]: finished collecting timing info +15:29:27.555567 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: Close +15:29:27.556694 [debug] [Thread-4 ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'e59d41be-104b-4649-b36f-38b582ed2bb9', 'context': []} +15:29:27.557058 [info ] [Thread-4 ]: 3 of 3 OK created view model public.my_second_dbt_model ........................ [CREATE VIEW in 0.31s] +15:29:27.557331 [debug] [Thread-4 ]: Finished running node model.wrkplay_dbt.my_second_dbt_model +15:29:27.559027 [debug] [MainThread]: Acquiring new postgres connection "master" +15:29:27.559465 [debug] [MainThread]: Using postgres connection "master" +15:29:27.559651 [debug] [MainThread]: On master: BEGIN +15:29:27.559815 [debug] [MainThread]: Opening a new connection, currently in state closed +15:29:27.758663 [debug] [MainThread]: SQL status: BEGIN in 0.2 seconds +15:29:27.759625 [debug] [MainThread]: On master: COMMIT +15:29:27.760075 [debug] [MainThread]: Using postgres connection "master" +15:29:27.760412 [debug] [MainThread]: On master: COMMIT +15:29:27.780594 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +15:29:27.781286 [debug] [MainThread]: On master: Close +15:29:27.782658 [info ] [MainThread]: +15:29:27.783271 [info ] [MainThread]: Finished running 3 view models in 1.82s. +15:29:27.783596 [debug] [MainThread]: Connection 'master' was properly closed. +15:29:27.783758 [debug] [MainThread]: Connection 'model.wrkplay_dbt.my_first_dbt_model' was properly closed. +15:29:27.783924 [debug] [MainThread]: Connection 'model.wrkplay_dbt.wins_losses' was properly closed. +15:29:27.784070 [debug] [MainThread]: Connection 'model.wrkplay_dbt.my_second_dbt_model' was properly closed. +15:29:27.788961 [info ] [MainThread]: +15:29:27.789176 [info ] [MainThread]: Completed successfully +15:29:27.789299 [info ] [MainThread]: +15:29:27.789392 [info ] [MainThread]: Done. PASS=3 WARN=0 ERROR=0 SKIP=0 TOTAL=3 +15:29:27.789554 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [, , ]} + + +============================== 2022-07-08 15:34:00.284325 | 3edba8d5-08ab-4473-9a27-dfb95e24bc3f ============================== +15:34:00.284357 [info ] [MainThread]: Running with dbt=1.1.1 +15:34:00.285250 [debug] [MainThread]: running dbt with arguments {'write_json': True, 'use_colors': True, 'printer_width': 80, 'version_check': True, 'partial_parse': True, 'static_parser': True, 'profiles_dir': '/Users/bruno.campos/.dbt', 'send_anonymous_usage_stats': True, 'event_buffer_size': 100000, 'quiet': False, 'no_print': False, 'which': 'run', 'rpc_method': 'run', 'indirect_selection': 'eager'} +15:34:00.285342 [debug] [MainThread]: Tracking: tracking +15:34:00.309701 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [, , ]} +15:34:00.330251 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 1 files changed. +15:34:00.330637 [debug] [MainThread]: Partial parsing: updated file: wrkplay_dbt://models/wins_losses.sql +15:34:00.337777 [debug] [MainThread]: 1699: static parser successfully parsed wins_losses.sql +15:34:00.368902 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '3edba8d5-08ab-4473-9a27-dfb95e24bc3f', 'context': []} +15:34:00.390455 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '3edba8d5-08ab-4473-9a27-dfb95e24bc3f', 'context': []} +15:34:00.390678 [info ] [MainThread]: Found 3 models, 10 tests, 0 snapshots, 0 analyses, 167 macros, 0 operations, 0 seed files, 0 sources, 0 exposures, 0 metrics +15:34:00.390817 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '3edba8d5-08ab-4473-9a27-dfb95e24bc3f', 'context': []} +15:34:00.391637 [info ] [MainThread]: +15:34:00.391882 [debug] [MainThread]: Acquiring new postgres connection "master" +15:34:00.392354 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres" +15:34:00.396946 [debug] [ThreadPool]: Using postgres connection "list_postgres" +15:34:00.397036 [debug] [ThreadPool]: On list_postgres: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres"} */ + + select distinct nspname from pg_namespace + +15:34:00.397101 [debug] [ThreadPool]: Opening a new connection, currently in state init +15:34:01.117588 [debug] [ThreadPool]: SQL status: SELECT 10 in 0.72 seconds +15:34:01.121652 [debug] [ThreadPool]: On list_postgres: Close +15:34:01.123110 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres_public" +15:34:01.126505 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +15:34:01.126611 [debug] [ThreadPool]: On list_postgres_public: BEGIN +15:34:01.126671 [debug] [ThreadPool]: Opening a new connection, currently in state closed +15:34:01.681733 [debug] [ThreadPool]: SQL status: BEGIN in 0.55 seconds +15:34:01.682789 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +15:34:01.683172 [debug] [ThreadPool]: On list_postgres_public: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres_public"} */ +select + 'postgres' as database, + tablename as name, + schemaname as schema, + 'table' as type + from pg_tables + where schemaname ilike 'public' + union all + select + 'postgres' as database, + viewname as name, + schemaname as schema, + 'view' as type + from pg_views + where schemaname ilike 'public' + +15:34:01.706427 [debug] [ThreadPool]: SQL status: SELECT 19 in 0.02 seconds +15:34:01.710344 [debug] [ThreadPool]: On list_postgres_public: ROLLBACK +15:34:01.728162 [debug] [ThreadPool]: On list_postgres_public: Close +15:34:01.735823 [debug] [MainThread]: Using postgres connection "master" +15:34:01.735948 [debug] [MainThread]: On master: BEGIN +15:34:01.736008 [debug] [MainThread]: Opening a new connection, currently in state init +15:34:02.128920 [debug] [MainThread]: SQL status: BEGIN in 0.39 seconds +15:34:02.130336 [debug] [MainThread]: Using postgres connection "master" +15:34:02.130777 [debug] [MainThread]: On master: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "master"} */ +with relation as ( + select + pg_rewrite.ev_class as class, + pg_rewrite.oid as id + from pg_rewrite + ), + class as ( + select + oid as id, + relname as name, + relnamespace as schema, + relkind as kind + from pg_class + ), + dependency as ( + select distinct + pg_depend.objid as id, + pg_depend.refobjid as ref + from pg_depend + ), + schema as ( + select + pg_namespace.oid as id, + pg_namespace.nspname as name + from pg_namespace + where nspname != 'information_schema' and nspname not like 'pg\_%' + ), + referenced as ( + select + relation.id AS id, + referenced_class.name , + referenced_class.schema , + referenced_class.kind + from relation + join class as referenced_class on relation.class=referenced_class.id + where referenced_class.kind in ('r', 'v') + ), + relationships as ( + select + referenced.name as referenced_name, + referenced.schema as referenced_schema_id, + dependent_class.name as dependent_name, + dependent_class.schema as dependent_schema_id, + referenced.kind as kind + from referenced + join dependency on referenced.id=dependency.id + join class as dependent_class on dependency.ref=dependent_class.id + where + (referenced.name != dependent_class.name or + referenced.schema != dependent_class.schema) + ) + + select + referenced_schema.name as referenced_schema, + relationships.referenced_name as referenced_name, + dependent_schema.name as dependent_schema, + relationships.dependent_name as dependent_name + from relationships + join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id + join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id + group by referenced_schema, referenced_name, dependent_schema, dependent_name + order by referenced_schema, referenced_name, dependent_schema, dependent_name; +15:34:02.300479 [debug] [MainThread]: SQL status: SELECT 4 in 0.17 seconds +15:34:02.303180 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '3edba8d5-08ab-4473-9a27-dfb95e24bc3f', 'context': []} +15:34:02.303960 [debug] [MainThread]: On master: ROLLBACK +15:34:02.565811 [debug] [MainThread]: Using postgres connection "master" +15:34:02.567435 [debug] [MainThread]: On master: BEGIN +15:34:02.604661 [debug] [MainThread]: SQL status: BEGIN in 0.04 seconds +15:34:02.605601 [debug] [MainThread]: On master: COMMIT +15:34:02.605801 [debug] [MainThread]: Using postgres connection "master" +15:34:02.605974 [debug] [MainThread]: On master: COMMIT +15:34:02.623913 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +15:34:02.624730 [debug] [MainThread]: On master: Close +15:34:02.626791 [info ] [MainThread]: Concurrency: 10 threads (target='dev') +15:34:02.627747 [info ] [MainThread]: +15:34:02.632301 [debug] [Thread-1 ]: Began running node model.wrkplay_dbt.my_first_dbt_model +15:34:02.632391 [debug] [Thread-2 ]: Began running node model.wrkplay_dbt.wins_losses +15:34:02.632604 [info ] [Thread-1 ]: 1 of 3 START view model public.my_first_dbt_model .............................. [RUN] +15:34:02.632729 [info ] [Thread-2 ]: 2 of 3 START view model public.wins_losses ..................................... [RUN] +15:34:02.632987 [debug] [Thread-1 ]: Acquiring new postgres connection "model.wrkplay_dbt.my_first_dbt_model" +15:34:02.633159 [debug] [Thread-2 ]: Acquiring new postgres connection "model.wrkplay_dbt.wins_losses" +15:34:02.633238 [debug] [Thread-1 ]: Began compiling node model.wrkplay_dbt.my_first_dbt_model +15:34:02.633303 [debug] [Thread-2 ]: Began compiling node model.wrkplay_dbt.wins_losses +15:34:02.633398 [debug] [Thread-1 ]: Compiling model.wrkplay_dbt.my_first_dbt_model +15:34:02.633458 [debug] [Thread-2 ]: Compiling model.wrkplay_dbt.wins_losses +15:34:02.635023 [debug] [Thread-1 ]: Writing injected SQL for node "model.wrkplay_dbt.my_first_dbt_model" +15:34:02.635651 [debug] [Thread-2 ]: Writing injected SQL for node "model.wrkplay_dbt.wins_losses" +15:34:02.636324 [debug] [Thread-1 ]: finished collecting timing info +15:34:02.636396 [debug] [Thread-1 ]: Began executing node model.wrkplay_dbt.my_first_dbt_model +15:34:02.646899 [debug] [Thread-1 ]: Writing runtime SQL for node "model.wrkplay_dbt.my_first_dbt_model" +15:34:02.647072 [debug] [Thread-2 ]: finished collecting timing info +15:34:02.647145 [debug] [Thread-2 ]: Began executing node model.wrkplay_dbt.wins_losses +15:34:02.648257 [debug] [Thread-2 ]: Writing runtime SQL for node "model.wrkplay_dbt.wins_losses" +15:34:02.648438 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +15:34:02.648505 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: BEGIN +15:34:02.648561 [debug] [Thread-1 ]: Opening a new connection, currently in state closed +15:34:02.648753 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +15:34:02.648816 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: BEGIN +15:34:02.648867 [debug] [Thread-2 ]: Opening a new connection, currently in state init +15:34:02.864359 [debug] [Thread-2 ]: SQL status: BEGIN in 0.22 seconds +15:34:02.865542 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +15:34:02.865836 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ + + create view "postgres"."public"."wins_losses__dbt_tmp" as ( + --number of wins and losses per player per game (per office) per season +WITH loss_table AS ( + SELECT + SUM(lt.left_losses) AS "total_losses" + , lt.left_player_id AS "loss_player_id" + , lt.gameid + , lt.seasonid + FROM + ( + SELECT + * + FROM + ( + --Begin DONE + WITH left_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore > m.rightscore THEN 0 + ELSE 1 + END) AS "left_loss" + , l."A" + , l."B" + , m."gameid" + , m."seasonid" + FROM + "_left" l + JOIN "Match" m ON + l."A" = m.id + GROUP BY + l."A" + , l."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.left_loss) AS "left_losses" + , a."B" AS "left_player_id" + , a."gameid" + , a."seasonid" + FROM + left_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + --End DONE + ) ll + UNION ALL + SELECT + * + FROM + ( + --Begin DONE + WITH right_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore < m.rightscore THEN 0 + ELSE 1 + END) AS "right_loss" + , r."A" + , r."B" + , m."gameid" + , m."seasonid" + FROM + "_right" r + JOIN "Match" m ON + r."A" = m.id + GROUP BY + r."A" + , r."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.right_loss) AS "right_losses" + , a."B" AS "right_player_id" + , a."gameid" + , a."seasonid" + FROM + right_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + --End DONE + ) rl + ) lt + -- WHERE lt.left_player_id = '' + GROUP BY + lt.left_player_id + , lt.gameid + , lt.seasonid +) +, +win_table AS ( + --number of wins for a player and gameid + SELECT + SUM(rt.right_wins) AS "total_wins" + , rt.right_player_id AS "win_player_id" + , rt.gameid + , rt."seasonid" + FROM + ( + SELECT + * + FROM + ( + WITH right_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore < m.rightscore THEN 1 + ELSE 0 + END) AS "right_won" + , r."A" + , r."B" + , m."gameid" + , m."seasonid" + FROM + "_right" r + JOIN "Match" m ON + r."A" = m.id + GROUP BY + r."A" + , r."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.right_won) AS "right_wins" + , a."B" AS "right_player_id" + , a."gameid" + , a."seasonid" + FROM + right_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + ) rw + UNION ALL + SELECT + * + FROM + ( + WITH left_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore > m.rightscore THEN 1 + ELSE 0 + END) AS "left_won" + , l."A" + , l."B" + , m."gameid" + , m."seasonid" + FROM + "_left" l + JOIN "Match" m ON + l."A" = m.id + GROUP BY + l."A" + , l."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.left_won) AS "left_wins" + , a."B" AS "left_player_id" + , a."gameid" + , a."seasonid" + FROM + left_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + ) lw + ) rt + -- WHERE rt.right_player_id = '' + GROUP BY + rt.right_player_id + , rt.gameid + , rt."seasonid" +) +SELECT + COALESCE(lt.loss_player_id, wt.win_player_id) AS "player_id" + , COALESCE(lt."gameid", wt."gameid") AS "gameid" + , COALESCE(lt.seasonid, wt.seasonid) AS "seasonid" + , wt."total_wins" + , lt."total_losses" +FROM + loss_table lt +FULL OUTER JOIN win_table wt ON + lt."loss_player_id" = wt."win_player_id" + AND lt."gameid" = wt."gameid" + AND lt."seasonid" = wt."seasonid" + ); +15:34:02.901278 [debug] [Thread-2 ]: SQL status: CREATE VIEW in 0.04 seconds +15:34:02.909350 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +15:34:02.909500 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ +alter table "postgres"."public"."wins_losses" rename to "wins_losses__dbt_backup" +15:34:02.914259 [debug] [Thread-1 ]: SQL status: BEGIN in 0.27 seconds +15:34:02.914319 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +15:34:02.914369 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ + + create view "postgres"."public"."my_first_dbt_model__dbt_tmp" as ( + /* + 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 + ); +15:34:02.928524 [debug] [Thread-2 ]: SQL status: ALTER TABLE in 0.02 seconds +15:34:02.953219 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +15:34:02.953374 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ +alter table "postgres"."public"."wins_losses__dbt_tmp" rename to "wins_losses" +15:34:03.092029 [debug] [Thread-1 ]: SQL status: CREATE VIEW in 0.18 seconds +15:34:03.097428 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +15:34:03.097556 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ +alter table "postgres"."public"."my_first_dbt_model" rename to "my_first_dbt_model__dbt_backup" +15:34:03.123164 [debug] [Thread-2 ]: SQL status: ALTER TABLE in 0.17 seconds +15:34:03.130918 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: COMMIT +15:34:03.131022 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +15:34:03.131083 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: COMMIT +15:34:03.140431 [debug] [Thread-1 ]: SQL status: ALTER TABLE in 0.04 seconds +15:34:03.142592 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +15:34:03.142697 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ +alter table "postgres"."public"."my_first_dbt_model__dbt_tmp" rename to "my_first_dbt_model" +15:34:03.150535 [debug] [Thread-2 ]: SQL status: COMMIT in 0.02 seconds +15:34:03.156659 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +15:34:03.156769 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ +drop view if exists "postgres"."public"."wins_losses__dbt_backup" cascade +15:34:03.164304 [debug] [Thread-1 ]: SQL status: ALTER TABLE in 0.02 seconds +15:34:03.167713 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: COMMIT +15:34:03.168475 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +15:34:03.168661 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: COMMIT +15:34:03.178473 [debug] [Thread-2 ]: SQL status: DROP VIEW in 0.02 seconds +15:34:03.182111 [debug] [Thread-2 ]: finished collecting timing info +15:34:03.182601 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: Close +15:34:03.183649 [debug] [Thread-2 ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '3edba8d5-08ab-4473-9a27-dfb95e24bc3f', 'context': []} +15:34:03.183917 [info ] [Thread-2 ]: 2 of 3 OK created view model public.wins_losses ................................ [CREATE VIEW in 0.55s] +15:34:03.184178 [debug] [Thread-2 ]: Finished running node model.wrkplay_dbt.wins_losses +15:34:03.187700 [debug] [Thread-1 ]: SQL status: COMMIT in 0.02 seconds +15:34:03.188576 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +15:34:03.188640 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ +drop view if exists "postgres"."public"."my_first_dbt_model__dbt_backup" cascade +15:34:03.212603 [debug] [Thread-1 ]: SQL status: DROP VIEW in 0.02 seconds +15:34:03.215495 [debug] [Thread-1 ]: finished collecting timing info +15:34:03.215849 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: Close +15:34:03.216602 [debug] [Thread-1 ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '3edba8d5-08ab-4473-9a27-dfb95e24bc3f', 'context': []} +15:34:03.216772 [info ] [Thread-1 ]: 1 of 3 OK created view model public.my_first_dbt_model ......................... [CREATE VIEW in 0.58s] +15:34:03.216947 [debug] [Thread-1 ]: Finished running node model.wrkplay_dbt.my_first_dbt_model +15:34:03.217202 [debug] [Thread-4 ]: Began running node model.wrkplay_dbt.my_second_dbt_model +15:34:03.217432 [info ] [Thread-4 ]: 3 of 3 START view model public.my_second_dbt_model ............................. [RUN] +15:34:03.217682 [debug] [Thread-4 ]: Acquiring new postgres connection "model.wrkplay_dbt.my_second_dbt_model" +15:34:03.217746 [debug] [Thread-4 ]: Began compiling node model.wrkplay_dbt.my_second_dbt_model +15:34:03.217814 [debug] [Thread-4 ]: Compiling model.wrkplay_dbt.my_second_dbt_model +15:34:03.218987 [debug] [Thread-4 ]: Writing injected SQL for node "model.wrkplay_dbt.my_second_dbt_model" +15:34:03.219443 [debug] [Thread-4 ]: finished collecting timing info +15:34:03.219514 [debug] [Thread-4 ]: Began executing node model.wrkplay_dbt.my_second_dbt_model +15:34:03.220681 [debug] [Thread-4 ]: Writing runtime SQL for node "model.wrkplay_dbt.my_second_dbt_model" +15:34:03.220899 [debug] [Thread-4 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +15:34:03.220958 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: BEGIN +15:34:03.221013 [debug] [Thread-4 ]: Opening a new connection, currently in state init +15:34:03.706082 [debug] [Thread-4 ]: SQL status: BEGIN in 0.49 seconds +15:34:03.706741 [debug] [Thread-4 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +15:34:03.707104 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_second_dbt_model"} */ + + create view "postgres"."public"."my_second_dbt_model__dbt_tmp" as ( + -- Use the `ref` function to select from other models + +select * +from "postgres"."public"."my_first_dbt_model" +where id = 1 + ); +15:34:03.730195 [debug] [Thread-4 ]: SQL status: CREATE VIEW in 0.02 seconds +15:34:03.733775 [debug] [Thread-4 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +15:34:03.734081 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_second_dbt_model"} */ +alter table "postgres"."public"."my_second_dbt_model__dbt_tmp" rename to "my_second_dbt_model" +15:34:03.754049 [debug] [Thread-4 ]: SQL status: ALTER TABLE in 0.02 seconds +15:34:03.756120 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: COMMIT +15:34:03.756320 [debug] [Thread-4 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +15:34:03.756488 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: COMMIT +15:34:03.799815 [debug] [Thread-4 ]: SQL status: COMMIT in 0.04 seconds +15:34:03.802516 [debug] [Thread-4 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +15:34:03.802732 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_second_dbt_model"} */ +drop view if exists "postgres"."public"."my_second_dbt_model__dbt_backup" cascade +15:34:03.822542 [debug] [Thread-4 ]: SQL status: DROP VIEW in 0.02 seconds +15:34:03.824456 [debug] [Thread-4 ]: finished collecting timing info +15:34:03.824773 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: Close +15:34:03.825618 [debug] [Thread-4 ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '3edba8d5-08ab-4473-9a27-dfb95e24bc3f', 'context': []} +15:34:03.826128 [info ] [Thread-4 ]: 3 of 3 OK created view model public.my_second_dbt_model ........................ [CREATE VIEW in 0.61s] +15:34:03.826631 [debug] [Thread-4 ]: Finished running node model.wrkplay_dbt.my_second_dbt_model +15:34:03.827471 [debug] [MainThread]: Acquiring new postgres connection "master" +15:34:03.827594 [debug] [MainThread]: Using postgres connection "master" +15:34:03.827659 [debug] [MainThread]: On master: BEGIN +15:34:03.827714 [debug] [MainThread]: Opening a new connection, currently in state closed +15:34:04.177898 [debug] [MainThread]: SQL status: BEGIN in 0.35 seconds +15:34:04.179173 [debug] [MainThread]: On master: COMMIT +15:34:04.179404 [debug] [MainThread]: Using postgres connection "master" +15:34:04.179628 [debug] [MainThread]: On master: COMMIT +15:34:04.206560 [debug] [MainThread]: SQL status: COMMIT in 0.03 seconds +15:34:04.207849 [debug] [MainThread]: On master: Close +15:34:04.209687 [info ] [MainThread]: +15:34:04.210353 [info ] [MainThread]: Finished running 3 view models in 3.82s. +15:34:04.210752 [debug] [MainThread]: Connection 'master' was properly closed. +15:34:04.210824 [debug] [MainThread]: Connection 'model.wrkplay_dbt.my_first_dbt_model' was properly closed. +15:34:04.210880 [debug] [MainThread]: Connection 'model.wrkplay_dbt.wins_losses' was properly closed. +15:34:04.210929 [debug] [MainThread]: Connection 'model.wrkplay_dbt.my_second_dbt_model' was properly closed. +15:34:04.214674 [info ] [MainThread]: +15:34:04.214795 [info ] [MainThread]: Completed successfully +15:34:04.214911 [info ] [MainThread]: +15:34:04.215005 [info ] [MainThread]: Done. PASS=3 WARN=0 ERROR=0 SKIP=0 TOTAL=3 +15:34:04.215156 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [, , ]} + + +============================== 2022-07-08 16:01:10.850144 | 0ca79c55-9be5-42f2-a2c7-cd11d6cb9d17 ============================== +16:01:10.850159 [info ] [MainThread]: Running with dbt=1.1.1 +16:01:10.850857 [debug] [MainThread]: running dbt with arguments {'write_json': True, 'use_colors': True, 'printer_width': 80, 'version_check': True, 'partial_parse': True, 'static_parser': True, 'profiles_dir': '/Users/bruno.campos/.dbt', 'send_anonymous_usage_stats': True, 'event_buffer_size': 100000, 'quiet': False, 'no_print': False, 'indirect_selection': 'eager', 'which': 'test', 'rpc_method': 'test'} +16:01:10.850945 [debug] [MainThread]: Tracking: tracking +16:01:10.873845 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [, , ]} +16:01:10.894194 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 0 files changed. +16:01:10.894354 [debug] [MainThread]: Partial parsing enabled, no changes found, skipping parsing +16:01:10.898083 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '0ca79c55-9be5-42f2-a2c7-cd11d6cb9d17', 'context': []} +16:01:10.901403 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '0ca79c55-9be5-42f2-a2c7-cd11d6cb9d17', 'context': []} +16:01:10.901595 [info ] [MainThread]: Found 3 models, 10 tests, 0 snapshots, 0 analyses, 167 macros, 0 operations, 0 seed files, 0 sources, 0 exposures, 0 metrics +16:01:10.901743 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '0ca79c55-9be5-42f2-a2c7-cd11d6cb9d17', 'context': []} +16:01:10.902679 [info ] [MainThread]: +16:01:10.902955 [debug] [MainThread]: Acquiring new postgres connection "master" +16:01:10.903469 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres_public" +16:01:10.908234 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +16:01:10.908345 [debug] [ThreadPool]: On list_postgres_public: BEGIN +16:01:10.908452 [debug] [ThreadPool]: Opening a new connection, currently in state init +16:01:11.371605 [debug] [ThreadPool]: SQL status: BEGIN in 0.46 seconds +16:01:11.373069 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +16:01:11.373451 [debug] [ThreadPool]: On list_postgres_public: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres_public"} */ +select + 'postgres' as database, + tablename as name, + schemaname as schema, + 'table' as type + from pg_tables + where schemaname ilike 'public' + union all + select + 'postgres' as database, + viewname as name, + schemaname as schema, + 'view' as type + from pg_views + where schemaname ilike 'public' + +16:01:11.395527 [debug] [ThreadPool]: SQL status: SELECT 19 in 0.02 seconds +16:01:11.400237 [debug] [ThreadPool]: On list_postgres_public: ROLLBACK +16:01:11.505032 [debug] [ThreadPool]: On list_postgres_public: Close +16:01:11.512712 [debug] [MainThread]: Using postgres connection "master" +16:01:11.512850 [debug] [MainThread]: On master: BEGIN +16:01:11.512919 [debug] [MainThread]: Opening a new connection, currently in state init +16:01:11.982116 [debug] [MainThread]: SQL status: BEGIN in 0.47 seconds +16:01:11.982933 [debug] [MainThread]: Using postgres connection "master" +16:01:11.983440 [debug] [MainThread]: On master: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "master"} */ +with relation as ( + select + pg_rewrite.ev_class as class, + pg_rewrite.oid as id + from pg_rewrite + ), + class as ( + select + oid as id, + relname as name, + relnamespace as schema, + relkind as kind + from pg_class + ), + dependency as ( + select distinct + pg_depend.objid as id, + pg_depend.refobjid as ref + from pg_depend + ), + schema as ( + select + pg_namespace.oid as id, + pg_namespace.nspname as name + from pg_namespace + where nspname != 'information_schema' and nspname not like 'pg\_%' + ), + referenced as ( + select + relation.id AS id, + referenced_class.name , + referenced_class.schema , + referenced_class.kind + from relation + join class as referenced_class on relation.class=referenced_class.id + where referenced_class.kind in ('r', 'v') + ), + relationships as ( + select + referenced.name as referenced_name, + referenced.schema as referenced_schema_id, + dependent_class.name as dependent_name, + dependent_class.schema as dependent_schema_id, + referenced.kind as kind + from referenced + join dependency on referenced.id=dependency.id + join class as dependent_class on dependency.ref=dependent_class.id + where + (referenced.name != dependent_class.name or + referenced.schema != dependent_class.schema) + ) + + select + referenced_schema.name as referenced_schema, + relationships.referenced_name as referenced_name, + dependent_schema.name as dependent_schema, + relationships.dependent_name as dependent_name + from relationships + join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id + join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id + group by referenced_schema, referenced_name, dependent_schema, dependent_name + order by referenced_schema, referenced_name, dependent_schema, dependent_name; +16:01:12.159748 [debug] [MainThread]: SQL status: SELECT 4 in 0.18 seconds +16:01:12.163932 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '0ca79c55-9be5-42f2-a2c7-cd11d6cb9d17', 'context': []} +16:01:12.164897 [debug] [MainThread]: On master: ROLLBACK +16:01:12.189596 [debug] [MainThread]: Using postgres connection "master" +16:01:12.190317 [debug] [MainThread]: On master: BEGIN +16:01:12.233351 [debug] [MainThread]: SQL status: BEGIN in 0.04 seconds +16:01:12.233978 [debug] [MainThread]: On master: COMMIT +16:01:12.234165 [debug] [MainThread]: Using postgres connection "master" +16:01:12.234433 [debug] [MainThread]: On master: COMMIT +16:01:12.259674 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +16:01:12.260886 [debug] [MainThread]: On master: Close +16:01:12.262472 [info ] [MainThread]: Concurrency: 10 threads (target='dev') +16:01:12.263033 [info ] [MainThread]: +16:01:12.268360 [debug] [Thread-1 ]: Began running node test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +16:01:12.268472 [debug] [Thread-2 ]: Began running node test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +16:01:12.268543 [debug] [Thread-3 ]: Began running node test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +16:01:12.268604 [debug] [Thread-4 ]: Began running node test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +16:01:12.268664 [debug] [Thread-5 ]: Began running node test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +16:01:12.268765 [debug] [Thread-6 ]: Began running node test.wrkplay_dbt.positive_wins_losses_total_losses.159f570741 +16:01:12.268827 [debug] [Thread-7 ]: Began running node test.wrkplay_dbt.positive_wins_losses_total_wins.1e3c0d0dd6 +16:01:12.268881 [debug] [Thread-8 ]: Began running node test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +16:01:12.268959 [info ] [Thread-1 ]: 1 of 10 START test not_null_my_first_dbt_model_id .............................. [RUN] +16:01:12.269025 [debug] [Thread-9 ]: Began running node test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +16:01:12.269075 [debug] [Thread-10 ]: Began running node test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb +16:01:12.269141 [info ] [Thread-2 ]: 2 of 10 START test not_null_my_second_dbt_model_id ............................. [RUN] +16:01:12.269223 [info ] [Thread-3 ]: 3 of 10 START test not_null_wins_losses_gameid ................................. [RUN] +16:01:12.269293 [info ] [Thread-4 ]: 4 of 10 START test not_null_wins_losses_player_id .............................. [RUN] +16:01:12.269368 [info ] [Thread-5 ]: 5 of 10 START test not_null_wins_losses_seasonid ............................... [RUN] +16:01:12.269432 [info ] [Thread-6 ]: 6 of 10 START test positive_wins_losses_total_losses ........................... [RUN] +16:01:12.269496 [info ] [Thread-7 ]: 7 of 10 START test positive_wins_losses_total_wins ............................. [RUN] +16:01:12.269561 [info ] [Thread-8 ]: 8 of 10 START test unique_my_first_dbt_model_id ................................ [RUN] +16:01:12.269823 [debug] [Thread-1 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +16:01:12.269874 [info ] [Thread-9 ]: 9 of 10 START test unique_my_second_dbt_model_id ............................... [RUN] +16:01:12.269939 [info ] [Thread-10 ]: 10 of 10 START test unique_wins_losses_seasonid ................................ [RUN] +16:01:12.270125 [debug] [Thread-2 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +16:01:12.270305 [debug] [Thread-3 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +16:01:12.270459 [debug] [Thread-4 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +16:01:12.270621 [debug] [Thread-5 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +16:01:12.270772 [debug] [Thread-6 ]: Acquiring new postgres connection "test.wrkplay_dbt.positive_wins_losses_total_losses.159f570741" +16:01:12.270924 [debug] [Thread-7 ]: Acquiring new postgres connection "test.wrkplay_dbt.positive_wins_losses_total_wins.1e3c0d0dd6" +16:01:12.271083 [debug] [Thread-8 ]: Acquiring new postgres connection "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +16:01:12.271144 [debug] [Thread-1 ]: Began compiling node test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +16:01:12.271304 [debug] [Thread-9 ]: Acquiring new postgres connection "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +16:01:12.271441 [debug] [Thread-10 ]: Acquiring new postgres connection "test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb" +16:01:12.271497 [debug] [Thread-2 ]: Began compiling node test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +16:01:12.271551 [debug] [Thread-3 ]: Began compiling node test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +16:01:12.271652 [debug] [Thread-4 ]: Began compiling node test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +16:01:12.271706 [debug] [Thread-5 ]: Began compiling node test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +16:01:12.271760 [debug] [Thread-6 ]: Began compiling node test.wrkplay_dbt.positive_wins_losses_total_losses.159f570741 +16:01:12.271813 [debug] [Thread-7 ]: Began compiling node test.wrkplay_dbt.positive_wins_losses_total_wins.1e3c0d0dd6 +16:01:12.271867 [debug] [Thread-8 ]: Began compiling node test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +16:01:12.271949 [debug] [Thread-1 ]: Compiling test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +16:01:12.272001 [debug] [Thread-9 ]: Began compiling node test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +16:01:12.272051 [debug] [Thread-10 ]: Began compiling node test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb +16:01:12.272101 [debug] [Thread-2 ]: Compiling test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +16:01:12.272151 [debug] [Thread-3 ]: Compiling test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +16:01:12.272200 [debug] [Thread-4 ]: Compiling test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +16:01:12.272250 [debug] [Thread-5 ]: Compiling test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +16:01:12.272299 [debug] [Thread-6 ]: Compiling test.wrkplay_dbt.positive_wins_losses_total_losses.159f570741 +16:01:12.272347 [debug] [Thread-7 ]: Compiling test.wrkplay_dbt.positive_wins_losses_total_wins.1e3c0d0dd6 +16:01:12.272396 [debug] [Thread-8 ]: Compiling test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +16:01:12.278319 [debug] [Thread-1 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +16:01:12.278411 [debug] [Thread-9 ]: Compiling test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +16:01:12.278473 [debug] [Thread-10 ]: Compiling test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb +16:01:12.279927 [debug] [Thread-2 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +16:01:12.281355 [debug] [Thread-3 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +16:01:12.283216 [debug] [Thread-4 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +16:01:12.284645 [debug] [Thread-5 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +16:01:12.290005 [debug] [Thread-8 ]: Writing injected SQL for node "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +16:01:12.291552 [debug] [Thread-9 ]: Writing injected SQL for node "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +16:01:12.293008 [debug] [Thread-10 ]: Writing injected SQL for node "test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb" +16:01:12.293175 [debug] [Thread-1 ]: finished collecting timing info +16:01:12.293463 [debug] [Thread-6 ]: finished collecting timing info +16:01:12.293579 [debug] [Thread-7 ]: finished collecting timing info +16:01:12.293627 [debug] [Thread-2 ]: finished collecting timing info +16:01:12.293766 [debug] [Thread-4 ]: finished collecting timing info +16:01:12.293828 [debug] [Thread-3 ]: finished collecting timing info +16:01:12.293958 [debug] [Thread-5 ]: finished collecting timing info +16:01:12.294053 [debug] [Thread-1 ]: Began executing node test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +16:01:12.294196 [debug] [Thread-6 ]: Compilation Error in test positive_wins_losses_total_losses (models/schema.yml) + 'test_positive' is undefined. This can happen when calling a macro that does not exist. Check for typos and/or install package dependencies with "dbt deps". +16:01:12.294270 [debug] [Thread-8 ]: finished collecting timing info +16:01:12.294413 [debug] [Thread-7 ]: Compilation Error in test positive_wins_losses_total_wins (models/schema.yml) + 'test_positive' is undefined. This can happen when calling a macro that does not exist. Check for typos and/or install package dependencies with "dbt deps". +16:01:12.294494 [debug] [Thread-2 ]: Began executing node test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +16:01:12.294560 [debug] [Thread-4 ]: Began executing node test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +16:01:12.294620 [debug] [Thread-3 ]: Began executing node test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +16:01:12.294678 [debug] [Thread-5 ]: Began executing node test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +16:01:12.301164 [debug] [Thread-1 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +16:01:12.301286 [error] [Thread-6 ]: 6 of 10 ERROR positive_wins_losses_total_losses ................................ [ERROR in 0.03s] +16:01:12.301359 [debug] [Thread-10 ]: finished collecting timing info +16:01:12.301464 [debug] [Thread-8 ]: Began executing node test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +16:01:12.301513 [debug] [Thread-9 ]: finished collecting timing info +16:01:12.301608 [error] [Thread-7 ]: 7 of 10 ERROR positive_wins_losses_total_wins .................................. [ERROR in 0.03s] +16:01:12.302382 [debug] [Thread-2 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +16:01:12.303090 [debug] [Thread-4 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +16:01:12.303790 [debug] [Thread-3 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +16:01:12.304487 [debug] [Thread-5 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +16:01:12.304694 [debug] [Thread-6 ]: Finished running node test.wrkplay_dbt.positive_wins_losses_total_losses.159f570741 +16:01:12.304772 [debug] [Thread-10 ]: Began executing node test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb +16:01:12.305499 [debug] [Thread-8 ]: Writing runtime SQL for node "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +16:01:12.305565 [debug] [Thread-1 ]: Using postgres connection "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +16:01:12.305629 [debug] [Thread-9 ]: Began executing node test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +16:01:12.305768 [debug] [Thread-7 ]: Finished running node test.wrkplay_dbt.positive_wins_losses_total_wins.1e3c0d0dd6 +16:01:12.306046 [debug] [Thread-2 ]: Using postgres connection "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +16:01:12.306123 [debug] [Thread-4 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +16:01:12.306301 [debug] [Thread-3 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +16:01:12.307526 [debug] [Thread-10 ]: Writing runtime SQL for node "test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb" +16:01:12.307596 [debug] [Thread-5 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +16:01:12.307693 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710: BEGIN +16:01:12.330084 [debug] [Thread-9 ]: Writing runtime SQL for node "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +16:01:12.330216 [debug] [Thread-8 ]: Using postgres connection "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +16:01:12.330332 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778: BEGIN +16:01:12.330435 [debug] [Thread-4 ]: On test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15: BEGIN +16:01:12.330503 [debug] [Thread-3 ]: On test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1: BEGIN +16:01:12.330605 [debug] [Thread-5 ]: On test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813: BEGIN +16:01:12.330675 [debug] [Thread-1 ]: Opening a new connection, currently in state closed +16:01:12.330804 [debug] [Thread-8 ]: On test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321: BEGIN +16:01:12.330863 [debug] [Thread-10 ]: Using postgres connection "test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb" +16:01:12.330936 [debug] [Thread-2 ]: Opening a new connection, currently in state init +16:01:12.331005 [debug] [Thread-4 ]: Opening a new connection, currently in state init +16:01:12.331062 [debug] [Thread-9 ]: Using postgres connection "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +16:01:12.331123 [debug] [Thread-3 ]: Opening a new connection, currently in state init +16:01:12.331187 [debug] [Thread-5 ]: Opening a new connection, currently in state init +16:01:12.331367 [debug] [Thread-8 ]: Opening a new connection, currently in state init +16:01:12.331425 [debug] [Thread-10 ]: On test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb: BEGIN +16:01:12.331626 [debug] [Thread-9 ]: On test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493: BEGIN +16:01:12.331863 [debug] [Thread-10 ]: Opening a new connection, currently in state init +16:01:12.331922 [debug] [Thread-9 ]: Opening a new connection, currently in state init +16:01:12.728044 [debug] [Thread-9 ]: SQL status: BEGIN in 0.4 seconds +16:01:12.729626 [debug] [Thread-9 ]: Using postgres connection "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +16:01:12.730158 [debug] [Thread-9 ]: On test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + +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 + + + + + ) dbt_internal_test +16:01:12.730476 [debug] [Thread-3 ]: SQL status: BEGIN in 0.4 seconds +16:01:12.730771 [debug] [Thread-4 ]: SQL status: BEGIN in 0.4 seconds +16:01:12.731056 [debug] [Thread-3 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +16:01:12.731262 [debug] [Thread-4 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +16:01:12.731449 [debug] [Thread-3 ]: On test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select gameid +from "postgres"."public"."wins_losses" +where gameid is null + + + + + ) dbt_internal_test +16:01:12.731636 [debug] [Thread-4 ]: On test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select player_id +from "postgres"."public"."wins_losses" +where player_id is null + + + + + ) dbt_internal_test +16:01:12.780836 [debug] [Thread-10 ]: SQL status: BEGIN in 0.45 seconds +16:01:12.781709 [debug] [Thread-10 ]: Using postgres connection "test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb" +16:01:12.782188 [debug] [Thread-10 ]: On test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + +select + seasonid as unique_field, + count(*) as n_records + +from "postgres"."public"."wins_losses" +where seasonid is not null +group by seasonid +having count(*) > 1 + + + + + ) dbt_internal_test +16:01:12.782867 [debug] [Thread-1 ]: SQL status: BEGIN in 0.45 seconds +16:01:12.783223 [debug] [Thread-1 ]: Using postgres connection "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +16:01:12.783531 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select id +from "postgres"."public"."my_first_dbt_model" +where id is null + + + + + ) dbt_internal_test +16:01:12.787217 [debug] [Thread-8 ]: SQL status: BEGIN in 0.46 seconds +16:01:12.787391 [debug] [Thread-2 ]: SQL status: BEGIN in 0.46 seconds +16:01:12.787621 [debug] [Thread-8 ]: Using postgres connection "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +16:01:12.787851 [debug] [Thread-2 ]: Using postgres connection "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +16:01:12.788099 [debug] [Thread-8 ]: On test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + +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 + + + + + ) dbt_internal_test +16:01:12.788354 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select id +from "postgres"."public"."my_second_dbt_model" +where id is null + + + + + ) dbt_internal_test +16:01:12.823155 [debug] [Thread-5 ]: SQL status: BEGIN in 0.49 seconds +16:01:12.825036 [debug] [Thread-5 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +16:01:12.825397 [debug] [Thread-5 ]: On test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select seasonid +from "postgres"."public"."wins_losses" +where seasonid is null + + + + + ) dbt_internal_test +16:01:12.825811 [debug] [Thread-9 ]: SQL status: SELECT 1 in 0.09 seconds +16:01:12.828782 [debug] [Thread-9 ]: finished collecting timing info +16:01:12.829028 [debug] [Thread-9 ]: On test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493: ROLLBACK +16:01:12.838883 [debug] [Thread-3 ]: SQL status: SELECT 1 in 0.11 seconds +16:01:12.839237 [debug] [Thread-4 ]: SQL status: SELECT 1 in 0.11 seconds +16:01:12.841313 [debug] [Thread-3 ]: finished collecting timing info +16:01:12.841981 [debug] [Thread-4 ]: finished collecting timing info +16:01:12.842070 [debug] [Thread-3 ]: On test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1: ROLLBACK +16:01:12.842147 [debug] [Thread-4 ]: On test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15: ROLLBACK +16:01:12.854986 [debug] [Thread-1 ]: SQL status: SELECT 1 in 0.07 seconds +16:01:12.858557 [debug] [Thread-1 ]: finished collecting timing info +16:01:12.859048 [debug] [Thread-2 ]: SQL status: SELECT 1 in 0.07 seconds +16:01:12.859171 [debug] [Thread-8 ]: SQL status: SELECT 1 in 0.07 seconds +16:01:12.859258 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710: ROLLBACK +16:01:12.859993 [debug] [Thread-2 ]: finished collecting timing info +16:01:12.860603 [debug] [Thread-8 ]: finished collecting timing info +16:01:12.860748 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778: ROLLBACK +16:01:12.860834 [debug] [Thread-8 ]: On test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321: ROLLBACK +16:01:12.861986 [debug] [Thread-10 ]: SQL status: SELECT 1 in 0.08 seconds +16:01:12.862541 [debug] [Thread-10 ]: finished collecting timing info +16:01:12.862611 [debug] [Thread-10 ]: On test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb: ROLLBACK +16:01:12.876273 [debug] [Thread-9 ]: On test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493: Close +16:01:12.876595 [info ] [Thread-9 ]: 9 of 10 PASS unique_my_second_dbt_model_id ..................................... [PASS in 0.61s] +16:01:12.876845 [debug] [Thread-9 ]: Finished running node test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +16:01:12.884397 [debug] [Thread-4 ]: On test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15: Close +16:01:12.884479 [debug] [Thread-3 ]: On test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1: Close +16:01:12.884793 [info ] [Thread-3 ]: 3 of 10 PASS not_null_wins_losses_gameid ....................................... [PASS in 0.61s] +16:01:12.884981 [debug] [Thread-3 ]: Finished running node test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +16:01:12.885434 [info ] [Thread-4 ]: 4 of 10 PASS not_null_wins_losses_player_id .................................... [PASS in 0.61s] +16:01:12.885999 [debug] [Thread-4 ]: Finished running node test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +16:01:12.887926 [debug] [Thread-5 ]: SQL status: SELECT 1 in 0.06 seconds +16:01:12.888820 [debug] [Thread-5 ]: finished collecting timing info +16:01:12.888929 [debug] [Thread-5 ]: On test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813: ROLLBACK +16:01:12.902568 [debug] [Thread-8 ]: On test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321: Close +16:01:12.903390 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778: Close +16:01:12.905080 [info ] [Thread-2 ]: 2 of 10 PASS not_null_my_second_dbt_model_id ................................... [PASS in 0.63s] +16:01:12.906256 [info ] [Thread-8 ]: 8 of 10 PASS unique_my_first_dbt_model_id ...................................... [PASS in 0.64s] +16:01:12.906389 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710: Close +16:01:12.906454 [debug] [Thread-10 ]: On test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb: Close +16:01:12.906690 [debug] [Thread-2 ]: Finished running node test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +16:01:12.906823 [debug] [Thread-8 ]: Finished running node test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +16:01:12.907092 [info ] [Thread-1 ]: 1 of 10 PASS not_null_my_first_dbt_model_id .................................... [PASS in 0.64s] +16:01:12.907306 [error] [Thread-10 ]: 10 of 10 FAIL 15 unique_wins_losses_seasonid ................................... [FAIL 15 in 0.64s] +16:01:12.907467 [debug] [Thread-1 ]: Finished running node test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +16:01:12.907601 [debug] [Thread-10 ]: Finished running node test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb +16:01:12.940973 [debug] [Thread-5 ]: On test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813: Close +16:01:12.941445 [info ] [Thread-5 ]: 5 of 10 PASS not_null_wins_losses_seasonid ..................................... [PASS in 0.67s] +16:01:12.941646 [debug] [Thread-5 ]: Finished running node test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +16:01:12.942485 [debug] [MainThread]: Acquiring new postgres connection "master" +16:01:12.942592 [debug] [MainThread]: Using postgres connection "master" +16:01:12.942650 [debug] [MainThread]: On master: BEGIN +16:01:12.942704 [debug] [MainThread]: Opening a new connection, currently in state closed +16:01:13.341256 [debug] [MainThread]: SQL status: BEGIN in 0.4 seconds +16:01:13.342918 [debug] [MainThread]: On master: COMMIT +16:01:13.343160 [debug] [MainThread]: Using postgres connection "master" +16:01:13.343383 [debug] [MainThread]: On master: COMMIT +16:01:13.388448 [debug] [MainThread]: SQL status: COMMIT in 0.04 seconds +16:01:13.389515 [debug] [MainThread]: On master: Close +16:01:13.391682 [info ] [MainThread]: +16:01:13.392523 [info ] [MainThread]: Finished running 10 tests in 2.49s. +16:01:13.392886 [debug] [MainThread]: Connection 'master' was properly closed. +16:01:13.393074 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710' was properly closed. +16:01:13.393256 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778' was properly closed. +16:01:13.393428 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1' was properly closed. +16:01:13.393599 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15' was properly closed. +16:01:13.393769 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813' was properly closed. +16:01:13.393938 [debug] [MainThread]: Connection 'test.wrkplay_dbt.positive_wins_losses_total_losses.159f570741' was properly closed. +16:01:13.394239 [debug] [MainThread]: Connection 'test.wrkplay_dbt.positive_wins_losses_total_wins.1e3c0d0dd6' was properly closed. +16:01:13.394318 [debug] [MainThread]: Connection 'test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321' was properly closed. +16:01:13.394370 [debug] [MainThread]: Connection 'test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493' was properly closed. +16:01:13.394417 [debug] [MainThread]: Connection 'test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb' was properly closed. +16:01:13.399726 [info ] [MainThread]: +16:01:13.399852 [info ] [MainThread]: Completed with 3 errors and 0 warnings: +16:01:13.399958 [info ] [MainThread]: +16:01:13.400043 [error] [MainThread]: Compilation Error in test positive_wins_losses_total_losses (models/schema.yml) +16:01:13.400129 [error] [MainThread]: 'test_positive' is undefined. This can happen when calling a macro that does not exist. Check for typos and/or install package dependencies with "dbt deps". +16:01:13.400210 [info ] [MainThread]: +16:01:13.400294 [error] [MainThread]: Compilation Error in test positive_wins_losses_total_wins (models/schema.yml) +16:01:13.400372 [error] [MainThread]: 'test_positive' is undefined. This can happen when calling a macro that does not exist. Check for typos and/or install package dependencies with "dbt deps". +16:01:13.400450 [info ] [MainThread]: +16:01:13.400530 [error] [MainThread]: Failure in test unique_wins_losses_seasonid (models/schema.yml) +16:01:13.400619 [error] [MainThread]: Got 15 results, configured to fail if != 0 +16:01:13.400699 [info ] [MainThread]: +16:01:13.400779 [info ] [MainThread]: compiled SQL at target/compiled/wrkplay_dbt/models/schema.yml/unique_wins_losses_seasonid.sql +16:01:13.400870 [info ] [MainThread]: +16:01:13.400952 [info ] [MainThread]: Done. PASS=7 WARN=0 ERROR=3 SKIP=0 TOTAL=10 +16:01:13.401080 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [, , ]} + + +============================== 2022-07-08 16:15:52.138966 | dbabbca2-42ef-412f-952f-e42a86c5853c ============================== +16:15:52.138992 [info ] [MainThread]: Running with dbt=1.1.1 +16:15:52.140144 [debug] [MainThread]: running dbt with arguments {'write_json': True, 'use_colors': True, 'printer_width': 80, 'version_check': True, 'partial_parse': True, 'static_parser': True, 'profiles_dir': '/Users/bruno.campos/.dbt', 'send_anonymous_usage_stats': True, 'event_buffer_size': 100000, 'quiet': False, 'no_print': False, 'indirect_selection': 'eager', 'which': 'test', 'rpc_method': 'test'} +16:15:52.140287 [debug] [MainThread]: Tracking: tracking +16:15:52.167810 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [, , ]} +16:15:52.187584 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 1 files added, 1 files changed. +16:15:52.187822 [debug] [MainThread]: Partial parsing: added file: wrkplay_dbt://macros/positive_test.sql +16:15:52.188057 [debug] [MainThread]: Partial parsing: update schema file: wrkplay_dbt://models/schema.yml +16:15:52.188154 [debug] [MainThread]: Parsing macros/positive_test.sql +16:15:52.195647 [debug] [MainThread]: 1699: static parser successfully parsed wins_losses.sql +16:15:52.223607 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': 'dbabbca2-42ef-412f-952f-e42a86c5853c', 'context': []} +16:15:52.227042 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': 'dbabbca2-42ef-412f-952f-e42a86c5853c', 'context': []} +16:15:52.227224 [info ] [MainThread]: Found 3 models, 10 tests, 0 snapshots, 0 analyses, 168 macros, 0 operations, 0 seed files, 0 sources, 0 exposures, 0 metrics +16:15:52.227375 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': 'dbabbca2-42ef-412f-952f-e42a86c5853c', 'context': []} +16:15:52.228230 [info ] [MainThread]: +16:15:52.228437 [debug] [MainThread]: Acquiring new postgres connection "master" +16:15:52.228871 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres_public" +16:15:52.233119 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +16:15:52.233223 [debug] [ThreadPool]: On list_postgres_public: BEGIN +16:15:52.233289 [debug] [ThreadPool]: Opening a new connection, currently in state init +16:15:52.467256 [debug] [ThreadPool]: SQL status: BEGIN in 0.23 seconds +16:15:52.468721 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +16:15:52.469176 [debug] [ThreadPool]: On list_postgres_public: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres_public"} */ +select + 'postgres' as database, + tablename as name, + schemaname as schema, + 'table' as type + from pg_tables + where schemaname ilike 'public' + union all + select + 'postgres' as database, + viewname as name, + schemaname as schema, + 'view' as type + from pg_views + where schemaname ilike 'public' + +16:15:52.492700 [debug] [ThreadPool]: SQL status: SELECT 19 in 0.02 seconds +16:15:52.497524 [debug] [ThreadPool]: On list_postgres_public: ROLLBACK +16:15:52.528503 [debug] [ThreadPool]: On list_postgres_public: Close +16:15:52.535876 [debug] [MainThread]: Using postgres connection "master" +16:15:52.536022 [debug] [MainThread]: On master: BEGIN +16:15:52.536083 [debug] [MainThread]: Opening a new connection, currently in state init +16:15:52.798333 [debug] [MainThread]: SQL status: BEGIN in 0.26 seconds +16:15:52.799663 [debug] [MainThread]: Using postgres connection "master" +16:15:52.800024 [debug] [MainThread]: On master: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "master"} */ +with relation as ( + select + pg_rewrite.ev_class as class, + pg_rewrite.oid as id + from pg_rewrite + ), + class as ( + select + oid as id, + relname as name, + relnamespace as schema, + relkind as kind + from pg_class + ), + dependency as ( + select distinct + pg_depend.objid as id, + pg_depend.refobjid as ref + from pg_depend + ), + schema as ( + select + pg_namespace.oid as id, + pg_namespace.nspname as name + from pg_namespace + where nspname != 'information_schema' and nspname not like 'pg\_%' + ), + referenced as ( + select + relation.id AS id, + referenced_class.name , + referenced_class.schema , + referenced_class.kind + from relation + join class as referenced_class on relation.class=referenced_class.id + where referenced_class.kind in ('r', 'v') + ), + relationships as ( + select + referenced.name as referenced_name, + referenced.schema as referenced_schema_id, + dependent_class.name as dependent_name, + dependent_class.schema as dependent_schema_id, + referenced.kind as kind + from referenced + join dependency on referenced.id=dependency.id + join class as dependent_class on dependency.ref=dependent_class.id + where + (referenced.name != dependent_class.name or + referenced.schema != dependent_class.schema) + ) + + select + referenced_schema.name as referenced_schema, + relationships.referenced_name as referenced_name, + dependent_schema.name as dependent_schema, + relationships.dependent_name as dependent_name + from relationships + join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id + join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id + group by referenced_schema, referenced_name, dependent_schema, dependent_name + order by referenced_schema, referenced_name, dependent_schema, dependent_name; +16:15:52.975718 [debug] [MainThread]: SQL status: SELECT 4 in 0.18 seconds +16:15:52.980911 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': 'dbabbca2-42ef-412f-952f-e42a86c5853c', 'context': []} +16:15:52.981711 [debug] [MainThread]: On master: ROLLBACK +16:15:53.000036 [debug] [MainThread]: Using postgres connection "master" +16:15:53.000972 [debug] [MainThread]: On master: BEGIN +16:15:53.039872 [debug] [MainThread]: SQL status: BEGIN in 0.04 seconds +16:15:53.040831 [debug] [MainThread]: On master: COMMIT +16:15:53.041201 [debug] [MainThread]: Using postgres connection "master" +16:15:53.041532 [debug] [MainThread]: On master: COMMIT +16:15:53.061614 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +16:15:53.062525 [debug] [MainThread]: On master: Close +16:15:53.064211 [info ] [MainThread]: Concurrency: 10 threads (target='dev') +16:15:53.064855 [info ] [MainThread]: +16:15:53.069717 [debug] [Thread-1 ]: Began running node test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +16:15:53.069829 [debug] [Thread-2 ]: Began running node test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +16:15:53.069910 [debug] [Thread-3 ]: Began running node test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +16:15:53.069984 [debug] [Thread-4 ]: Began running node test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +16:15:53.070072 [debug] [Thread-5 ]: Began running node test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +16:15:53.070139 [debug] [Thread-6 ]: Began running node test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe +16:15:53.070200 [debug] [Thread-7 ]: Began running node test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77 +16:15:53.070289 [info ] [Thread-1 ]: 1 of 10 START test not_null_my_first_dbt_model_id .............................. [RUN] +16:15:53.070354 [debug] [Thread-8 ]: Began running node test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +16:15:53.070432 [debug] [Thread-9 ]: Began running node test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +16:15:53.070503 [debug] [Thread-10 ]: Began running node test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb +16:15:53.070550 [info ] [Thread-2 ]: 2 of 10 START test not_null_my_second_dbt_model_id ............................. [RUN] +16:15:53.070627 [info ] [Thread-3 ]: 3 of 10 START test not_null_wins_losses_gameid ................................. [RUN] +16:15:53.070700 [info ] [Thread-4 ]: 4 of 10 START test not_null_wins_losses_player_id .............................. [RUN] +16:15:53.070767 [info ] [Thread-5 ]: 5 of 10 START test not_null_wins_losses_seasonid ............................... [RUN] +16:15:53.070835 [info ] [Thread-6 ]: 6 of 10 START test positive_test_wins_losses_total_losses ...................... [RUN] +16:15:53.070905 [info ] [Thread-7 ]: 7 of 10 START test positive_test_wins_losses_total_wins ........................ [RUN] +16:15:53.071229 [debug] [Thread-1 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +16:15:53.071302 [info ] [Thread-8 ]: 8 of 10 START test unique_my_first_dbt_model_id ................................ [RUN] +16:15:53.071369 [info ] [Thread-9 ]: 9 of 10 START test unique_my_second_dbt_model_id ............................... [RUN] +16:15:53.071433 [info ] [Thread-10 ]: 10 of 10 START test unique_wins_losses_seasonid ................................ [RUN] +16:15:53.071625 [debug] [Thread-2 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +16:15:53.071800 [debug] [Thread-3 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +16:15:53.071968 [debug] [Thread-4 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +16:15:53.072137 [debug] [Thread-5 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +16:15:53.072297 [debug] [Thread-6 ]: Acquiring new postgres connection "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe" +16:15:53.072447 [debug] [Thread-7 ]: Acquiring new postgres connection "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77" +16:15:53.072518 [debug] [Thread-1 ]: Began compiling node test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +16:15:53.072679 [debug] [Thread-8 ]: Acquiring new postgres connection "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +16:15:53.072824 [debug] [Thread-9 ]: Acquiring new postgres connection "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +16:15:53.072976 [debug] [Thread-10 ]: Acquiring new postgres connection "test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb" +16:15:53.073034 [debug] [Thread-2 ]: Began compiling node test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +16:15:53.073091 [debug] [Thread-3 ]: Began compiling node test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +16:15:53.073147 [debug] [Thread-4 ]: Began compiling node test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +16:15:53.073210 [debug] [Thread-5 ]: Began compiling node test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +16:15:53.073836 [debug] [Thread-5 ]: Compiling test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +16:15:53.073314 [debug] [Thread-7 ]: Began compiling node test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77 +16:15:53.073400 [debug] [Thread-1 ]: Compiling test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +16:15:53.073453 [debug] [Thread-8 ]: Began compiling node test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +16:15:53.073503 [debug] [Thread-9 ]: Began compiling node test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +16:15:53.073555 [debug] [Thread-10 ]: Began compiling node test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb +16:15:53.073649 [debug] [Thread-2 ]: Compiling test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +16:15:53.073720 [debug] [Thread-3 ]: Compiling test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +16:15:53.073780 [debug] [Thread-4 ]: Compiling test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +16:15:53.073263 [debug] [Thread-6 ]: Began compiling node test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe +16:15:53.078065 [debug] [Thread-5 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +16:15:53.078162 [debug] [Thread-7 ]: Compiling test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77 +16:15:53.079564 [debug] [Thread-1 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +16:15:53.079644 [debug] [Thread-8 ]: Compiling test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +16:15:53.079707 [debug] [Thread-9 ]: Compiling test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +16:15:53.079765 [debug] [Thread-10 ]: Compiling test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb +16:15:53.081093 [debug] [Thread-2 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +16:15:53.082423 [debug] [Thread-3 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +16:15:53.084332 [debug] [Thread-4 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +16:15:53.084409 [debug] [Thread-6 ]: Compiling test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe +16:15:53.085755 [debug] [Thread-7 ]: Writing injected SQL for node "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77" +16:15:53.109168 [debug] [Thread-8 ]: Writing injected SQL for node "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +16:15:53.110701 [debug] [Thread-9 ]: Writing injected SQL for node "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +16:15:53.110810 [debug] [Thread-1 ]: finished collecting timing info +16:15:53.110864 [debug] [Thread-5 ]: finished collecting timing info +16:15:53.112291 [debug] [Thread-10 ]: Writing injected SQL for node "test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb" +16:15:53.113891 [debug] [Thread-6 ]: Writing injected SQL for node "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe" +16:15:53.114095 [debug] [Thread-3 ]: finished collecting timing info +16:15:53.114157 [debug] [Thread-2 ]: finished collecting timing info +16:15:53.114311 [debug] [Thread-8 ]: finished collecting timing info +16:15:53.114360 [debug] [Thread-4 ]: finished collecting timing info +16:15:53.114447 [debug] [Thread-7 ]: finished collecting timing info +16:15:53.114516 [debug] [Thread-1 ]: Began executing node test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +16:15:53.114608 [debug] [Thread-5 ]: Began executing node test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +16:15:53.114697 [debug] [Thread-9 ]: finished collecting timing info +16:15:53.114803 [debug] [Thread-3 ]: Began executing node test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +16:15:53.114917 [debug] [Thread-2 ]: Began executing node test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +16:15:53.114985 [debug] [Thread-6 ]: finished collecting timing info +16:15:53.115039 [debug] [Thread-8 ]: Began executing node test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +16:15:53.115087 [debug] [Thread-10 ]: finished collecting timing info +16:15:53.115153 [debug] [Thread-4 ]: Began executing node test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +16:15:53.115221 [debug] [Thread-7 ]: Began executing node test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77 +16:15:53.121820 [debug] [Thread-1 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +16:15:53.122600 [debug] [Thread-5 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +16:15:53.122693 [debug] [Thread-9 ]: Began executing node test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +16:15:53.123393 [debug] [Thread-3 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +16:15:53.124063 [debug] [Thread-2 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +16:15:53.124144 [debug] [Thread-6 ]: Began executing node test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe +16:15:53.124746 [debug] [Thread-8 ]: Writing runtime SQL for node "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +16:15:53.124823 [debug] [Thread-10 ]: Began executing node test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb +16:15:53.125492 [debug] [Thread-4 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +16:15:53.126146 [debug] [Thread-7 ]: Writing runtime SQL for node "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77" +16:15:53.126960 [debug] [Thread-9 ]: Writing runtime SQL for node "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +16:15:53.127194 [debug] [Thread-1 ]: Using postgres connection "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +16:15:53.127285 [debug] [Thread-5 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +16:15:53.128368 [debug] [Thread-6 ]: Writing runtime SQL for node "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe" +16:15:53.128458 [debug] [Thread-3 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +16:15:53.128527 [debug] [Thread-2 ]: Using postgres connection "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +16:15:53.129242 [debug] [Thread-10 ]: Writing runtime SQL for node "test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb" +16:15:53.129440 [debug] [Thread-8 ]: Using postgres connection "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +16:15:53.129651 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710: BEGIN +16:15:53.129731 [debug] [Thread-4 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +16:15:53.129815 [debug] [Thread-7 ]: Using postgres connection "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77" +16:15:53.129882 [debug] [Thread-5 ]: On test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813: BEGIN +16:15:53.129941 [debug] [Thread-9 ]: Using postgres connection "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +16:15:53.130039 [debug] [Thread-3 ]: On test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1: BEGIN +16:15:53.130109 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778: BEGIN +16:15:53.130183 [debug] [Thread-6 ]: Using postgres connection "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe" +16:15:53.130264 [debug] [Thread-8 ]: On test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321: BEGIN +16:15:53.130367 [debug] [Thread-1 ]: Opening a new connection, currently in state closed +16:15:53.130448 [debug] [Thread-4 ]: On test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15: BEGIN +16:15:53.130505 [debug] [Thread-7 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77: BEGIN +16:15:53.130562 [debug] [Thread-5 ]: Opening a new connection, currently in state init +16:15:53.130633 [debug] [Thread-9 ]: On test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493: BEGIN +16:15:53.130686 [debug] [Thread-10 ]: Using postgres connection "test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb" +16:15:53.130757 [debug] [Thread-3 ]: Opening a new connection, currently in state init +16:15:53.130815 [debug] [Thread-2 ]: Opening a new connection, currently in state init +16:15:53.130885 [debug] [Thread-6 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe: BEGIN +16:15:53.130962 [debug] [Thread-8 ]: Opening a new connection, currently in state init +16:15:53.131090 [debug] [Thread-4 ]: Opening a new connection, currently in state init +16:15:53.131155 [debug] [Thread-7 ]: Opening a new connection, currently in state init +16:15:53.131287 [debug] [Thread-9 ]: Opening a new connection, currently in state init +16:15:53.131357 [debug] [Thread-10 ]: On test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb: BEGIN +16:15:53.131531 [debug] [Thread-6 ]: Opening a new connection, currently in state init +16:15:53.131802 [debug] [Thread-10 ]: Opening a new connection, currently in state init +16:15:53.318690 [debug] [Thread-3 ]: SQL status: BEGIN in 0.19 seconds +16:15:53.318872 [debug] [Thread-3 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +16:15:53.318936 [debug] [Thread-3 ]: On test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select gameid +from "postgres"."public"."wins_losses" +where gameid is null + + + + + ) dbt_internal_test +16:15:53.319009 [debug] [Thread-8 ]: SQL status: BEGIN in 0.19 seconds +16:15:53.319091 [debug] [Thread-8 ]: Using postgres connection "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +16:15:53.319152 [debug] [Thread-8 ]: On test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + +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 + + + + + ) dbt_internal_test +16:15:53.326637 [debug] [Thread-1 ]: SQL status: BEGIN in 0.2 seconds +16:15:53.326871 [debug] [Thread-5 ]: SQL status: BEGIN in 0.2 seconds +16:15:53.327133 [debug] [Thread-1 ]: Using postgres connection "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +16:15:53.327320 [debug] [Thread-5 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +16:15:53.327700 [debug] [Thread-5 ]: On test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select seasonid +from "postgres"."public"."wins_losses" +where seasonid is null + + + + + ) dbt_internal_test +16:15:53.327502 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select id +from "postgres"."public"."my_first_dbt_model" +where id is null + + + + + ) dbt_internal_test +16:15:53.333017 [debug] [Thread-4 ]: SQL status: BEGIN in 0.2 seconds +16:15:53.333862 [debug] [Thread-4 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +16:15:53.334044 [debug] [Thread-4 ]: On test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select player_id +from "postgres"."public"."wins_losses" +where player_id is null + + + + + ) dbt_internal_test +16:15:53.334725 [debug] [Thread-2 ]: SQL status: BEGIN in 0.2 seconds +16:15:53.334918 [debug] [Thread-2 ]: Using postgres connection "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +16:15:53.335074 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select id +from "postgres"."public"."my_second_dbt_model" +where id is null + + + + + ) dbt_internal_test +16:15:53.338152 [debug] [Thread-7 ]: SQL status: BEGIN in 0.21 seconds +16:15:53.338694 [debug] [Thread-7 ]: Using postgres connection "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77" +16:15:53.338921 [debug] [Thread-7 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + +with validation as ( + + select + total_wins 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 + + + + ) dbt_internal_test +16:15:53.339233 [debug] [Thread-8 ]: SQL status: SELECT 1 in 0.02 seconds +16:15:53.342702 [debug] [Thread-8 ]: finished collecting timing info +16:15:53.342880 [debug] [Thread-8 ]: On test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321: ROLLBACK +16:15:53.345420 [debug] [Thread-9 ]: SQL status: BEGIN in 0.21 seconds +16:15:53.345497 [debug] [Thread-9 ]: Using postgres connection "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +16:15:53.345564 [debug] [Thread-9 ]: On test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + +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 + + + + + ) dbt_internal_test +16:15:53.345641 [debug] [Thread-6 ]: SQL status: BEGIN in 0.21 seconds +16:15:53.345704 [debug] [Thread-10 ]: SQL status: BEGIN in 0.21 seconds +16:15:53.345798 [debug] [Thread-6 ]: Using postgres connection "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe" +16:15:53.345859 [debug] [Thread-10 ]: Using postgres connection "test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb" +16:15:53.345915 [debug] [Thread-6 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + +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 + + + + ) dbt_internal_test +16:15:53.345967 [debug] [Thread-10 ]: On test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + +select + seasonid as unique_field, + count(*) as n_records + +from "postgres"."public"."wins_losses" +where seasonid is not null +group by seasonid +having count(*) > 1 + + + + + ) dbt_internal_test +16:15:53.347552 [debug] [Thread-1 ]: SQL status: SELECT 1 in 0.02 seconds +16:15:53.350160 [debug] [Thread-1 ]: finished collecting timing info +16:15:53.350267 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710: ROLLBACK +16:15:53.355599 [debug] [Thread-2 ]: SQL status: SELECT 1 in 0.02 seconds +16:15:53.358105 [debug] [Thread-2 ]: finished collecting timing info +16:15:53.358552 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778: ROLLBACK +16:15:53.360143 [debug] [Thread-8 ]: On test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321: Close +16:15:53.360476 [info ] [Thread-8 ]: 8 of 10 PASS unique_my_first_dbt_model_id ...................................... [PASS in 0.29s] +16:15:53.360711 [debug] [Thread-8 ]: Finished running node test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +16:15:53.367748 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710: Close +16:15:53.369093 [info ] [Thread-1 ]: 1 of 10 PASS not_null_my_first_dbt_model_id .................................... [PASS in 0.30s] +16:15:53.369865 [debug] [Thread-9 ]: SQL status: SELECT 1 in 0.02 seconds +16:15:53.370255 [debug] [Thread-1 ]: Finished running node test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +16:15:53.372011 [debug] [Thread-9 ]: finished collecting timing info +16:15:53.372279 [debug] [Thread-9 ]: On test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493: ROLLBACK +16:15:53.376129 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778: Close +16:15:53.377423 [info ] [Thread-2 ]: 2 of 10 PASS not_null_my_second_dbt_model_id ................................... [PASS in 0.31s] +16:15:53.378317 [debug] [Thread-2 ]: Finished running node test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +16:15:53.388872 [debug] [Thread-3 ]: SQL status: SELECT 1 in 0.07 seconds +16:15:53.391831 [debug] [Thread-3 ]: finished collecting timing info +16:15:53.392024 [debug] [Thread-9 ]: On test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493: Close +16:15:53.392209 [debug] [Thread-4 ]: SQL status: SELECT 1 in 0.06 seconds +16:15:53.392552 [debug] [Thread-3 ]: On test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1: ROLLBACK +16:15:53.394068 [debug] [Thread-4 ]: finished collecting timing info +16:15:53.394298 [info ] [Thread-9 ]: 9 of 10 PASS unique_my_second_dbt_model_id ..................................... [PASS in 0.32s] +16:15:53.394548 [debug] [Thread-4 ]: On test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15: ROLLBACK +16:15:53.394756 [debug] [Thread-9 ]: Finished running node test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +16:15:53.394868 [debug] [Thread-7 ]: SQL status: SELECT 1 in 0.06 seconds +16:15:53.395592 [debug] [Thread-7 ]: finished collecting timing info +16:15:53.395723 [debug] [Thread-7 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77: ROLLBACK +16:15:53.396795 [debug] [Thread-6 ]: SQL status: SELECT 1 in 0.05 seconds +16:15:53.397334 [debug] [Thread-6 ]: finished collecting timing info +16:15:53.397435 [debug] [Thread-6 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe: ROLLBACK +16:15:53.400445 [debug] [Thread-5 ]: SQL status: SELECT 1 in 0.07 seconds +16:15:53.401028 [debug] [Thread-5 ]: finished collecting timing info +16:15:53.401108 [debug] [Thread-5 ]: On test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813: ROLLBACK +16:15:53.402208 [debug] [Thread-10 ]: SQL status: SELECT 1 in 0.06 seconds +16:15:53.402697 [debug] [Thread-10 ]: finished collecting timing info +16:15:53.402764 [debug] [Thread-10 ]: On test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb: ROLLBACK +16:15:53.412913 [debug] [Thread-4 ]: On test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15: Close +16:15:53.412985 [debug] [Thread-3 ]: On test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1: Close +16:15:53.413055 [debug] [Thread-7 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77: Close +16:15:53.413319 [info ] [Thread-4 ]: 4 of 10 PASS not_null_wins_losses_player_id .................................... [PASS in 0.34s] +16:15:53.413463 [info ] [Thread-7 ]: 7 of 10 PASS positive_test_wins_losses_total_wins .............................. [PASS in 0.34s] +16:15:53.413601 [info ] [Thread-3 ]: 3 of 10 PASS not_null_wins_losses_gameid ....................................... [PASS in 0.34s] +16:15:53.413765 [debug] [Thread-4 ]: Finished running node test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +16:15:53.413902 [debug] [Thread-7 ]: Finished running node test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77 +16:15:53.414029 [debug] [Thread-3 ]: Finished running node test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +16:15:53.416190 [debug] [Thread-6 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe: Close +16:15:53.416411 [info ] [Thread-6 ]: 6 of 10 PASS positive_test_wins_losses_total_losses ............................ [PASS in 0.34s] +16:15:53.416555 [debug] [Thread-6 ]: Finished running node test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe +16:15:53.421088 [debug] [Thread-5 ]: On test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813: Close +16:15:53.421161 [debug] [Thread-10 ]: On test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb: Close +16:15:53.421340 [info ] [Thread-5 ]: 5 of 10 PASS not_null_wins_losses_seasonid ..................................... [PASS in 0.35s] +16:15:53.421489 [debug] [Thread-5 ]: Finished running node test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +16:15:53.421653 [error] [Thread-10 ]: 10 of 10 FAIL 15 unique_wins_losses_seasonid ................................... [FAIL 15 in 0.35s] +16:15:53.421805 [debug] [Thread-10 ]: Finished running node test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb +16:15:53.422512 [debug] [MainThread]: Acquiring new postgres connection "master" +16:15:53.422600 [debug] [MainThread]: Using postgres connection "master" +16:15:53.422655 [debug] [MainThread]: On master: BEGIN +16:15:53.422703 [debug] [MainThread]: Opening a new connection, currently in state closed +16:15:53.603654 [debug] [MainThread]: SQL status: BEGIN in 0.18 seconds +16:15:53.605352 [debug] [MainThread]: On master: COMMIT +16:15:53.605662 [debug] [MainThread]: Using postgres connection "master" +16:15:53.605942 [debug] [MainThread]: On master: COMMIT +16:15:53.628333 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +16:15:53.629664 [debug] [MainThread]: On master: Close +16:15:53.631318 [info ] [MainThread]: +16:15:53.631817 [info ] [MainThread]: Finished running 10 tests in 1.40s. +16:15:53.632150 [debug] [MainThread]: Connection 'master' was properly closed. +16:15:53.632307 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710' was properly closed. +16:15:53.632611 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778' was properly closed. +16:15:53.632778 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1' was properly closed. +16:15:53.632847 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15' was properly closed. +16:15:53.632970 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813' was properly closed. +16:15:53.633027 [debug] [MainThread]: Connection 'test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe' was properly closed. +16:15:53.633083 [debug] [MainThread]: Connection 'test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77' was properly closed. +16:15:53.633131 [debug] [MainThread]: Connection 'test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321' was properly closed. +16:15:53.633176 [debug] [MainThread]: Connection 'test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493' was properly closed. +16:15:53.633221 [debug] [MainThread]: Connection 'test.wrkplay_dbt.unique_wins_losses_seasonid.3540088bcb' was properly closed. +16:15:53.638643 [info ] [MainThread]: +16:15:53.638840 [info ] [MainThread]: Completed with 1 error and 0 warnings: +16:15:53.638953 [info ] [MainThread]: +16:15:53.639041 [error] [MainThread]: Failure in test unique_wins_losses_seasonid (models/schema.yml) +16:15:53.639133 [error] [MainThread]: Got 15 results, configured to fail if != 0 +16:15:53.639216 [info ] [MainThread]: +16:15:53.639298 [info ] [MainThread]: compiled SQL at target/compiled/wrkplay_dbt/models/schema.yml/unique_wins_losses_seasonid.sql +16:15:53.639392 [info ] [MainThread]: +16:15:53.639472 [info ] [MainThread]: Done. PASS=9 WARN=0 ERROR=1 SKIP=0 TOTAL=10 +16:15:53.639601 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [, , ]} + + +============================== 2022-07-08 16:16:25.728397 | ad35e43e-c8b6-4e04-a9e3-5133f86826df ============================== +16:16:25.728417 [info ] [MainThread]: Running with dbt=1.1.1 +16:16:25.729207 [debug] [MainThread]: running dbt with arguments {'write_json': True, 'use_colors': True, 'printer_width': 80, 'version_check': True, 'partial_parse': True, 'static_parser': True, 'profiles_dir': '/Users/bruno.campos/.dbt', 'send_anonymous_usage_stats': True, 'event_buffer_size': 100000, 'quiet': False, 'no_print': False, 'indirect_selection': 'eager', 'which': 'test', 'rpc_method': 'test'} +16:16:25.729313 [debug] [MainThread]: Tracking: tracking +16:16:25.745465 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [, , ]} +16:16:25.762811 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 1 files changed. +16:16:25.763090 [debug] [MainThread]: Partial parsing: update schema file: wrkplay_dbt://models/schema.yml +16:16:25.770023 [debug] [MainThread]: 1699: static parser successfully parsed wins_losses.sql +16:16:25.798417 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': 'ad35e43e-c8b6-4e04-a9e3-5133f86826df', 'context': []} +16:16:25.801217 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': 'ad35e43e-c8b6-4e04-a9e3-5133f86826df', 'context': []} +16:16:25.801370 [info ] [MainThread]: Found 3 models, 9 tests, 0 snapshots, 0 analyses, 168 macros, 0 operations, 0 seed files, 0 sources, 0 exposures, 0 metrics +16:16:25.801505 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': 'ad35e43e-c8b6-4e04-a9e3-5133f86826df', 'context': []} +16:16:25.802303 [info ] [MainThread]: +16:16:25.802502 [debug] [MainThread]: Acquiring new postgres connection "master" +16:16:25.802950 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres_public" +16:16:25.807297 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +16:16:25.807379 [debug] [ThreadPool]: On list_postgres_public: BEGIN +16:16:25.807442 [debug] [ThreadPool]: Opening a new connection, currently in state init +16:16:26.037267 [debug] [ThreadPool]: SQL status: BEGIN in 0.23 seconds +16:16:26.038605 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +16:16:26.038988 [debug] [ThreadPool]: On list_postgres_public: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres_public"} */ +select + 'postgres' as database, + tablename as name, + schemaname as schema, + 'table' as type + from pg_tables + where schemaname ilike 'public' + union all + select + 'postgres' as database, + viewname as name, + schemaname as schema, + 'view' as type + from pg_views + where schemaname ilike 'public' + +16:16:26.062561 [debug] [ThreadPool]: SQL status: SELECT 19 in 0.02 seconds +16:16:26.067547 [debug] [ThreadPool]: On list_postgres_public: ROLLBACK +16:16:26.086042 [debug] [ThreadPool]: On list_postgres_public: Close +16:16:26.093240 [debug] [MainThread]: Using postgres connection "master" +16:16:26.093376 [debug] [MainThread]: On master: BEGIN +16:16:26.093439 [debug] [MainThread]: Opening a new connection, currently in state init +16:16:26.279924 [debug] [MainThread]: SQL status: BEGIN in 0.19 seconds +16:16:26.281414 [debug] [MainThread]: Using postgres connection "master" +16:16:26.281804 [debug] [MainThread]: On master: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "master"} */ +with relation as ( + select + pg_rewrite.ev_class as class, + pg_rewrite.oid as id + from pg_rewrite + ), + class as ( + select + oid as id, + relname as name, + relnamespace as schema, + relkind as kind + from pg_class + ), + dependency as ( + select distinct + pg_depend.objid as id, + pg_depend.refobjid as ref + from pg_depend + ), + schema as ( + select + pg_namespace.oid as id, + pg_namespace.nspname as name + from pg_namespace + where nspname != 'information_schema' and nspname not like 'pg\_%' + ), + referenced as ( + select + relation.id AS id, + referenced_class.name , + referenced_class.schema , + referenced_class.kind + from relation + join class as referenced_class on relation.class=referenced_class.id + where referenced_class.kind in ('r', 'v') + ), + relationships as ( + select + referenced.name as referenced_name, + referenced.schema as referenced_schema_id, + dependent_class.name as dependent_name, + dependent_class.schema as dependent_schema_id, + referenced.kind as kind + from referenced + join dependency on referenced.id=dependency.id + join class as dependent_class on dependency.ref=dependent_class.id + where + (referenced.name != dependent_class.name or + referenced.schema != dependent_class.schema) + ) + + select + referenced_schema.name as referenced_schema, + relationships.referenced_name as referenced_name, + dependent_schema.name as dependent_schema, + relationships.dependent_name as dependent_name + from relationships + join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id + join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id + group by referenced_schema, referenced_name, dependent_schema, dependent_name + order by referenced_schema, referenced_name, dependent_schema, dependent_name; +16:16:26.451638 [debug] [MainThread]: SQL status: SELECT 4 in 0.17 seconds +16:16:26.456357 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': 'ad35e43e-c8b6-4e04-a9e3-5133f86826df', 'context': []} +16:16:26.456955 [debug] [MainThread]: On master: ROLLBACK +16:16:26.475131 [debug] [MainThread]: Using postgres connection "master" +16:16:26.475959 [debug] [MainThread]: On master: BEGIN +16:16:26.517646 [debug] [MainThread]: SQL status: BEGIN in 0.04 seconds +16:16:26.518765 [debug] [MainThread]: On master: COMMIT +16:16:26.519172 [debug] [MainThread]: Using postgres connection "master" +16:16:26.519517 [debug] [MainThread]: On master: COMMIT +16:16:26.540436 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +16:16:26.541248 [debug] [MainThread]: On master: Close +16:16:26.542997 [info ] [MainThread]: Concurrency: 10 threads (target='dev') +16:16:26.543465 [info ] [MainThread]: +16:16:26.550484 [debug] [Thread-1 ]: Began running node test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +16:16:26.550673 [debug] [Thread-2 ]: Began running node test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +16:16:26.550766 [info ] [Thread-1 ]: 1 of 9 START test not_null_my_first_dbt_model_id ............................... [RUN] +16:16:26.550835 [debug] [Thread-3 ]: Began running node test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +16:16:26.550917 [debug] [Thread-4 ]: Began running node test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +16:16:26.550970 [info ] [Thread-2 ]: 2 of 9 START test not_null_my_second_dbt_model_id .............................. [RUN] +16:16:26.551028 [debug] [Thread-5 ]: Began running node test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +16:16:26.551296 [debug] [Thread-1 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +16:16:26.551368 [info ] [Thread-3 ]: 3 of 9 START test not_null_wins_losses_gameid .................................. [RUN] +16:16:26.551421 [debug] [Thread-6 ]: Began running node test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe +16:16:26.551489 [info ] [Thread-4 ]: 4 of 9 START test not_null_wins_losses_player_id ............................... [RUN] +16:16:26.551538 [debug] [Thread-7 ]: Began running node test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77 +16:16:26.551736 [debug] [Thread-2 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +16:16:26.551813 [debug] [Thread-8 ]: Began running node test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +16:16:26.551859 [info ] [Thread-5 ]: 5 of 9 START test not_null_wins_losses_seasonid ................................ [RUN] +16:16:26.551909 [debug] [Thread-9 ]: Began running node test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +16:16:26.551981 [debug] [Thread-1 ]: Began compiling node test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +16:16:26.552154 [debug] [Thread-3 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +16:16:26.552220 [info ] [Thread-6 ]: 6 of 9 START test positive_test_wins_losses_total_losses ....................... [RUN] +16:16:26.552372 [debug] [Thread-4 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +16:16:26.552438 [info ] [Thread-7 ]: 7 of 9 START test positive_test_wins_losses_total_wins ......................... [RUN] +16:16:26.552499 [debug] [Thread-2 ]: Began compiling node test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +16:16:26.552558 [info ] [Thread-8 ]: 8 of 9 START test unique_my_first_dbt_model_id ................................. [RUN] +16:16:26.552717 [debug] [Thread-5 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +16:16:26.552778 [info ] [Thread-9 ]: 9 of 9 START test unique_my_second_dbt_model_id ................................ [RUN] +16:16:26.552880 [debug] [Thread-1 ]: Compiling test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +16:16:26.552945 [debug] [Thread-3 ]: Began compiling node test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +16:16:26.553085 [debug] [Thread-6 ]: Acquiring new postgres connection "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe" +16:16:26.553140 [debug] [Thread-4 ]: Began compiling node test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +16:16:26.553277 [debug] [Thread-7 ]: Acquiring new postgres connection "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77" +16:16:26.553332 [debug] [Thread-2 ]: Compiling test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +16:16:26.553556 [debug] [Thread-8 ]: Acquiring new postgres connection "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +16:16:26.553632 [debug] [Thread-5 ]: Began compiling node test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +16:16:26.553808 [debug] [Thread-9 ]: Acquiring new postgres connection "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +16:16:26.557965 [debug] [Thread-1 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +16:16:26.558064 [debug] [Thread-3 ]: Compiling test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +16:16:26.558131 [debug] [Thread-6 ]: Began compiling node test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe +16:16:26.558187 [debug] [Thread-4 ]: Compiling test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +16:16:26.558242 [debug] [Thread-7 ]: Began compiling node test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77 +16:16:26.559606 [debug] [Thread-2 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +16:16:26.559687 [debug] [Thread-8 ]: Began compiling node test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +16:16:26.559752 [debug] [Thread-5 ]: Compiling test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +16:16:26.559809 [debug] [Thread-9 ]: Began compiling node test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +16:16:26.561276 [debug] [Thread-3 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +16:16:26.561384 [debug] [Thread-6 ]: Compiling test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe +16:16:26.562676 [debug] [Thread-4 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +16:16:26.562775 [debug] [Thread-7 ]: Compiling test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77 +16:16:26.562892 [debug] [Thread-1 ]: finished collecting timing info +16:16:26.562950 [debug] [Thread-8 ]: Compiling test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +16:16:26.564364 [debug] [Thread-5 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +16:16:26.564445 [debug] [Thread-9 ]: Compiling test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +16:16:26.564494 [debug] [Thread-2 ]: finished collecting timing info +16:16:26.566357 [debug] [Thread-6 ]: Writing injected SQL for node "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe" +16:16:26.587651 [debug] [Thread-7 ]: Writing injected SQL for node "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77" +16:16:26.587754 [debug] [Thread-3 ]: finished collecting timing info +16:16:26.587887 [debug] [Thread-1 ]: Began executing node test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +16:16:26.590782 [debug] [Thread-8 ]: Writing injected SQL for node "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +16:16:26.590877 [debug] [Thread-4 ]: finished collecting timing info +16:16:26.592447 [debug] [Thread-9 ]: Writing injected SQL for node "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +16:16:26.592584 [debug] [Thread-2 ]: Began executing node test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +16:16:26.592742 [debug] [Thread-5 ]: finished collecting timing info +16:16:26.592896 [debug] [Thread-3 ]: Began executing node test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +16:16:26.599269 [debug] [Thread-6 ]: finished collecting timing info +16:16:26.599348 [debug] [Thread-7 ]: finished collecting timing info +16:16:26.599688 [debug] [Thread-1 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +16:16:26.599845 [debug] [Thread-4 ]: Began executing node test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +16:16:26.600676 [debug] [Thread-2 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +16:16:26.600752 [debug] [Thread-8 ]: finished collecting timing info +16:16:26.600853 [debug] [Thread-5 ]: Began executing node test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +16:16:26.601609 [debug] [Thread-3 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +16:16:26.601685 [debug] [Thread-9 ]: finished collecting timing info +16:16:26.601779 [debug] [Thread-6 ]: Began executing node test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe +16:16:26.601868 [debug] [Thread-7 ]: Began executing node test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77 +16:16:26.602672 [debug] [Thread-4 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +16:16:26.602849 [debug] [Thread-1 ]: Using postgres connection "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +16:16:26.602912 [debug] [Thread-8 ]: Began executing node test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +16:16:26.603634 [debug] [Thread-5 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +16:16:26.603702 [debug] [Thread-2 ]: Using postgres connection "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +16:16:26.603809 [debug] [Thread-9 ]: Began executing node test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +16:16:26.604485 [debug] [Thread-6 ]: Writing runtime SQL for node "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe" +16:16:26.605124 [debug] [Thread-7 ]: Writing runtime SQL for node "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77" +16:16:26.605229 [debug] [Thread-3 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +16:16:26.605330 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710: BEGIN +16:16:26.605994 [debug] [Thread-8 ]: Writing runtime SQL for node "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +16:16:26.606083 [debug] [Thread-4 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +16:16:26.606175 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778: BEGIN +16:16:26.606838 [debug] [Thread-9 ]: Writing runtime SQL for node "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +16:16:26.606924 [debug] [Thread-5 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +16:16:26.607068 [debug] [Thread-3 ]: On test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1: BEGIN +16:16:26.607148 [debug] [Thread-1 ]: Opening a new connection, currently in state closed +16:16:26.607222 [debug] [Thread-6 ]: Using postgres connection "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe" +16:16:26.607279 [debug] [Thread-7 ]: Using postgres connection "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77" +16:16:26.607368 [debug] [Thread-4 ]: On test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15: BEGIN +16:16:26.607454 [debug] [Thread-2 ]: Opening a new connection, currently in state init +16:16:26.607509 [debug] [Thread-8 ]: Using postgres connection "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +16:16:26.607593 [debug] [Thread-5 ]: On test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813: BEGIN +16:16:26.607657 [debug] [Thread-3 ]: Opening a new connection, currently in state init +16:16:26.607798 [debug] [Thread-9 ]: Using postgres connection "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +16:16:26.607856 [debug] [Thread-6 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe: BEGIN +16:16:26.607918 [debug] [Thread-7 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77: BEGIN +16:16:26.607974 [debug] [Thread-4 ]: Opening a new connection, currently in state init +16:16:26.608084 [debug] [Thread-8 ]: On test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321: BEGIN +16:16:26.608136 [debug] [Thread-5 ]: Opening a new connection, currently in state init +16:16:26.608241 [debug] [Thread-9 ]: On test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493: BEGIN +16:16:26.608292 [debug] [Thread-6 ]: Opening a new connection, currently in state init +16:16:26.608346 [debug] [Thread-7 ]: Opening a new connection, currently in state init +16:16:26.608447 [debug] [Thread-8 ]: Opening a new connection, currently in state init +16:16:26.608543 [debug] [Thread-9 ]: Opening a new connection, currently in state init +16:16:26.804041 [debug] [Thread-6 ]: SQL status: BEGIN in 0.2 seconds +16:16:26.804771 [debug] [Thread-6 ]: Using postgres connection "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe" +16:16:26.805123 [debug] [Thread-6 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + +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 + + + + ) dbt_internal_test +16:16:26.807096 [debug] [Thread-9 ]: SQL status: BEGIN in 0.2 seconds +16:16:26.807458 [debug] [Thread-9 ]: Using postgres connection "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +16:16:26.807787 [debug] [Thread-9 ]: On test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + +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 + + + + + ) dbt_internal_test +16:16:26.809363 [debug] [Thread-5 ]: SQL status: BEGIN in 0.2 seconds +16:16:26.809827 [debug] [Thread-5 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +16:16:26.810170 [debug] [Thread-5 ]: On test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select seasonid +from "postgres"."public"."wins_losses" +where seasonid is null + + + + + ) dbt_internal_test +16:16:26.811521 [debug] [Thread-7 ]: SQL status: BEGIN in 0.2 seconds +16:16:26.811869 [debug] [Thread-7 ]: Using postgres connection "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77" +16:16:26.812178 [debug] [Thread-7 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + +with validation as ( + + select + total_wins 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 + + + + ) dbt_internal_test +16:16:26.817342 [debug] [Thread-3 ]: SQL status: BEGIN in 0.21 seconds +16:16:26.817744 [debug] [Thread-3 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +16:16:26.818068 [debug] [Thread-3 ]: On test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select gameid +from "postgres"."public"."wins_losses" +where gameid is null + + + + + ) dbt_internal_test +16:16:26.823129 [debug] [Thread-1 ]: SQL status: BEGIN in 0.22 seconds +16:16:26.823586 [debug] [Thread-1 ]: Using postgres connection "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +16:16:26.823902 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select id +from "postgres"."public"."my_first_dbt_model" +where id is null + + + + + ) dbt_internal_test +16:16:26.828081 [debug] [Thread-4 ]: SQL status: BEGIN in 0.22 seconds +16:16:26.828534 [debug] [Thread-4 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +16:16:26.828848 [debug] [Thread-4 ]: On test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select player_id +from "postgres"."public"."wins_losses" +where player_id is null + + + + + ) dbt_internal_test +16:16:26.829677 [debug] [Thread-9 ]: SQL status: SELECT 1 in 0.02 seconds +16:16:26.835165 [debug] [Thread-9 ]: finished collecting timing info +16:16:26.835360 [debug] [Thread-2 ]: SQL status: BEGIN in 0.23 seconds +16:16:26.835492 [debug] [Thread-9 ]: On test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493: ROLLBACK +16:16:26.835544 [debug] [Thread-8 ]: SQL status: BEGIN in 0.23 seconds +16:16:26.835626 [debug] [Thread-2 ]: Using postgres connection "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +16:16:26.835729 [debug] [Thread-8 ]: Using postgres connection "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +16:16:26.835802 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select id +from "postgres"."public"."my_second_dbt_model" +where id is null + + + + + ) dbt_internal_test +16:16:26.835863 [debug] [Thread-8 ]: On test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + +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 + + + + + ) dbt_internal_test +16:16:26.843710 [debug] [Thread-1 ]: SQL status: SELECT 1 in 0.02 seconds +16:16:26.847039 [debug] [Thread-1 ]: finished collecting timing info +16:16:26.847554 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710: ROLLBACK +16:16:26.852991 [debug] [Thread-9 ]: On test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493: Close +16:16:26.854507 [info ] [Thread-9 ]: 9 of 9 PASS unique_my_second_dbt_model_id ...................................... [PASS in 0.30s] +16:16:26.855684 [debug] [Thread-9 ]: Finished running node test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +16:16:26.856665 [debug] [Thread-2 ]: SQL status: SELECT 1 in 0.02 seconds +16:16:26.856825 [debug] [Thread-8 ]: SQL status: SELECT 1 in 0.02 seconds +16:16:26.858485 [debug] [Thread-2 ]: finished collecting timing info +16:16:26.859226 [debug] [Thread-8 ]: finished collecting timing info +16:16:26.859314 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778: ROLLBACK +16:16:26.859381 [debug] [Thread-8 ]: On test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321: ROLLBACK +16:16:26.860040 [debug] [Thread-7 ]: SQL status: SELECT 1 in 0.05 seconds +16:16:26.860566 [debug] [Thread-7 ]: finished collecting timing info +16:16:26.860636 [debug] [Thread-7 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77: ROLLBACK +16:16:26.860714 [debug] [Thread-6 ]: SQL status: SELECT 1 in 0.06 seconds +16:16:26.861313 [debug] [Thread-6 ]: finished collecting timing info +16:16:26.861388 [debug] [Thread-6 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe: ROLLBACK +16:16:26.864417 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710: Close +16:16:26.865682 [info ] [Thread-1 ]: 1 of 9 PASS not_null_my_first_dbt_model_id ..................................... [PASS in 0.31s] +16:16:26.866502 [debug] [Thread-1 ]: Finished running node test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +16:16:26.868645 [debug] [Thread-5 ]: SQL status: SELECT 1 in 0.06 seconds +16:16:26.869211 [debug] [Thread-5 ]: finished collecting timing info +16:16:26.869285 [debug] [Thread-5 ]: On test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813: ROLLBACK +16:16:26.870294 [debug] [Thread-3 ]: SQL status: SELECT 1 in 0.05 seconds +16:16:26.870782 [debug] [Thread-3 ]: finished collecting timing info +16:16:26.870847 [debug] [Thread-3 ]: On test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1: ROLLBACK +16:16:26.871819 [debug] [Thread-4 ]: SQL status: SELECT 1 in 0.04 seconds +16:16:26.872301 [debug] [Thread-4 ]: finished collecting timing info +16:16:26.872364 [debug] [Thread-4 ]: On test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15: ROLLBACK +16:16:26.877894 [debug] [Thread-8 ]: On test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321: Close +16:16:26.879392 [info ] [Thread-8 ]: 8 of 9 PASS unique_my_first_dbt_model_id ....................................... [PASS in 0.33s] +16:16:26.879704 [debug] [Thread-6 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe: Close +16:16:26.879944 [debug] [Thread-7 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77: Close +16:16:26.880024 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778: Close +16:16:26.880203 [debug] [Thread-8 ]: Finished running node test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +16:16:26.880521 [info ] [Thread-6 ]: 6 of 9 PASS positive_test_wins_losses_total_losses ............................. [PASS in 0.33s] +16:16:26.880670 [info ] [Thread-7 ]: 7 of 9 PASS positive_test_wins_losses_total_wins ............................... [PASS in 0.33s] +16:16:26.880799 [info ] [Thread-2 ]: 2 of 9 PASS not_null_my_second_dbt_model_id .................................... [PASS in 0.33s] +16:16:26.881041 [debug] [Thread-6 ]: Finished running node test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe +16:16:26.881193 [debug] [Thread-7 ]: Finished running node test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77 +16:16:26.881333 [debug] [Thread-2 ]: Finished running node test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +16:16:26.888160 [debug] [Thread-5 ]: On test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813: Close +16:16:26.889511 [info ] [Thread-5 ]: 5 of 9 PASS not_null_wins_losses_seasonid ...................................... [PASS in 0.34s] +16:16:26.889865 [debug] [Thread-3 ]: On test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1: Close +16:16:26.892221 [info ] [Thread-3 ]: 3 of 9 PASS not_null_wins_losses_gameid ........................................ [PASS in 0.34s] +16:16:26.892535 [debug] [Thread-4 ]: On test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15: Close +16:16:26.893048 [debug] [Thread-3 ]: Finished running node test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +16:16:26.890784 [debug] [Thread-5 ]: Finished running node test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +16:16:26.893909 [info ] [Thread-4 ]: 4 of 9 PASS not_null_wins_losses_player_id ..................................... [PASS in 0.34s] +16:16:26.894183 [debug] [Thread-4 ]: Finished running node test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +16:16:26.895147 [debug] [MainThread]: Acquiring new postgres connection "master" +16:16:26.895254 [debug] [MainThread]: Using postgres connection "master" +16:16:26.895310 [debug] [MainThread]: On master: BEGIN +16:16:26.895363 [debug] [MainThread]: Opening a new connection, currently in state closed +16:16:27.085850 [debug] [MainThread]: SQL status: BEGIN in 0.19 seconds +16:16:27.087158 [debug] [MainThread]: On master: COMMIT +16:16:27.087450 [debug] [MainThread]: Using postgres connection "master" +16:16:27.087723 [debug] [MainThread]: On master: COMMIT +16:16:27.105725 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +16:16:27.106713 [debug] [MainThread]: On master: Close +16:16:27.108481 [info ] [MainThread]: +16:16:27.109109 [info ] [MainThread]: Finished running 9 tests in 1.31s. +16:16:27.109738 [debug] [MainThread]: Connection 'master' was properly closed. +16:16:27.109978 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710' was properly closed. +16:16:27.110034 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778' was properly closed. +16:16:27.110082 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1' was properly closed. +16:16:27.110131 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15' was properly closed. +16:16:27.110187 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813' was properly closed. +16:16:27.110242 [debug] [MainThread]: Connection 'test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe' was properly closed. +16:16:27.110293 [debug] [MainThread]: Connection 'test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77' was properly closed. +16:16:27.110338 [debug] [MainThread]: Connection 'test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321' was properly closed. +16:16:27.110383 [debug] [MainThread]: Connection 'test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493' was properly closed. +16:16:27.114971 [info ] [MainThread]: +16:16:27.115108 [info ] [MainThread]: Completed successfully +16:16:27.115225 [info ] [MainThread]: +16:16:27.115310 [info ] [MainThread]: Done. PASS=9 WARN=0 ERROR=0 SKIP=0 TOTAL=9 +16:16:27.115441 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [, , ]} + + +============================== 2022-07-08 16:16:32.372850 | 5351534f-9153-4608-9191-fed70b460c49 ============================== +16:16:32.372889 [info ] [MainThread]: Running with dbt=1.1.1 +16:16:32.373289 [debug] [MainThread]: running dbt with arguments {'write_json': True, 'use_colors': True, 'printer_width': 80, 'version_check': True, 'partial_parse': True, 'static_parser': True, 'profiles_dir': '/Users/bruno.campos/.dbt', 'send_anonymous_usage_stats': True, 'event_buffer_size': 100000, 'quiet': False, 'no_print': False, 'which': 'run', 'rpc_method': 'run', 'indirect_selection': 'eager'} +16:16:32.373377 [debug] [MainThread]: Tracking: tracking +16:16:32.388278 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [, , ]} +16:16:32.405454 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 0 files changed. +16:16:32.405572 [debug] [MainThread]: Partial parsing enabled, no changes found, skipping parsing +16:16:32.408863 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '5351534f-9153-4608-9191-fed70b460c49', 'context': []} +16:16:32.411526 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '5351534f-9153-4608-9191-fed70b460c49', 'context': []} +16:16:32.411676 [info ] [MainThread]: Found 3 models, 9 tests, 0 snapshots, 0 analyses, 168 macros, 0 operations, 0 seed files, 0 sources, 0 exposures, 0 metrics +16:16:32.411825 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '5351534f-9153-4608-9191-fed70b460c49', 'context': []} +16:16:32.412513 [info ] [MainThread]: +16:16:32.412716 [debug] [MainThread]: Acquiring new postgres connection "master" +16:16:32.413121 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres" +16:16:32.417414 [debug] [ThreadPool]: Using postgres connection "list_postgres" +16:16:32.417493 [debug] [ThreadPool]: On list_postgres: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres"} */ + + select distinct nspname from pg_namespace + +16:16:32.417553 [debug] [ThreadPool]: Opening a new connection, currently in state init +16:16:32.639260 [debug] [ThreadPool]: SQL status: SELECT 10 in 0.22 seconds +16:16:32.641441 [debug] [ThreadPool]: On list_postgres: Close +16:16:32.642584 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres_public" +16:16:32.645924 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +16:16:32.646026 [debug] [ThreadPool]: On list_postgres_public: BEGIN +16:16:32.646089 [debug] [ThreadPool]: Opening a new connection, currently in state closed +16:16:32.830342 [debug] [ThreadPool]: SQL status: BEGIN in 0.18 seconds +16:16:32.831111 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +16:16:32.831375 [debug] [ThreadPool]: On list_postgres_public: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres_public"} */ +select + 'postgres' as database, + tablename as name, + schemaname as schema, + 'table' as type + from pg_tables + where schemaname ilike 'public' + union all + select + 'postgres' as database, + viewname as name, + schemaname as schema, + 'view' as type + from pg_views + where schemaname ilike 'public' + +16:16:32.855072 [debug] [ThreadPool]: SQL status: SELECT 19 in 0.02 seconds +16:16:32.859887 [debug] [ThreadPool]: On list_postgres_public: ROLLBACK +16:16:32.879810 [debug] [ThreadPool]: On list_postgres_public: Close +16:16:32.887287 [debug] [MainThread]: Using postgres connection "master" +16:16:32.887478 [debug] [MainThread]: On master: BEGIN +16:16:32.887541 [debug] [MainThread]: Opening a new connection, currently in state init +16:16:33.087397 [debug] [MainThread]: SQL status: BEGIN in 0.2 seconds +16:16:33.088762 [debug] [MainThread]: Using postgres connection "master" +16:16:33.089007 [debug] [MainThread]: On master: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "master"} */ +with relation as ( + select + pg_rewrite.ev_class as class, + pg_rewrite.oid as id + from pg_rewrite + ), + class as ( + select + oid as id, + relname as name, + relnamespace as schema, + relkind as kind + from pg_class + ), + dependency as ( + select distinct + pg_depend.objid as id, + pg_depend.refobjid as ref + from pg_depend + ), + schema as ( + select + pg_namespace.oid as id, + pg_namespace.nspname as name + from pg_namespace + where nspname != 'information_schema' and nspname not like 'pg\_%' + ), + referenced as ( + select + relation.id AS id, + referenced_class.name , + referenced_class.schema , + referenced_class.kind + from relation + join class as referenced_class on relation.class=referenced_class.id + where referenced_class.kind in ('r', 'v') + ), + relationships as ( + select + referenced.name as referenced_name, + referenced.schema as referenced_schema_id, + dependent_class.name as dependent_name, + dependent_class.schema as dependent_schema_id, + referenced.kind as kind + from referenced + join dependency on referenced.id=dependency.id + join class as dependent_class on dependency.ref=dependent_class.id + where + (referenced.name != dependent_class.name or + referenced.schema != dependent_class.schema) + ) + + select + referenced_schema.name as referenced_schema, + relationships.referenced_name as referenced_name, + dependent_schema.name as dependent_schema, + relationships.dependent_name as dependent_name + from relationships + join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id + join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id + group by referenced_schema, referenced_name, dependent_schema, dependent_name + order by referenced_schema, referenced_name, dependent_schema, dependent_name; +16:16:33.264814 [debug] [MainThread]: SQL status: SELECT 4 in 0.18 seconds +16:16:33.269129 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '5351534f-9153-4608-9191-fed70b460c49', 'context': []} +16:16:33.269623 [debug] [MainThread]: On master: ROLLBACK +16:16:33.288534 [debug] [MainThread]: Using postgres connection "master" +16:16:33.289363 [debug] [MainThread]: On master: BEGIN +16:16:33.348584 [debug] [MainThread]: SQL status: BEGIN in 0.06 seconds +16:16:33.349636 [debug] [MainThread]: On master: COMMIT +16:16:33.350043 [debug] [MainThread]: Using postgres connection "master" +16:16:33.350384 [debug] [MainThread]: On master: COMMIT +16:16:33.368604 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +16:16:33.369513 [debug] [MainThread]: On master: Close +16:16:33.371237 [info ] [MainThread]: Concurrency: 10 threads (target='dev') +16:16:33.372033 [info ] [MainThread]: +16:16:33.378569 [debug] [Thread-1 ]: Began running node model.wrkplay_dbt.my_first_dbt_model +16:16:33.378848 [info ] [Thread-1 ]: 1 of 3 START view model public.my_first_dbt_model .............................. [RUN] +16:16:33.379006 [debug] [Thread-2 ]: Began running node model.wrkplay_dbt.wins_losses +16:16:33.379233 [debug] [Thread-1 ]: Acquiring new postgres connection "model.wrkplay_dbt.my_first_dbt_model" +16:16:33.379368 [info ] [Thread-2 ]: 2 of 3 START view model public.wins_losses ..................................... [RUN] +16:16:33.379472 [debug] [Thread-1 ]: Began compiling node model.wrkplay_dbt.my_first_dbt_model +16:16:33.379661 [debug] [Thread-2 ]: Acquiring new postgres connection "model.wrkplay_dbt.wins_losses" +16:16:33.379769 [debug] [Thread-1 ]: Compiling model.wrkplay_dbt.my_first_dbt_model +16:16:33.379835 [debug] [Thread-2 ]: Began compiling node model.wrkplay_dbt.wins_losses +16:16:33.381683 [debug] [Thread-1 ]: Writing injected SQL for node "model.wrkplay_dbt.my_first_dbt_model" +16:16:33.381777 [debug] [Thread-2 ]: Compiling model.wrkplay_dbt.wins_losses +16:16:33.382571 [debug] [Thread-2 ]: Writing injected SQL for node "model.wrkplay_dbt.wins_losses" +16:16:33.383068 [debug] [Thread-1 ]: finished collecting timing info +16:16:33.383177 [debug] [Thread-1 ]: Began executing node model.wrkplay_dbt.my_first_dbt_model +16:16:33.389136 [debug] [Thread-2 ]: finished collecting timing info +16:16:33.393825 [debug] [Thread-1 ]: Writing runtime SQL for node "model.wrkplay_dbt.my_first_dbt_model" +16:16:33.393954 [debug] [Thread-2 ]: Began executing node model.wrkplay_dbt.wins_losses +16:16:33.395123 [debug] [Thread-2 ]: Writing runtime SQL for node "model.wrkplay_dbt.wins_losses" +16:16:33.395312 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +16:16:33.395395 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: BEGIN +16:16:33.395458 [debug] [Thread-1 ]: Opening a new connection, currently in state closed +16:16:33.395520 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +16:16:33.395655 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: BEGIN +16:16:33.395716 [debug] [Thread-2 ]: Opening a new connection, currently in state init +16:16:33.611404 [debug] [Thread-2 ]: SQL status: BEGIN in 0.22 seconds +16:16:33.611813 [debug] [Thread-1 ]: SQL status: BEGIN in 0.22 seconds +16:16:33.612103 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +16:16:33.612301 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +16:16:33.612491 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ + + create view "postgres"."public"."wins_losses__dbt_tmp" as ( + --number of wins and losses per player per game (per office) per season +WITH loss_table AS ( + SELECT + SUM(lt.left_losses) AS "total_losses" + , lt.left_player_id AS "loss_player_id" + , lt.gameid + , lt.seasonid + FROM + ( + SELECT + * + FROM + ( + --Begin DONE + WITH left_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore > m.rightscore THEN 0 + ELSE 1 + END) AS "left_loss" + , l."A" + , l."B" + , m."gameid" + , m."seasonid" + FROM + "_left" l + JOIN "Match" m ON + l."A" = m.id + GROUP BY + l."A" + , l."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.left_loss) AS "left_losses" + , a."B" AS "left_player_id" + , a."gameid" + , a."seasonid" + FROM + left_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + --End DONE + ) ll + UNION ALL + SELECT + * + FROM + ( + --Begin DONE + WITH right_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore < m.rightscore THEN 0 + ELSE 1 + END) AS "right_loss" + , r."A" + , r."B" + , m."gameid" + , m."seasonid" + FROM + "_right" r + JOIN "Match" m ON + r."A" = m.id + GROUP BY + r."A" + , r."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.right_loss) AS "right_losses" + , a."B" AS "right_player_id" + , a."gameid" + , a."seasonid" + FROM + right_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + --End DONE + ) rl + ) lt + -- WHERE lt.left_player_id = '' + GROUP BY + lt.left_player_id + , lt.gameid + , lt.seasonid +) +, +win_table AS ( + --number of wins for a player and gameid + SELECT + SUM(rt.right_wins) AS "total_wins" + , rt.right_player_id AS "win_player_id" + , rt.gameid + , rt."seasonid" + FROM + ( + SELECT + * + FROM + ( + WITH right_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore < m.rightscore THEN 1 + ELSE 0 + END) AS "right_won" + , r."A" + , r."B" + , m."gameid" + , m."seasonid" + FROM + "_right" r + JOIN "Match" m ON + r."A" = m.id + GROUP BY + r."A" + , r."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.right_won) AS "right_wins" + , a."B" AS "right_player_id" + , a."gameid" + , a."seasonid" + FROM + right_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + ) rw + UNION ALL + SELECT + * + FROM + ( + WITH left_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore > m.rightscore THEN 1 + ELSE 0 + END) AS "left_won" + , l."A" + , l."B" + , m."gameid" + , m."seasonid" + FROM + "_left" l + JOIN "Match" m ON + l."A" = m.id + GROUP BY + l."A" + , l."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.left_won) AS "left_wins" + , a."B" AS "left_player_id" + , a."gameid" + , a."seasonid" + FROM + left_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + ) lw + ) rt + -- WHERE rt.right_player_id = '' + GROUP BY + rt.right_player_id + , rt.gameid + , rt."seasonid" +) +SELECT + COALESCE(lt.loss_player_id, wt.win_player_id) AS "player_id" + , COALESCE(lt."gameid", wt."gameid") AS "gameid" + , COALESCE(lt.seasonid, wt.seasonid) AS "seasonid" + , wt."total_wins" + , lt."total_losses" +FROM + loss_table lt +FULL OUTER JOIN win_table wt ON + lt."loss_player_id" = wt."win_player_id" + AND lt."gameid" = wt."gameid" + AND lt."seasonid" = wt."seasonid" + ); +16:16:33.612668 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ + + create view "postgres"."public"."my_first_dbt_model__dbt_tmp" as ( + /* + 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 + ); +16:16:33.636694 [debug] [Thread-1 ]: SQL status: CREATE VIEW in 0.02 seconds +16:16:33.643779 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +16:16:33.643965 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ +alter table "postgres"."public"."my_first_dbt_model" rename to "my_first_dbt_model__dbt_backup" +16:16:33.645706 [debug] [Thread-2 ]: SQL status: CREATE VIEW in 0.03 seconds +16:16:33.646902 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +16:16:33.646983 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ +alter table "postgres"."public"."wins_losses" rename to "wins_losses__dbt_backup" +16:16:33.665009 [debug] [Thread-1 ]: SQL status: ALTER TABLE in 0.02 seconds +16:16:33.668908 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +16:16:33.669219 [debug] [Thread-2 ]: SQL status: ALTER TABLE in 0.02 seconds +16:16:33.669417 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ +alter table "postgres"."public"."my_first_dbt_model__dbt_tmp" rename to "my_first_dbt_model" +16:16:33.670583 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +16:16:33.670706 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ +alter table "postgres"."public"."wins_losses__dbt_tmp" rename to "wins_losses" +16:16:33.699365 [debug] [Thread-1 ]: SQL status: ALTER TABLE in 0.03 seconds +16:16:33.699642 [debug] [Thread-2 ]: SQL status: ALTER TABLE in 0.03 seconds +16:16:33.706163 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: COMMIT +16:16:33.706760 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: COMMIT +16:16:33.706845 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +16:16:33.706911 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +16:16:33.706969 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: COMMIT +16:16:33.707024 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: COMMIT +16:16:33.732428 [debug] [Thread-2 ]: SQL status: COMMIT in 0.03 seconds +16:16:33.732675 [debug] [Thread-1 ]: SQL status: COMMIT in 0.03 seconds +16:16:33.737626 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +16:16:33.738340 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +16:16:33.738414 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ +drop view if exists "postgres"."public"."wins_losses__dbt_backup" cascade +16:16:33.738474 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ +drop view if exists "postgres"."public"."my_first_dbt_model__dbt_backup" cascade +16:16:33.760938 [debug] [Thread-2 ]: SQL status: DROP VIEW in 0.02 seconds +16:16:33.761033 [debug] [Thread-1 ]: SQL status: DROP VIEW in 0.02 seconds +16:16:33.761633 [debug] [Thread-2 ]: finished collecting timing info +16:16:33.762067 [debug] [Thread-1 ]: finished collecting timing info +16:16:33.762155 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: Close +16:16:33.762260 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: Close +16:16:33.762568 [debug] [Thread-2 ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '5351534f-9153-4608-9191-fed70b460c49', 'context': []} +16:16:33.762716 [debug] [Thread-1 ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '5351534f-9153-4608-9191-fed70b460c49', 'context': []} +16:16:33.762904 [info ] [Thread-2 ]: 2 of 3 OK created view model public.wins_losses ................................ [CREATE VIEW in 0.38s] +16:16:33.763044 [info ] [Thread-1 ]: 1 of 3 OK created view model public.my_first_dbt_model ......................... [CREATE VIEW in 0.38s] +16:16:33.763250 [debug] [Thread-2 ]: Finished running node model.wrkplay_dbt.wins_losses +16:16:33.763384 [debug] [Thread-1 ]: Finished running node model.wrkplay_dbt.my_first_dbt_model +16:16:33.763746 [debug] [Thread-4 ]: Began running node model.wrkplay_dbt.my_second_dbt_model +16:16:33.763841 [info ] [Thread-4 ]: 3 of 3 START view model public.my_second_dbt_model ............................. [RUN] +16:16:33.764007 [debug] [Thread-4 ]: Acquiring new postgres connection "model.wrkplay_dbt.my_second_dbt_model" +16:16:33.764066 [debug] [Thread-4 ]: Began compiling node model.wrkplay_dbt.my_second_dbt_model +16:16:33.764127 [debug] [Thread-4 ]: Compiling model.wrkplay_dbt.my_second_dbt_model +16:16:33.765073 [debug] [Thread-4 ]: Writing injected SQL for node "model.wrkplay_dbt.my_second_dbt_model" +16:16:33.765347 [debug] [Thread-4 ]: finished collecting timing info +16:16:33.765411 [debug] [Thread-4 ]: Began executing node model.wrkplay_dbt.my_second_dbt_model +16:16:33.766493 [debug] [Thread-4 ]: Writing runtime SQL for node "model.wrkplay_dbt.my_second_dbt_model" +16:16:33.766942 [debug] [Thread-4 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +16:16:33.767000 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: BEGIN +16:16:33.767051 [debug] [Thread-4 ]: Opening a new connection, currently in state init +16:16:34.080623 [debug] [Thread-4 ]: SQL status: BEGIN in 0.31 seconds +16:16:34.081834 [debug] [Thread-4 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +16:16:34.082040 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_second_dbt_model"} */ + + create view "postgres"."public"."my_second_dbt_model__dbt_tmp" as ( + -- Use the `ref` function to select from other models + +select * +from "postgres"."public"."my_first_dbt_model" +where id = 1 + ); +16:16:34.105544 [debug] [Thread-4 ]: SQL status: CREATE VIEW in 0.02 seconds +16:16:34.110506 [debug] [Thread-4 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +16:16:34.110699 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_second_dbt_model"} */ +alter table "postgres"."public"."my_second_dbt_model__dbt_tmp" rename to "my_second_dbt_model" +16:16:34.139801 [debug] [Thread-4 ]: SQL status: ALTER TABLE in 0.03 seconds +16:16:34.143583 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: COMMIT +16:16:34.143832 [debug] [Thread-4 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +16:16:34.143995 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: COMMIT +16:16:34.170629 [debug] [Thread-4 ]: SQL status: COMMIT in 0.03 seconds +16:16:34.175085 [debug] [Thread-4 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +16:16:34.175234 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_second_dbt_model"} */ +drop view if exists "postgres"."public"."my_second_dbt_model__dbt_backup" cascade +16:16:34.194563 [debug] [Thread-4 ]: SQL status: DROP VIEW in 0.02 seconds +16:16:34.198113 [debug] [Thread-4 ]: finished collecting timing info +16:16:34.198902 [debug] [Thread-4 ]: On model.wrkplay_dbt.my_second_dbt_model: Close +16:16:34.199422 [debug] [Thread-4 ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '5351534f-9153-4608-9191-fed70b460c49', 'context': []} +16:16:34.199683 [info ] [Thread-4 ]: 3 of 3 OK created view model public.my_second_dbt_model ........................ [CREATE VIEW in 0.44s] +16:16:34.199947 [debug] [Thread-4 ]: Finished running node model.wrkplay_dbt.my_second_dbt_model +16:16:34.200995 [debug] [MainThread]: Acquiring new postgres connection "master" +16:16:34.201106 [debug] [MainThread]: Using postgres connection "master" +16:16:34.201163 [debug] [MainThread]: On master: BEGIN +16:16:34.201219 [debug] [MainThread]: Opening a new connection, currently in state closed +16:16:34.405874 [debug] [MainThread]: SQL status: BEGIN in 0.2 seconds +16:16:34.407011 [debug] [MainThread]: On master: COMMIT +16:16:34.407219 [debug] [MainThread]: Using postgres connection "master" +16:16:34.407417 [debug] [MainThread]: On master: COMMIT +16:16:34.430933 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +16:16:34.432043 [debug] [MainThread]: On master: Close +16:16:34.433742 [info ] [MainThread]: +16:16:34.434283 [info ] [MainThread]: Finished running 3 view models in 2.02s. +16:16:34.434746 [debug] [MainThread]: Connection 'master' was properly closed. +16:16:34.434880 [debug] [MainThread]: Connection 'model.wrkplay_dbt.my_first_dbt_model' was properly closed. +16:16:34.434937 [debug] [MainThread]: Connection 'model.wrkplay_dbt.wins_losses' was properly closed. +16:16:34.434989 [debug] [MainThread]: Connection 'model.wrkplay_dbt.my_second_dbt_model' was properly closed. +16:16:34.438385 [info ] [MainThread]: +16:16:34.438522 [info ] [MainThread]: Completed successfully +16:16:34.438664 [info ] [MainThread]: +16:16:34.438759 [info ] [MainThread]: Done. PASS=3 WARN=0 ERROR=0 SKIP=0 TOTAL=3 +16:16:34.438913 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [, , ]} + + +============================== 2022-07-08 17:05:46.045310 | 12a34e78-8420-4766-8cf5-a6d8fb495bdc ============================== +17:05:46.045331 [info ] [MainThread]: Running with dbt=1.1.1 +17:05:46.046205 [debug] [MainThread]: running dbt with arguments {'write_json': True, 'use_colors': True, 'printer_width': 80, 'version_check': True, 'partial_parse': True, 'static_parser': True, 'profiles_dir': '/Users/bruno.campos/.dbt', 'send_anonymous_usage_stats': True, 'event_buffer_size': 100000, 'quiet': False, 'no_print': False, 'indirect_selection': 'eager', 'which': 'test', 'rpc_method': 'test'} +17:05:46.046339 [debug] [MainThread]: Tracking: tracking +17:05:46.070310 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [, , ]} +17:05:46.090558 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 1 files added, 1 files changed. +17:05:46.090756 [debug] [MainThread]: Partial parsing: added file: wrkplay_dbt://models/number_played_against.sql +17:05:46.090925 [debug] [MainThread]: Partial parsing: update schema file: wrkplay_dbt://models/schema.yml +17:05:46.097530 [debug] [MainThread]: 1699: static parser successfully parsed number_played_against.sql +17:05:46.123323 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '12a34e78-8420-4766-8cf5-a6d8fb495bdc', 'context': []} +17:05:46.127045 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '12a34e78-8420-4766-8cf5-a6d8fb495bdc', 'context': []} +17:05:46.127193 [info ] [MainThread]: Found 4 models, 13 tests, 0 snapshots, 0 analyses, 168 macros, 0 operations, 0 seed files, 0 sources, 0 exposures, 0 metrics +17:05:46.127331 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '12a34e78-8420-4766-8cf5-a6d8fb495bdc', 'context': []} +17:05:46.128246 [info ] [MainThread]: +17:05:46.128442 [debug] [MainThread]: Acquiring new postgres connection "master" +17:05:46.128921 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres_public" +17:05:46.133243 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +17:05:46.133347 [debug] [ThreadPool]: On list_postgres_public: BEGIN +17:05:46.133419 [debug] [ThreadPool]: Opening a new connection, currently in state init +17:05:46.366635 [debug] [ThreadPool]: SQL status: BEGIN in 0.23 seconds +17:05:46.367750 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +17:05:46.368178 [debug] [ThreadPool]: On list_postgres_public: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres_public"} */ +select + 'postgres' as database, + tablename as name, + schemaname as schema, + 'table' as type + from pg_tables + where schemaname ilike 'public' + union all + select + 'postgres' as database, + viewname as name, + schemaname as schema, + 'view' as type + from pg_views + where schemaname ilike 'public' + +17:05:46.390659 [debug] [ThreadPool]: SQL status: SELECT 19 in 0.02 seconds +17:05:46.396373 [debug] [ThreadPool]: On list_postgres_public: ROLLBACK +17:05:46.413900 [debug] [ThreadPool]: On list_postgres_public: Close +17:05:46.420151 [debug] [MainThread]: Using postgres connection "master" +17:05:46.420265 [debug] [MainThread]: On master: BEGIN +17:05:46.420328 [debug] [MainThread]: Opening a new connection, currently in state init +17:05:46.622998 [debug] [MainThread]: SQL status: BEGIN in 0.2 seconds +17:05:46.624188 [debug] [MainThread]: Using postgres connection "master" +17:05:46.624607 [debug] [MainThread]: On master: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "master"} */ +with relation as ( + select + pg_rewrite.ev_class as class, + pg_rewrite.oid as id + from pg_rewrite + ), + class as ( + select + oid as id, + relname as name, + relnamespace as schema, + relkind as kind + from pg_class + ), + dependency as ( + select distinct + pg_depend.objid as id, + pg_depend.refobjid as ref + from pg_depend + ), + schema as ( + select + pg_namespace.oid as id, + pg_namespace.nspname as name + from pg_namespace + where nspname != 'information_schema' and nspname not like 'pg\_%' + ), + referenced as ( + select + relation.id AS id, + referenced_class.name , + referenced_class.schema , + referenced_class.kind + from relation + join class as referenced_class on relation.class=referenced_class.id + where referenced_class.kind in ('r', 'v') + ), + relationships as ( + select + referenced.name as referenced_name, + referenced.schema as referenced_schema_id, + dependent_class.name as dependent_name, + dependent_class.schema as dependent_schema_id, + referenced.kind as kind + from referenced + join dependency on referenced.id=dependency.id + join class as dependent_class on dependency.ref=dependent_class.id + where + (referenced.name != dependent_class.name or + referenced.schema != dependent_class.schema) + ) + + select + referenced_schema.name as referenced_schema, + relationships.referenced_name as referenced_name, + dependent_schema.name as dependent_schema, + relationships.dependent_name as dependent_name + from relationships + join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id + join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id + group by referenced_schema, referenced_name, dependent_schema, dependent_name + order by referenced_schema, referenced_name, dependent_schema, dependent_name; +17:05:46.795156 [debug] [MainThread]: SQL status: SELECT 4 in 0.17 seconds +17:05:46.798575 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '12a34e78-8420-4766-8cf5-a6d8fb495bdc', 'context': []} +17:05:46.799027 [debug] [MainThread]: On master: ROLLBACK +17:05:46.818395 [debug] [MainThread]: Using postgres connection "master" +17:05:46.818897 [debug] [MainThread]: On master: BEGIN +17:05:46.857154 [debug] [MainThread]: SQL status: BEGIN in 0.04 seconds +17:05:46.858372 [debug] [MainThread]: On master: COMMIT +17:05:46.858797 [debug] [MainThread]: Using postgres connection "master" +17:05:46.859007 [debug] [MainThread]: On master: COMMIT +17:05:46.880955 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +17:05:46.881686 [debug] [MainThread]: On master: Close +17:05:46.883292 [info ] [MainThread]: Concurrency: 10 threads (target='dev') +17:05:46.883887 [info ] [MainThread]: +17:05:46.888320 [debug] [Thread-1 ]: Began running node test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +17:05:46.888430 [debug] [Thread-2 ]: Began running node test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +17:05:46.888500 [debug] [Thread-3 ]: Began running node test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c +17:05:46.888570 [debug] [Thread-4 ]: Began running node test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427 +17:05:46.888634 [debug] [Thread-5 ]: Began running node test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073 +17:05:46.888684 [debug] [Thread-6 ]: Began running node test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +17:05:46.888757 [info ] [Thread-1 ]: 1 of 13 START test not_null_my_first_dbt_model_id .............................. [RUN] +17:05:46.888819 [debug] [Thread-7 ]: Began running node test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +17:05:46.888890 [debug] [Thread-8 ]: Began running node test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +17:05:46.888953 [debug] [Thread-9 ]: Began running node test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20 +17:05:46.889000 [debug] [Thread-10 ]: Began running node test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe +17:05:46.889049 [info ] [Thread-2 ]: 2 of 13 START test not_null_my_second_dbt_model_id ............................. [RUN] +17:05:46.889117 [info ] [Thread-3 ]: 3 of 13 START test not_null_number_played_against_num_played_against ........... [RUN] +17:05:46.889195 [info ] [Thread-4 ]: 4 of 13 START test not_null_number_played_against_player_id .................... [RUN] +17:05:46.889259 [info ] [Thread-5 ]: 5 of 13 START test not_null_number_played_against_season_id .................... [RUN] +17:05:46.889351 [info ] [Thread-6 ]: 6 of 13 START test not_null_wins_losses_gameid ................................. [RUN] +17:05:46.889640 [debug] [Thread-1 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +17:05:46.889693 [info ] [Thread-7 ]: 7 of 13 START test not_null_wins_losses_player_id .............................. [RUN] +17:05:46.889761 [info ] [Thread-8 ]: 8 of 13 START test not_null_wins_losses_seasonid ............................... [RUN] +17:05:46.889822 [info ] [Thread-9 ]: 9 of 13 START test positive_test_number_played_against_num_played_against ...... [RUN] +17:05:46.889885 [info ] [Thread-10 ]: 10 of 13 START test positive_test_wins_losses_total_losses ..................... [RUN] +17:05:46.890059 [debug] [Thread-2 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +17:05:46.890215 [debug] [Thread-3 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c" +17:05:46.890382 [debug] [Thread-4 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427" +17:05:46.890539 [debug] [Thread-5 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073" +17:05:46.890687 [debug] [Thread-6 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +17:05:46.890752 [debug] [Thread-1 ]: Began compiling node test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +17:05:46.890946 [debug] [Thread-7 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +17:05:46.891125 [debug] [Thread-8 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +17:05:46.891275 [debug] [Thread-9 ]: Acquiring new postgres connection "test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20" +17:05:46.891440 [debug] [Thread-10 ]: Acquiring new postgres connection "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe" +17:05:46.891494 [debug] [Thread-2 ]: Began compiling node test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +17:05:46.891552 [debug] [Thread-3 ]: Began compiling node test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c +17:05:46.891608 [debug] [Thread-4 ]: Began compiling node test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427 +17:05:46.891661 [debug] [Thread-5 ]: Began compiling node test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073 +17:05:46.891714 [debug] [Thread-6 ]: Began compiling node test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +17:05:46.891784 [debug] [Thread-1 ]: Compiling test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +17:05:46.891837 [debug] [Thread-7 ]: Began compiling node test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +17:05:46.891889 [debug] [Thread-8 ]: Began compiling node test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +17:05:46.891940 [debug] [Thread-9 ]: Began compiling node test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20 +17:05:46.891991 [debug] [Thread-10 ]: Began compiling node test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe +17:05:46.892045 [debug] [Thread-2 ]: Compiling test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +17:05:46.892099 [debug] [Thread-3 ]: Compiling test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c +17:05:46.892155 [debug] [Thread-4 ]: Compiling test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427 +17:05:46.892208 [debug] [Thread-5 ]: Compiling test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073 +17:05:46.892259 [debug] [Thread-6 ]: Compiling test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +17:05:46.896379 [debug] [Thread-1 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +17:05:46.896476 [debug] [Thread-7 ]: Compiling test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +17:05:46.896545 [debug] [Thread-8 ]: Compiling test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +17:05:46.896606 [debug] [Thread-9 ]: Compiling test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20 +17:05:46.896662 [debug] [Thread-10 ]: Compiling test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe +17:05:46.898138 [debug] [Thread-2 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +17:05:46.899519 [debug] [Thread-3 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c" +17:05:46.900864 [debug] [Thread-4 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427" +17:05:46.902194 [debug] [Thread-5 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073" +17:05:46.903495 [debug] [Thread-6 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +17:05:46.905590 [debug] [Thread-7 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +17:05:46.926627 [debug] [Thread-8 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +17:05:46.928111 [debug] [Thread-9 ]: Writing injected SQL for node "test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20" +17:05:46.929425 [debug] [Thread-10 ]: Writing injected SQL for node "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe" +17:05:46.929492 [debug] [Thread-1 ]: finished collecting timing info +17:05:46.929930 [debug] [Thread-2 ]: finished collecting timing info +17:05:46.930498 [debug] [Thread-1 ]: Began executing node test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +17:05:46.930679 [debug] [Thread-2 ]: Began executing node test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +17:05:46.930828 [debug] [Thread-3 ]: finished collecting timing info +17:05:46.930953 [debug] [Thread-4 ]: finished collecting timing info +17:05:46.931035 [debug] [Thread-6 ]: finished collecting timing info +17:05:46.931105 [debug] [Thread-7 ]: finished collecting timing info +17:05:46.931159 [debug] [Thread-8 ]: finished collecting timing info +17:05:46.938539 [debug] [Thread-1 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +17:05:46.938674 [debug] [Thread-9 ]: finished collecting timing info +17:05:46.938758 [debug] [Thread-5 ]: finished collecting timing info +17:05:46.938809 [debug] [Thread-10 ]: finished collecting timing info +17:05:46.939759 [debug] [Thread-2 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +17:05:46.939860 [debug] [Thread-3 ]: Began executing node test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c +17:05:46.939936 [debug] [Thread-4 ]: Began executing node test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427 +17:05:46.940006 [debug] [Thread-6 ]: Began executing node test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +17:05:46.940080 [debug] [Thread-7 ]: Began executing node test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +17:05:46.940142 [debug] [Thread-8 ]: Began executing node test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +17:05:46.940244 [debug] [Thread-9 ]: Began executing node test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20 +17:05:46.940304 [debug] [Thread-5 ]: Began executing node test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073 +17:05:46.940383 [debug] [Thread-10 ]: Began executing node test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe +17:05:46.940500 [debug] [Thread-1 ]: Using postgres connection "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +17:05:46.941223 [debug] [Thread-3 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c" +17:05:46.941905 [debug] [Thread-4 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427" +17:05:46.941982 [debug] [Thread-2 ]: Using postgres connection "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +17:05:46.942686 [debug] [Thread-6 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +17:05:46.943382 [debug] [Thread-7 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +17:05:46.944015 [debug] [Thread-8 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +17:05:46.944645 [debug] [Thread-9 ]: Writing runtime SQL for node "test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20" +17:05:46.945265 [debug] [Thread-5 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073" +17:05:46.946286 [debug] [Thread-10 ]: Writing runtime SQL for node "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe" +17:05:46.946365 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710: BEGIN +17:05:46.946523 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778: BEGIN +17:05:46.946914 [debug] [Thread-3 ]: Using postgres connection "test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c" +17:05:46.947041 [debug] [Thread-4 ]: Using postgres connection "test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427" +17:05:46.947127 [debug] [Thread-9 ]: Using postgres connection "test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20" +17:05:46.947216 [debug] [Thread-6 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +17:05:46.947276 [debug] [Thread-8 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +17:05:46.947356 [debug] [Thread-5 ]: Using postgres connection "test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073" +17:05:46.947419 [debug] [Thread-1 ]: Opening a new connection, currently in state closed +17:05:46.947486 [debug] [Thread-2 ]: Opening a new connection, currently in state init +17:05:46.947570 [debug] [Thread-7 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +17:05:46.947625 [debug] [Thread-3 ]: On test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c: BEGIN +17:05:46.947697 [debug] [Thread-4 ]: On test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427: BEGIN +17:05:46.947756 [debug] [Thread-10 ]: Using postgres connection "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe" +17:05:46.947814 [debug] [Thread-9 ]: On test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20: BEGIN +17:05:46.947877 [debug] [Thread-6 ]: On test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1: BEGIN +17:05:46.947935 [debug] [Thread-8 ]: On test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813: BEGIN +17:05:46.947990 [debug] [Thread-5 ]: On test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073: BEGIN +17:05:46.948170 [debug] [Thread-7 ]: On test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15: BEGIN +17:05:46.948225 [debug] [Thread-3 ]: Opening a new connection, currently in state init +17:05:46.948282 [debug] [Thread-4 ]: Opening a new connection, currently in state init +17:05:46.948336 [debug] [Thread-10 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe: BEGIN +17:05:46.948387 [debug] [Thread-9 ]: Opening a new connection, currently in state init +17:05:46.948438 [debug] [Thread-6 ]: Opening a new connection, currently in state init +17:05:46.948489 [debug] [Thread-8 ]: Opening a new connection, currently in state init +17:05:46.948542 [debug] [Thread-5 ]: Opening a new connection, currently in state init +17:05:46.948592 [debug] [Thread-7 ]: Opening a new connection, currently in state init +17:05:46.948738 [debug] [Thread-10 ]: Opening a new connection, currently in state init +17:05:47.137669 [debug] [Thread-1 ]: SQL status: BEGIN in 0.19 seconds +17:05:47.137967 [debug] [Thread-1 ]: Using postgres connection "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +17:05:47.138033 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select id +from "postgres"."public"."my_first_dbt_model" +where id is null + + + + + ) dbt_internal_test +17:05:47.139130 [debug] [Thread-6 ]: SQL status: BEGIN in 0.19 seconds +17:05:47.139194 [debug] [Thread-6 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +17:05:47.139242 [debug] [Thread-6 ]: On test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select gameid +from "postgres"."public"."wins_losses" +where gameid is null + + + + + ) dbt_internal_test +17:05:47.142097 [debug] [Thread-4 ]: SQL status: BEGIN in 0.19 seconds +17:05:47.142154 [debug] [Thread-4 ]: Using postgres connection "test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427" +17:05:47.142202 [debug] [Thread-4 ]: On test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select player_id +from "postgres"."public"."number_played_against" +where player_id is null + + + + + ) dbt_internal_test +17:05:47.145787 [debug] [Thread-5 ]: SQL status: BEGIN in 0.2 seconds +17:05:47.146365 [debug] [Thread-5 ]: Using postgres connection "test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073" +17:05:47.146538 [debug] [Thread-5 ]: On test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select season_id +from "postgres"."public"."number_played_against" +where season_id is null + + + + + ) dbt_internal_test +17:05:47.148913 [debug] [Thread-9 ]: SQL status: BEGIN in 0.2 seconds +17:05:47.149925 [debug] [Thread-9 ]: Using postgres connection "test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20" +17:05:47.150176 [debug] [Thread-9 ]: On test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + +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 + + + + ) dbt_internal_test +17:05:47.155762 [debug] [Thread-7 ]: SQL status: BEGIN in 0.21 seconds +17:05:47.155905 [debug] [Thread-7 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +17:05:47.155963 [debug] [Thread-7 ]: On test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select player_id +from "postgres"."public"."wins_losses" +where player_id is null + + + + + ) dbt_internal_test +17:05:47.156942 [debug] [Thread-1 ]: SQL status: SELECT 1 in 0.02 seconds +17:05:47.158579 [debug] [Thread-1 ]: finished collecting timing info +17:05:47.158729 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710: ROLLBACK +17:05:47.159541 [debug] [Thread-2 ]: SQL status: BEGIN in 0.21 seconds +17:05:47.159602 [debug] [Thread-2 ]: Using postgres connection "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +17:05:47.159653 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select id +from "postgres"."public"."my_second_dbt_model" +where id is null + + + + + ) dbt_internal_test +17:05:47.161476 [debug] [Thread-4 ]: Postgres adapter: Postgres error: relation "public.number_played_against" does not exist +LINE 14: from "postgres"."public"."number_played_against" + ^ + +17:05:47.162093 [debug] [Thread-4 ]: On test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427: ROLLBACK +17:05:47.164735 [debug] [Thread-3 ]: SQL status: BEGIN in 0.22 seconds +17:05:47.165197 [debug] [Thread-3 ]: Using postgres connection "test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c" +17:05:47.165364 [debug] [Thread-3 ]: On test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select num_played_against +from "postgres"."public"."number_played_against" +where num_played_against is null + + + + + ) dbt_internal_test +17:05:47.165678 [debug] [Thread-10 ]: SQL status: BEGIN in 0.22 seconds +17:05:47.165858 [debug] [Thread-10 ]: Using postgres connection "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe" +17:05:47.166187 [debug] [Thread-10 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + +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 + + + + ) dbt_internal_test +17:05:47.166633 [debug] [Thread-5 ]: Postgres adapter: Postgres error: relation "public.number_played_against" does not exist +LINE 14: from "postgres"."public"."number_played_against" + ^ + +17:05:47.167103 [debug] [Thread-5 ]: On test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073: ROLLBACK +17:05:47.167360 [debug] [Thread-8 ]: SQL status: BEGIN in 0.22 seconds +17:05:47.167534 [debug] [Thread-8 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +17:05:47.167683 [debug] [Thread-8 ]: On test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select seasonid +from "postgres"."public"."wins_losses" +where seasonid is null + + + + + ) dbt_internal_test +17:05:47.169250 [debug] [Thread-9 ]: Postgres adapter: Postgres error: relation "public.number_played_against" does not exist +LINE 14: from "postgres"."public"."number_played_against" + ^ + +17:05:47.169641 [debug] [Thread-9 ]: On test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20: ROLLBACK +17:05:47.177486 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710: Close +17:05:47.178221 [debug] [Thread-6 ]: SQL status: SELECT 1 in 0.04 seconds +17:05:47.180894 [debug] [Thread-6 ]: finished collecting timing info +17:05:47.181489 [debug] [Thread-6 ]: On test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1: ROLLBACK +17:05:47.182439 [info ] [Thread-1 ]: 1 of 13 PASS not_null_my_first_dbt_model_id .................................... [PASS in 0.29s] +17:05:47.182678 [debug] [Thread-4 ]: finished collecting timing info +17:05:47.182749 [debug] [Thread-2 ]: SQL status: SELECT 1 in 0.02 seconds +17:05:47.183009 [debug] [Thread-1 ]: Finished running node test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +17:05:47.183112 [debug] [Thread-4 ]: On test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427: Close +17:05:47.183773 [debug] [Thread-2 ]: finished collecting timing info +17:05:47.183899 [debug] [Thread-1 ]: Began running node test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77 +17:05:47.184122 [debug] [Thread-3 ]: Postgres adapter: Postgres error: relation "public.number_played_against" does not exist +LINE 14: from "postgres"."public"."number_played_against" + ^ + +17:05:47.184229 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778: ROLLBACK +17:05:47.184377 [debug] [Thread-4 ]: Database Error in test not_null_number_played_against_player_id (models/schema.yml) + relation "public.number_played_against" does not exist + LINE 14: from "postgres"."public"."number_played_against" + ^ + compiled SQL at target/run/wrkplay_dbt/models/schema.yml/not_null_number_played_against_player_id.sql +17:05:47.184485 [info ] [Thread-1 ]: 11 of 13 START test positive_test_wins_losses_total_wins ....................... [RUN] +17:05:47.184554 [debug] [Thread-3 ]: On test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c: ROLLBACK +17:05:47.184668 [error] [Thread-4 ]: 4 of 13 ERROR not_null_number_played_against_player_id ......................... [ERROR in 0.29s] +17:05:47.184880 [debug] [Thread-1 ]: Acquiring new postgres connection "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77" +17:05:47.185078 [debug] [Thread-1 ]: Began compiling node test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77 +17:05:47.185154 [debug] [Thread-1 ]: Compiling test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77 +17:05:47.187330 [debug] [Thread-1 ]: Writing injected SQL for node "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77" +17:05:47.187457 [debug] [Thread-4 ]: Finished running node test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427 +17:05:47.187565 [debug] [Thread-4 ]: Began running node test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +17:05:47.187638 [info ] [Thread-4 ]: 12 of 13 START test unique_my_first_dbt_model_id ............................... [RUN] +17:05:47.187802 [debug] [Thread-4 ]: Acquiring new postgres connection "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +17:05:47.187860 [debug] [Thread-4 ]: Began compiling node test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +17:05:47.187915 [debug] [Thread-4 ]: Compiling test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +17:05:47.190524 [debug] [Thread-4 ]: Writing injected SQL for node "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +17:05:47.190781 [debug] [Thread-1 ]: finished collecting timing info +17:05:47.190847 [debug] [Thread-1 ]: Began executing node test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77 +17:05:47.191521 [debug] [Thread-1 ]: Writing runtime SQL for node "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77" +17:05:47.191591 [debug] [Thread-4 ]: finished collecting timing info +17:05:47.191720 [debug] [Thread-5 ]: finished collecting timing info +17:05:47.191797 [debug] [Thread-9 ]: finished collecting timing info +17:05:47.191888 [debug] [Thread-4 ]: Began executing node test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +17:05:47.191959 [debug] [Thread-5 ]: On test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073: Close +17:05:47.192019 [debug] [Thread-1 ]: Using postgres connection "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77" +17:05:47.192081 [debug] [Thread-9 ]: On test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20: Close +17:05:47.192774 [debug] [Thread-4 ]: Writing runtime SQL for node "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +17:05:47.192866 [debug] [Thread-1 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77: BEGIN +17:05:47.193025 [debug] [Thread-5 ]: Database Error in test not_null_number_played_against_season_id (models/schema.yml) + relation "public.number_played_against" does not exist + LINE 14: from "postgres"."public"."number_played_against" + ^ + compiled SQL at target/run/wrkplay_dbt/models/schema.yml/not_null_number_played_against_season_id.sql +17:05:47.193203 [debug] [Thread-9 ]: Database Error in test positive_test_number_played_against_num_played_against (models/schema.yml) + relation "public.number_played_against" does not exist + LINE 14: from "postgres"."public"."number_played_against" + ^ + compiled SQL at target/run/wrkplay_dbt/models/schema.yml/positive_test_number_played_against_num_played_against.sql +17:05:47.193283 [debug] [Thread-1 ]: Opening a new connection, currently in state closed +17:05:47.193393 [error] [Thread-5 ]: 5 of 13 ERROR not_null_number_played_against_season_id ......................... [ERROR in 0.30s] +17:05:47.193469 [debug] [Thread-4 ]: Using postgres connection "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +17:05:47.193537 [error] [Thread-9 ]: 9 of 13 ERROR positive_test_number_played_against_num_played_against ........... [ERROR in 0.30s] +17:05:47.193770 [debug] [Thread-5 ]: Finished running node test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073 +17:05:47.193829 [debug] [Thread-4 ]: On test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321: BEGIN +17:05:47.193952 [debug] [Thread-9 ]: Finished running node test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20 +17:05:47.194026 [debug] [Thread-5 ]: Began running node test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +17:05:47.194081 [debug] [Thread-4 ]: Opening a new connection, currently in state closed +17:05:47.194220 [info ] [Thread-5 ]: 13 of 13 START test unique_my_second_dbt_model_id .............................. [RUN] +17:05:47.194463 [debug] [Thread-5 ]: Acquiring new postgres connection "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +17:05:47.194519 [debug] [Thread-5 ]: Began compiling node test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +17:05:47.194572 [debug] [Thread-5 ]: Compiling test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +17:05:47.196027 [debug] [Thread-5 ]: Writing injected SQL for node "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +17:05:47.196225 [debug] [Thread-5 ]: finished collecting timing info +17:05:47.196288 [debug] [Thread-5 ]: Began executing node test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +17:05:47.196990 [debug] [Thread-5 ]: Writing runtime SQL for node "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +17:05:47.197057 [debug] [Thread-7 ]: SQL status: SELECT 1 in 0.04 seconds +17:05:47.197710 [debug] [Thread-7 ]: finished collecting timing info +17:05:47.197783 [debug] [Thread-7 ]: On test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15: ROLLBACK +17:05:47.197913 [debug] [Thread-5 ]: Using postgres connection "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +17:05:47.197976 [debug] [Thread-5 ]: On test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493: BEGIN +17:05:47.198027 [debug] [Thread-5 ]: Opening a new connection, currently in state closed +17:05:47.199884 [debug] [Thread-6 ]: On test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1: Close +17:05:47.200074 [info ] [Thread-6 ]: 6 of 13 PASS not_null_wins_losses_gameid ....................................... [PASS in 0.31s] +17:05:47.200226 [debug] [Thread-6 ]: Finished running node test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +17:05:47.202770 [debug] [Thread-3 ]: finished collecting timing info +17:05:47.202848 [debug] [Thread-3 ]: On test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c: Close +17:05:47.203021 [debug] [Thread-3 ]: Database Error in test not_null_number_played_against_num_played_against (models/schema.yml) + relation "public.number_played_against" does not exist + LINE 14: from "postgres"."public"."number_played_against" + ^ + compiled SQL at target/run/wrkplay_dbt/models/schema.yml/not_null_number_played_against_num_played_against.sql +17:05:47.203106 [error] [Thread-3 ]: 3 of 13 ERROR not_null_number_played_against_num_played_against ................ [ERROR in 0.31s] +17:05:47.203237 [debug] [Thread-3 ]: Finished running node test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c +17:05:47.204680 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778: Close +17:05:47.204865 [info ] [Thread-2 ]: 2 of 13 PASS not_null_my_second_dbt_model_id ................................... [PASS in 0.31s] +17:05:47.205010 [debug] [Thread-2 ]: Finished running node test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +17:05:47.207299 [debug] [Thread-10 ]: SQL status: SELECT 1 in 0.04 seconds +17:05:47.207879 [debug] [Thread-10 ]: finished collecting timing info +17:05:47.207951 [debug] [Thread-10 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe: ROLLBACK +17:05:47.212428 [debug] [Thread-8 ]: SQL status: SELECT 1 in 0.04 seconds +17:05:47.212918 [debug] [Thread-8 ]: finished collecting timing info +17:05:47.212982 [debug] [Thread-8 ]: On test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813: ROLLBACK +17:05:47.215163 [debug] [Thread-7 ]: On test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15: Close +17:05:47.215424 [info ] [Thread-7 ]: 7 of 13 PASS not_null_wins_losses_player_id .................................... [PASS in 0.32s] +17:05:47.215590 [debug] [Thread-7 ]: Finished running node test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +17:05:47.228273 [debug] [Thread-10 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe: Close +17:05:47.228657 [info ] [Thread-10 ]: 10 of 13 PASS positive_test_wins_losses_total_losses ........................... [PASS in 0.34s] +17:05:47.228867 [debug] [Thread-10 ]: Finished running node test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe +17:05:47.233462 [debug] [Thread-8 ]: On test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813: Close +17:05:47.233758 [info ] [Thread-8 ]: 8 of 13 PASS not_null_wins_losses_seasonid ..................................... [PASS in 0.34s] +17:05:47.233941 [debug] [Thread-8 ]: Finished running node test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +17:05:47.381992 [debug] [Thread-4 ]: SQL status: BEGIN in 0.19 seconds +17:05:47.382657 [debug] [Thread-5 ]: SQL status: BEGIN in 0.18 seconds +17:05:47.383119 [debug] [Thread-4 ]: Using postgres connection "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +17:05:47.383433 [debug] [Thread-5 ]: Using postgres connection "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +17:05:47.383641 [debug] [Thread-4 ]: On test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + +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 + + + + + ) dbt_internal_test +17:05:47.384143 [debug] [Thread-1 ]: SQL status: BEGIN in 0.19 seconds +17:05:47.383817 [debug] [Thread-5 ]: On test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + +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 + + + + + ) dbt_internal_test +17:05:47.384352 [debug] [Thread-1 ]: Using postgres connection "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77" +17:05:47.384592 [debug] [Thread-1 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + +with validation as ( + + select + total_wins 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 + + + + ) dbt_internal_test +17:05:47.402537 [debug] [Thread-4 ]: SQL status: SELECT 1 in 0.02 seconds +17:05:47.405664 [debug] [Thread-4 ]: finished collecting timing info +17:05:47.405974 [debug] [Thread-4 ]: On test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321: ROLLBACK +17:05:47.406324 [debug] [Thread-5 ]: SQL status: SELECT 1 in 0.02 seconds +17:05:47.407454 [debug] [Thread-5 ]: finished collecting timing info +17:05:47.407573 [debug] [Thread-5 ]: On test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493: ROLLBACK +17:05:47.417644 [debug] [Thread-1 ]: SQL status: SELECT 1 in 0.03 seconds +17:05:47.419724 [debug] [Thread-1 ]: finished collecting timing info +17:05:47.420005 [debug] [Thread-1 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77: ROLLBACK +17:05:47.423556 [debug] [Thread-5 ]: On test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493: Close +17:05:47.424289 [debug] [Thread-4 ]: On test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321: Close +17:05:47.424893 [info ] [Thread-5 ]: 13 of 13 PASS unique_my_second_dbt_model_id .................................... [PASS in 0.23s] +17:05:47.425249 [info ] [Thread-4 ]: 12 of 13 PASS unique_my_first_dbt_model_id ..................................... [PASS in 0.24s] +17:05:47.425814 [debug] [Thread-5 ]: Finished running node test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +17:05:47.426431 [debug] [Thread-4 ]: Finished running node test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +17:05:47.437504 [debug] [Thread-1 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77: Close +17:05:47.439175 [info ] [Thread-1 ]: 11 of 13 PASS positive_test_wins_losses_total_wins ............................. [PASS in 0.25s] +17:05:47.439822 [debug] [Thread-1 ]: Finished running node test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77 +17:05:47.441597 [debug] [MainThread]: Acquiring new postgres connection "master" +17:05:47.441937 [debug] [MainThread]: Using postgres connection "master" +17:05:47.442290 [debug] [MainThread]: On master: BEGIN +17:05:47.442406 [debug] [MainThread]: Opening a new connection, currently in state closed +17:05:47.626250 [debug] [MainThread]: SQL status: BEGIN in 0.18 seconds +17:05:47.627588 [debug] [MainThread]: On master: COMMIT +17:05:47.627904 [debug] [MainThread]: Using postgres connection "master" +17:05:47.628177 [debug] [MainThread]: On master: COMMIT +17:05:47.646928 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +17:05:47.648294 [debug] [MainThread]: On master: Close +17:05:47.651059 [info ] [MainThread]: +17:05:47.651362 [info ] [MainThread]: Finished running 13 tests in 1.52s. +17:05:47.651482 [debug] [MainThread]: Connection 'master' was properly closed. +17:05:47.651586 [debug] [MainThread]: Connection 'test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77' was properly closed. +17:05:47.651638 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778' was properly closed. +17:05:47.651694 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c' was properly closed. +17:05:47.651742 [debug] [MainThread]: Connection 'test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321' was properly closed. +17:05:47.651786 [debug] [MainThread]: Connection 'test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493' was properly closed. +17:05:47.651830 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1' was properly closed. +17:05:47.651874 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15' was properly closed. +17:05:47.651919 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813' was properly closed. +17:05:47.651963 [debug] [MainThread]: Connection 'test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20' was properly closed. +17:05:47.652009 [debug] [MainThread]: Connection 'test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe' was properly closed. +17:05:47.656644 [info ] [MainThread]: +17:05:47.656797 [info ] [MainThread]: Completed with 4 errors and 0 warnings: +17:05:47.656927 [info ] [MainThread]: +17:05:47.657020 [error] [MainThread]: Database Error in test not_null_number_played_against_player_id (models/schema.yml) +17:05:47.657110 [error] [MainThread]: relation "public.number_played_against" does not exist +17:05:47.657193 [error] [MainThread]: LINE 14: from "postgres"."public"."number_played_against" +17:05:47.657274 [error] [MainThread]: ^ +17:05:47.657356 [error] [MainThread]: compiled SQL at target/run/wrkplay_dbt/models/schema.yml/not_null_number_played_against_player_id.sql +17:05:47.657440 [info ] [MainThread]: +17:05:47.657522 [error] [MainThread]: Database Error in test not_null_number_played_against_season_id (models/schema.yml) +17:05:47.657602 [error] [MainThread]: relation "public.number_played_against" does not exist +17:05:47.657681 [error] [MainThread]: LINE 14: from "postgres"."public"."number_played_against" +17:05:47.657758 [error] [MainThread]: ^ +17:05:47.657836 [error] [MainThread]: compiled SQL at target/run/wrkplay_dbt/models/schema.yml/not_null_number_played_against_season_id.sql +17:05:47.657914 [info ] [MainThread]: +17:05:47.657995 [error] [MainThread]: Database Error in test positive_test_number_played_against_num_played_against (models/schema.yml) +17:05:47.658077 [error] [MainThread]: relation "public.number_played_against" does not exist +17:05:47.658154 [error] [MainThread]: LINE 14: from "postgres"."public"."number_played_against" +17:05:47.658231 [error] [MainThread]: ^ +17:05:47.658309 [error] [MainThread]: compiled SQL at target/run/wrkplay_dbt/models/schema.yml/positive_test_number_played_against_num_played_against.sql +17:05:47.658388 [info ] [MainThread]: +17:05:47.658469 [error] [MainThread]: Database Error in test not_null_number_played_against_num_played_against (models/schema.yml) +17:05:47.658546 [error] [MainThread]: relation "public.number_played_against" does not exist +17:05:47.658624 [error] [MainThread]: LINE 14: from "postgres"."public"."number_played_against" +17:05:47.658701 [error] [MainThread]: ^ +17:05:47.658778 [error] [MainThread]: compiled SQL at target/run/wrkplay_dbt/models/schema.yml/not_null_number_played_against_num_played_against.sql +17:05:47.658867 [info ] [MainThread]: +17:05:47.658953 [info ] [MainThread]: Done. PASS=9 WARN=0 ERROR=4 SKIP=0 TOTAL=13 +17:05:47.659087 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [, , ]} + + +============================== 2022-07-08 17:06:03.663652 | 0cef9c6d-0461-4011-94ac-a41eb6aa48dd ============================== +17:06:03.663670 [info ] [MainThread]: Running with dbt=1.1.1 +17:06:03.664183 [debug] [MainThread]: running dbt with arguments {'write_json': True, 'use_colors': True, 'printer_width': 80, 'version_check': True, 'partial_parse': True, 'static_parser': True, 'profiles_dir': '/Users/bruno.campos/.dbt', 'send_anonymous_usage_stats': True, 'event_buffer_size': 100000, 'quiet': False, 'no_print': False, 'which': 'run', 'rpc_method': 'run', 'indirect_selection': 'eager'} +17:06:03.664263 [debug] [MainThread]: Tracking: tracking +17:06:03.679175 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [, , ]} +17:06:03.698085 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 0 files changed. +17:06:03.698192 [debug] [MainThread]: Partial parsing enabled, no changes found, skipping parsing +17:06:03.701582 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '0cef9c6d-0461-4011-94ac-a41eb6aa48dd', 'context': []} +17:06:03.704447 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '0cef9c6d-0461-4011-94ac-a41eb6aa48dd', 'context': []} +17:06:03.704579 [info ] [MainThread]: Found 4 models, 13 tests, 0 snapshots, 0 analyses, 168 macros, 0 operations, 0 seed files, 0 sources, 0 exposures, 0 metrics +17:06:03.704701 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '0cef9c6d-0461-4011-94ac-a41eb6aa48dd', 'context': []} +17:06:03.705460 [info ] [MainThread]: +17:06:03.705657 [debug] [MainThread]: Acquiring new postgres connection "master" +17:06:03.706065 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres" +17:06:03.710379 [debug] [ThreadPool]: Using postgres connection "list_postgres" +17:06:03.710462 [debug] [ThreadPool]: On list_postgres: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres"} */ + + select distinct nspname from pg_namespace + +17:06:03.710524 [debug] [ThreadPool]: Opening a new connection, currently in state init +17:06:03.914099 [debug] [ThreadPool]: SQL status: SELECT 10 in 0.2 seconds +17:06:03.915595 [debug] [ThreadPool]: On list_postgres: Close +17:06:03.916508 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres_public" +17:06:03.919619 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +17:06:03.919704 [debug] [ThreadPool]: On list_postgres_public: BEGIN +17:06:03.919765 [debug] [ThreadPool]: Opening a new connection, currently in state closed +17:06:04.119329 [debug] [ThreadPool]: SQL status: BEGIN in 0.2 seconds +17:06:04.120231 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +17:06:04.121086 [debug] [ThreadPool]: On list_postgres_public: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres_public"} */ +select + 'postgres' as database, + tablename as name, + schemaname as schema, + 'table' as type + from pg_tables + where schemaname ilike 'public' + union all + select + 'postgres' as database, + viewname as name, + schemaname as schema, + 'view' as type + from pg_views + where schemaname ilike 'public' + +17:06:04.145124 [debug] [ThreadPool]: SQL status: SELECT 19 in 0.02 seconds +17:06:04.149533 [debug] [ThreadPool]: On list_postgres_public: ROLLBACK +17:06:04.168568 [debug] [ThreadPool]: On list_postgres_public: Close +17:06:04.174667 [debug] [MainThread]: Using postgres connection "master" +17:06:04.174836 [debug] [MainThread]: On master: BEGIN +17:06:04.174898 [debug] [MainThread]: Opening a new connection, currently in state init +17:06:04.351304 [debug] [MainThread]: SQL status: BEGIN in 0.18 seconds +17:06:04.352142 [debug] [MainThread]: Using postgres connection "master" +17:06:04.352340 [debug] [MainThread]: On master: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "master"} */ +with relation as ( + select + pg_rewrite.ev_class as class, + pg_rewrite.oid as id + from pg_rewrite + ), + class as ( + select + oid as id, + relname as name, + relnamespace as schema, + relkind as kind + from pg_class + ), + dependency as ( + select distinct + pg_depend.objid as id, + pg_depend.refobjid as ref + from pg_depend + ), + schema as ( + select + pg_namespace.oid as id, + pg_namespace.nspname as name + from pg_namespace + where nspname != 'information_schema' and nspname not like 'pg\_%' + ), + referenced as ( + select + relation.id AS id, + referenced_class.name , + referenced_class.schema , + referenced_class.kind + from relation + join class as referenced_class on relation.class=referenced_class.id + where referenced_class.kind in ('r', 'v') + ), + relationships as ( + select + referenced.name as referenced_name, + referenced.schema as referenced_schema_id, + dependent_class.name as dependent_name, + dependent_class.schema as dependent_schema_id, + referenced.kind as kind + from referenced + join dependency on referenced.id=dependency.id + join class as dependent_class on dependency.ref=dependent_class.id + where + (referenced.name != dependent_class.name or + referenced.schema != dependent_class.schema) + ) + + select + referenced_schema.name as referenced_schema, + relationships.referenced_name as referenced_name, + dependent_schema.name as dependent_schema, + relationships.dependent_name as dependent_name + from relationships + join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id + join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id + group by referenced_schema, referenced_name, dependent_schema, dependent_name + order by referenced_schema, referenced_name, dependent_schema, dependent_name; +17:06:04.526271 [debug] [MainThread]: SQL status: SELECT 4 in 0.17 seconds +17:06:04.528782 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '0cef9c6d-0461-4011-94ac-a41eb6aa48dd', 'context': []} +17:06:04.529303 [debug] [MainThread]: On master: ROLLBACK +17:06:04.547281 [debug] [MainThread]: Using postgres connection "master" +17:06:04.547746 [debug] [MainThread]: On master: BEGIN +17:06:04.581950 [debug] [MainThread]: SQL status: BEGIN in 0.03 seconds +17:06:04.582407 [debug] [MainThread]: On master: COMMIT +17:06:04.582587 [debug] [MainThread]: Using postgres connection "master" +17:06:04.582748 [debug] [MainThread]: On master: COMMIT +17:06:04.601703 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +17:06:04.602212 [debug] [MainThread]: On master: Close +17:06:04.602977 [info ] [MainThread]: Concurrency: 10 threads (target='dev') +17:06:04.603353 [info ] [MainThread]: +17:06:04.607934 [debug] [Thread-1 ]: Began running node model.wrkplay_dbt.my_first_dbt_model +17:06:04.608043 [debug] [Thread-2 ]: Began running node model.wrkplay_dbt.number_played_against +17:06:04.608112 [debug] [Thread-3 ]: Began running node model.wrkplay_dbt.wins_losses +17:06:04.608288 [info ] [Thread-1 ]: 1 of 4 START view model public.my_first_dbt_model .............................. [RUN] +17:06:04.608423 [info ] [Thread-2 ]: 2 of 4 START view model public.number_played_against ........................... [RUN] +17:06:04.608522 [info ] [Thread-3 ]: 3 of 4 START view model public.wins_losses ..................................... [RUN] +17:06:04.608800 [debug] [Thread-1 ]: Acquiring new postgres connection "model.wrkplay_dbt.my_first_dbt_model" +17:06:04.609008 [debug] [Thread-2 ]: Acquiring new postgres connection "model.wrkplay_dbt.number_played_against" +17:06:04.609208 [debug] [Thread-3 ]: Acquiring new postgres connection "model.wrkplay_dbt.wins_losses" +17:06:04.609284 [debug] [Thread-1 ]: Began compiling node model.wrkplay_dbt.my_first_dbt_model +17:06:04.609353 [debug] [Thread-2 ]: Began compiling node model.wrkplay_dbt.number_played_against +17:06:04.609412 [debug] [Thread-3 ]: Began compiling node model.wrkplay_dbt.wins_losses +17:06:04.609528 [debug] [Thread-1 ]: Compiling model.wrkplay_dbt.my_first_dbt_model +17:06:04.609587 [debug] [Thread-2 ]: Compiling model.wrkplay_dbt.number_played_against +17:06:04.609648 [debug] [Thread-3 ]: Compiling model.wrkplay_dbt.wins_losses +17:06:04.611009 [debug] [Thread-1 ]: Writing injected SQL for node "model.wrkplay_dbt.my_first_dbt_model" +17:06:04.611582 [debug] [Thread-2 ]: Writing injected SQL for node "model.wrkplay_dbt.number_played_against" +17:06:04.612210 [debug] [Thread-3 ]: Writing injected SQL for node "model.wrkplay_dbt.wins_losses" +17:06:04.612765 [debug] [Thread-1 ]: finished collecting timing info +17:06:04.612820 [debug] [Thread-3 ]: finished collecting timing info +17:06:04.612869 [debug] [Thread-2 ]: finished collecting timing info +17:06:04.612940 [debug] [Thread-1 ]: Began executing node model.wrkplay_dbt.my_first_dbt_model +17:06:04.613015 [debug] [Thread-3 ]: Began executing node model.wrkplay_dbt.wins_losses +17:06:04.613076 [debug] [Thread-2 ]: Began executing node model.wrkplay_dbt.number_played_against +17:06:04.624657 [debug] [Thread-1 ]: Writing runtime SQL for node "model.wrkplay_dbt.my_first_dbt_model" +17:06:04.625914 [debug] [Thread-3 ]: Writing runtime SQL for node "model.wrkplay_dbt.wins_losses" +17:06:04.626943 [debug] [Thread-2 ]: Writing runtime SQL for node "model.wrkplay_dbt.number_played_against" +17:06:04.627325 [debug] [Thread-3 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +17:06:04.627408 [debug] [Thread-3 ]: On model.wrkplay_dbt.wins_losses: BEGIN +17:06:04.627493 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +17:06:04.627555 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.number_played_against" +17:06:04.627745 [debug] [Thread-2 ]: On model.wrkplay_dbt.number_played_against: BEGIN +17:06:04.627684 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: BEGIN +17:06:04.627615 [debug] [Thread-3 ]: Opening a new connection, currently in state init +17:06:04.627800 [debug] [Thread-2 ]: Opening a new connection, currently in state init +17:06:04.627857 [debug] [Thread-1 ]: Opening a new connection, currently in state closed +17:06:04.810051 [debug] [Thread-1 ]: SQL status: BEGIN in 0.18 seconds +17:06:04.810936 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +17:06:04.811626 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ + + create view "postgres"."public"."my_first_dbt_model__dbt_tmp" as ( + /* + 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 + ); +17:06:04.814507 [debug] [Thread-3 ]: SQL status: BEGIN in 0.19 seconds +17:06:04.815220 [debug] [Thread-3 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +17:06:04.815399 [debug] [Thread-3 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ + + create view "postgres"."public"."wins_losses__dbt_tmp" as ( + --number of wins and losses per player per game (per office) per season +WITH loss_table AS ( + SELECT + SUM(lt.left_losses) AS "total_losses" + , lt.left_player_id AS "loss_player_id" + , lt.gameid + , lt.seasonid + FROM + ( + SELECT + * + FROM + ( + --Begin DONE + WITH left_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore > m.rightscore THEN 0 + ELSE 1 + END) AS "left_loss" + , l."A" + , l."B" + , m."gameid" + , m."seasonid" + FROM + "_left" l + JOIN "Match" m ON + l."A" = m.id + GROUP BY + l."A" + , l."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.left_loss) AS "left_losses" + , a."B" AS "left_player_id" + , a."gameid" + , a."seasonid" + FROM + left_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + --End DONE + ) ll + UNION ALL + SELECT + * + FROM + ( + --Begin DONE + WITH right_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore < m.rightscore THEN 0 + ELSE 1 + END) AS "right_loss" + , r."A" + , r."B" + , m."gameid" + , m."seasonid" + FROM + "_right" r + JOIN "Match" m ON + r."A" = m.id + GROUP BY + r."A" + , r."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.right_loss) AS "right_losses" + , a."B" AS "right_player_id" + , a."gameid" + , a."seasonid" + FROM + right_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + --End DONE + ) rl + ) lt + -- WHERE lt.left_player_id = '' + GROUP BY + lt.left_player_id + , lt.gameid + , lt.seasonid +) +, +win_table AS ( + --number of wins for a player and gameid + SELECT + SUM(rt.right_wins) AS "total_wins" + , rt.right_player_id AS "win_player_id" + , rt.gameid + , rt."seasonid" + FROM + ( + SELECT + * + FROM + ( + WITH right_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore < m.rightscore THEN 1 + ELSE 0 + END) AS "right_won" + , r."A" + , r."B" + , m."gameid" + , m."seasonid" + FROM + "_right" r + JOIN "Match" m ON + r."A" = m.id + GROUP BY + r."A" + , r."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.right_won) AS "right_wins" + , a."B" AS "right_player_id" + , a."gameid" + , a."seasonid" + FROM + right_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + ) rw + UNION ALL + SELECT + * + FROM + ( + WITH left_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore > m.rightscore THEN 1 + ELSE 0 + END) AS "left_won" + , l."A" + , l."B" + , m."gameid" + , m."seasonid" + FROM + "_left" l + JOIN "Match" m ON + l."A" = m.id + GROUP BY + l."A" + , l."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.left_won) AS "left_wins" + , a."B" AS "left_player_id" + , a."gameid" + , a."seasonid" + FROM + left_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + ) lw + ) rt + -- WHERE rt.right_player_id = '' + GROUP BY + rt.right_player_id + , rt.gameid + , rt."seasonid" +) +SELECT + COALESCE(lt.loss_player_id, wt.win_player_id) AS "player_id" + , COALESCE(lt."gameid", wt."gameid") AS "gameid" + , COALESCE(lt.seasonid, wt.seasonid) AS "seasonid" + , wt."total_wins" + , lt."total_losses" +FROM + loss_table lt +FULL OUTER JOIN win_table wt ON + lt."loss_player_id" = wt."win_player_id" + AND lt."gameid" = wt."gameid" + AND lt."seasonid" = wt."seasonid" + ); +17:06:04.821928 [debug] [Thread-2 ]: SQL status: BEGIN in 0.19 seconds +17:06:04.822749 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.number_played_against" +17:06:04.822981 [debug] [Thread-2 ]: On model.wrkplay_dbt.number_played_against: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.number_played_against"} */ + + create view "postgres"."public"."number_played_against__dbt_tmp" as ( + -- 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" + ); +17:06:04.832674 [debug] [Thread-1 ]: SQL status: CREATE VIEW in 0.02 seconds +17:06:04.839942 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +17:06:04.840134 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ +alter table "postgres"."public"."my_first_dbt_model" rename to "my_first_dbt_model__dbt_backup" +17:06:04.845781 [debug] [Thread-3 ]: SQL status: CREATE VIEW in 0.03 seconds +17:06:04.846866 [debug] [Thread-3 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +17:06:04.846944 [debug] [Thread-3 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ +alter table "postgres"."public"."wins_losses" rename to "wins_losses__dbt_backup" +17:06:04.847167 [debug] [Thread-2 ]: SQL status: CREATE VIEW in 0.02 seconds +17:06:04.848002 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.number_played_against" +17:06:04.848077 [debug] [Thread-2 ]: On model.wrkplay_dbt.number_played_against: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.number_played_against"} */ +alter table "postgres"."public"."number_played_against__dbt_tmp" rename to "number_played_against" +17:06:04.857982 [debug] [Thread-1 ]: SQL status: ALTER TABLE in 0.02 seconds +17:06:04.861153 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +17:06:04.861531 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ +alter table "postgres"."public"."my_first_dbt_model__dbt_tmp" rename to "my_first_dbt_model" +17:06:04.868511 [debug] [Thread-3 ]: SQL status: ALTER TABLE in 0.02 seconds +17:06:04.868720 [debug] [Thread-2 ]: SQL status: ALTER TABLE in 0.02 seconds +17:06:04.871831 [debug] [Thread-3 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +17:06:04.875276 [debug] [Thread-2 ]: On model.wrkplay_dbt.number_played_against: COMMIT +17:06:04.875413 [debug] [Thread-3 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ +alter table "postgres"."public"."wins_losses__dbt_tmp" rename to "wins_losses" +17:06:04.875482 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.number_played_against" +17:06:04.875579 [debug] [Thread-2 ]: On model.wrkplay_dbt.number_played_against: COMMIT +17:06:04.880193 [debug] [Thread-1 ]: SQL status: ALTER TABLE in 0.02 seconds +17:06:04.880687 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: COMMIT +17:06:04.880750 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +17:06:04.880801 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: COMMIT +17:06:04.894488 [debug] [Thread-3 ]: SQL status: ALTER TABLE in 0.02 seconds +17:06:04.896520 [debug] [Thread-3 ]: On model.wrkplay_dbt.wins_losses: COMMIT +17:06:04.896834 [debug] [Thread-3 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +17:06:04.896998 [debug] [Thread-3 ]: On model.wrkplay_dbt.wins_losses: COMMIT +17:06:04.897243 [debug] [Thread-2 ]: SQL status: COMMIT in 0.02 seconds +17:06:04.903203 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.number_played_against" +17:06:04.903305 [debug] [Thread-1 ]: SQL status: COMMIT in 0.02 seconds +17:06:04.903364 [debug] [Thread-2 ]: On model.wrkplay_dbt.number_played_against: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.number_played_against"} */ +drop view if exists "postgres"."public"."number_played_against__dbt_backup" cascade +17:06:04.904185 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.my_first_dbt_model" +17:06:04.904323 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_first_dbt_model"} */ +drop view if exists "postgres"."public"."my_first_dbt_model__dbt_backup" cascade +17:06:04.916053 [debug] [Thread-3 ]: SQL status: COMMIT in 0.02 seconds +17:06:04.918470 [debug] [Thread-3 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +17:06:04.918753 [debug] [Thread-3 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ +drop view if exists "postgres"."public"."wins_losses__dbt_backup" cascade +17:06:04.932151 [debug] [Thread-1 ]: SQL status: DROP VIEW in 0.03 seconds +17:06:04.932514 [debug] [Thread-2 ]: SQL status: DROP VIEW in 0.03 seconds +17:06:04.935505 [debug] [Thread-1 ]: finished collecting timing info +17:06:04.938670 [debug] [Thread-2 ]: finished collecting timing info +17:06:04.939301 [debug] [Thread-1 ]: On model.wrkplay_dbt.my_first_dbt_model: Close +17:06:04.939450 [debug] [Thread-2 ]: On model.wrkplay_dbt.number_played_against: Close +17:06:04.939855 [debug] [Thread-2 ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '0cef9c6d-0461-4011-94ac-a41eb6aa48dd', 'context': []} +17:06:04.940098 [info ] [Thread-2 ]: 2 of 4 OK created view model public.number_played_against ...................... [CREATE VIEW in 0.33s] +17:06:04.940376 [debug] [Thread-2 ]: Finished running node model.wrkplay_dbt.number_played_against +17:06:04.940636 [debug] [Thread-1 ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '0cef9c6d-0461-4011-94ac-a41eb6aa48dd', 'context': []} +17:06:04.940758 [info ] [Thread-1 ]: 1 of 4 OK created view model public.my_first_dbt_model ......................... [CREATE VIEW in 0.33s] +17:06:04.940898 [debug] [Thread-1 ]: Finished running node model.wrkplay_dbt.my_first_dbt_model +17:06:04.941093 [debug] [Thread-5 ]: Began running node model.wrkplay_dbt.my_second_dbt_model +17:06:04.941198 [info ] [Thread-5 ]: 4 of 4 START view model public.my_second_dbt_model ............................. [RUN] +17:06:04.941380 [debug] [Thread-5 ]: Acquiring new postgres connection "model.wrkplay_dbt.my_second_dbt_model" +17:06:04.941449 [debug] [Thread-5 ]: Began compiling node model.wrkplay_dbt.my_second_dbt_model +17:06:04.941525 [debug] [Thread-5 ]: Compiling model.wrkplay_dbt.my_second_dbt_model +17:06:04.942789 [debug] [Thread-5 ]: Writing injected SQL for node "model.wrkplay_dbt.my_second_dbt_model" +17:06:04.943251 [debug] [Thread-5 ]: finished collecting timing info +17:06:04.943318 [debug] [Thread-5 ]: Began executing node model.wrkplay_dbt.my_second_dbt_model +17:06:04.944608 [debug] [Thread-5 ]: Writing runtime SQL for node "model.wrkplay_dbt.my_second_dbt_model" +17:06:04.944836 [debug] [Thread-5 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +17:06:04.944894 [debug] [Thread-5 ]: On model.wrkplay_dbt.my_second_dbt_model: BEGIN +17:06:04.944946 [debug] [Thread-5 ]: Opening a new connection, currently in state init +17:06:04.948851 [debug] [Thread-3 ]: SQL status: DROP VIEW in 0.03 seconds +17:06:04.949325 [debug] [Thread-3 ]: finished collecting timing info +17:06:04.949396 [debug] [Thread-3 ]: On model.wrkplay_dbt.wins_losses: Close +17:06:04.949599 [debug] [Thread-3 ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '0cef9c6d-0461-4011-94ac-a41eb6aa48dd', 'context': []} +17:06:04.949726 [info ] [Thread-3 ]: 3 of 4 OK created view model public.wins_losses ................................ [CREATE VIEW in 0.34s] +17:06:04.949881 [debug] [Thread-3 ]: Finished running node model.wrkplay_dbt.wins_losses +17:06:05.152596 [debug] [Thread-5 ]: SQL status: BEGIN in 0.21 seconds +17:06:05.153196 [debug] [Thread-5 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +17:06:05.153454 [debug] [Thread-5 ]: On model.wrkplay_dbt.my_second_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_second_dbt_model"} */ + + create view "postgres"."public"."my_second_dbt_model__dbt_tmp" as ( + -- Use the `ref` function to select from other models + +select * +from "postgres"."public"."my_first_dbt_model" +where id = 1 + ); +17:06:05.174640 [debug] [Thread-5 ]: SQL status: CREATE VIEW in 0.02 seconds +17:06:05.180346 [debug] [Thread-5 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +17:06:05.180514 [debug] [Thread-5 ]: On model.wrkplay_dbt.my_second_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_second_dbt_model"} */ +alter table "postgres"."public"."my_second_dbt_model__dbt_tmp" rename to "my_second_dbt_model" +17:06:05.198997 [debug] [Thread-5 ]: SQL status: ALTER TABLE in 0.02 seconds +17:06:05.201885 [debug] [Thread-5 ]: On model.wrkplay_dbt.my_second_dbt_model: COMMIT +17:06:05.202213 [debug] [Thread-5 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +17:06:05.202630 [debug] [Thread-5 ]: On model.wrkplay_dbt.my_second_dbt_model: COMMIT +17:06:05.222363 [debug] [Thread-5 ]: SQL status: COMMIT in 0.02 seconds +17:06:05.252333 [debug] [Thread-5 ]: Using postgres connection "model.wrkplay_dbt.my_second_dbt_model" +17:06:05.252520 [debug] [Thread-5 ]: On model.wrkplay_dbt.my_second_dbt_model: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.my_second_dbt_model"} */ +drop view if exists "postgres"."public"."my_second_dbt_model__dbt_backup" cascade +17:06:05.270319 [debug] [Thread-5 ]: SQL status: DROP VIEW in 0.02 seconds +17:06:05.271071 [debug] [Thread-5 ]: finished collecting timing info +17:06:05.288918 [debug] [Thread-5 ]: On model.wrkplay_dbt.my_second_dbt_model: Close +17:06:05.289298 [debug] [Thread-5 ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '0cef9c6d-0461-4011-94ac-a41eb6aa48dd', 'context': []} +17:06:05.289853 [info ] [Thread-5 ]: 4 of 4 OK created view model public.my_second_dbt_model ........................ [CREATE VIEW in 0.35s] +17:06:05.290047 [debug] [Thread-5 ]: Finished running node model.wrkplay_dbt.my_second_dbt_model +17:06:05.290720 [debug] [MainThread]: Acquiring new postgres connection "master" +17:06:05.290820 [debug] [MainThread]: Using postgres connection "master" +17:06:05.290878 [debug] [MainThread]: On master: BEGIN +17:06:05.290929 [debug] [MainThread]: Opening a new connection, currently in state closed +17:06:05.484680 [debug] [MainThread]: SQL status: BEGIN in 0.19 seconds +17:06:05.485891 [debug] [MainThread]: On master: COMMIT +17:06:05.486283 [debug] [MainThread]: Using postgres connection "master" +17:06:05.486637 [debug] [MainThread]: On master: COMMIT +17:06:05.507289 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +17:06:05.508187 [debug] [MainThread]: On master: Close +17:06:05.510208 [info ] [MainThread]: +17:06:05.510727 [info ] [MainThread]: Finished running 4 view models in 1.80s. +17:06:05.511221 [debug] [MainThread]: Connection 'master' was properly closed. +17:06:05.511293 [debug] [MainThread]: Connection 'model.wrkplay_dbt.my_first_dbt_model' was properly closed. +17:06:05.511345 [debug] [MainThread]: Connection 'model.wrkplay_dbt.number_played_against' was properly closed. +17:06:05.511393 [debug] [MainThread]: Connection 'model.wrkplay_dbt.wins_losses' was properly closed. +17:06:05.511440 [debug] [MainThread]: Connection 'model.wrkplay_dbt.my_second_dbt_model' was properly closed. +17:06:05.515967 [info ] [MainThread]: +17:06:05.516094 [info ] [MainThread]: Completed successfully +17:06:05.516211 [info ] [MainThread]: +17:06:05.516298 [info ] [MainThread]: Done. PASS=4 WARN=0 ERROR=0 SKIP=0 TOTAL=4 +17:06:05.516461 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [, , ]} + + +============================== 2022-07-08 17:06:24.181541 | 9ef5d166-fa36-4c6c-a92a-178af698cc53 ============================== +17:06:24.181565 [info ] [MainThread]: Running with dbt=1.1.1 +17:06:24.182135 [debug] [MainThread]: running dbt with arguments {'write_json': True, 'use_colors': True, 'printer_width': 80, 'version_check': True, 'partial_parse': True, 'static_parser': True, 'profiles_dir': '/Users/bruno.campos/.dbt', 'send_anonymous_usage_stats': True, 'event_buffer_size': 100000, 'quiet': False, 'no_print': False, 'indirect_selection': 'eager', 'which': 'test', 'rpc_method': 'test'} +17:06:24.182211 [debug] [MainThread]: Tracking: tracking +17:06:24.201045 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [, , ]} +17:06:24.219331 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 0 files changed. +17:06:24.219448 [debug] [MainThread]: Partial parsing enabled, no changes found, skipping parsing +17:06:24.222806 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '9ef5d166-fa36-4c6c-a92a-178af698cc53', 'context': []} +17:06:24.225914 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '9ef5d166-fa36-4c6c-a92a-178af698cc53', 'context': []} +17:06:24.226049 [info ] [MainThread]: Found 4 models, 13 tests, 0 snapshots, 0 analyses, 168 macros, 0 operations, 0 seed files, 0 sources, 0 exposures, 0 metrics +17:06:24.226179 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '9ef5d166-fa36-4c6c-a92a-178af698cc53', 'context': []} +17:06:24.227088 [info ] [MainThread]: +17:06:24.227293 [debug] [MainThread]: Acquiring new postgres connection "master" +17:06:24.227764 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres_public" +17:06:24.232472 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +17:06:24.232646 [debug] [ThreadPool]: On list_postgres_public: BEGIN +17:06:24.232722 [debug] [ThreadPool]: Opening a new connection, currently in state init +17:06:24.435445 [debug] [ThreadPool]: SQL status: BEGIN in 0.2 seconds +17:06:24.435790 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +17:06:24.435865 [debug] [ThreadPool]: On list_postgres_public: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres_public"} */ +select + 'postgres' as database, + tablename as name, + schemaname as schema, + 'table' as type + from pg_tables + where schemaname ilike 'public' + union all + select + 'postgres' as database, + viewname as name, + schemaname as schema, + 'view' as type + from pg_views + where schemaname ilike 'public' + +17:06:24.459113 [debug] [ThreadPool]: SQL status: SELECT 20 in 0.02 seconds +17:06:24.463504 [debug] [ThreadPool]: On list_postgres_public: ROLLBACK +17:06:24.481169 [debug] [ThreadPool]: On list_postgres_public: Close +17:06:24.488452 [debug] [MainThread]: Using postgres connection "master" +17:06:24.488614 [debug] [MainThread]: On master: BEGIN +17:06:24.488678 [debug] [MainThread]: Opening a new connection, currently in state init +17:06:24.682230 [debug] [MainThread]: SQL status: BEGIN in 0.19 seconds +17:06:24.683639 [debug] [MainThread]: Using postgres connection "master" +17:06:24.684022 [debug] [MainThread]: On master: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "master"} */ +with relation as ( + select + pg_rewrite.ev_class as class, + pg_rewrite.oid as id + from pg_rewrite + ), + class as ( + select + oid as id, + relname as name, + relnamespace as schema, + relkind as kind + from pg_class + ), + dependency as ( + select distinct + pg_depend.objid as id, + pg_depend.refobjid as ref + from pg_depend + ), + schema as ( + select + pg_namespace.oid as id, + pg_namespace.nspname as name + from pg_namespace + where nspname != 'information_schema' and nspname not like 'pg\_%' + ), + referenced as ( + select + relation.id AS id, + referenced_class.name , + referenced_class.schema , + referenced_class.kind + from relation + join class as referenced_class on relation.class=referenced_class.id + where referenced_class.kind in ('r', 'v') + ), + relationships as ( + select + referenced.name as referenced_name, + referenced.schema as referenced_schema_id, + dependent_class.name as dependent_name, + dependent_class.schema as dependent_schema_id, + referenced.kind as kind + from referenced + join dependency on referenced.id=dependency.id + join class as dependent_class on dependency.ref=dependent_class.id + where + (referenced.name != dependent_class.name or + referenced.schema != dependent_class.schema) + ) + + select + referenced_schema.name as referenced_schema, + relationships.referenced_name as referenced_name, + dependent_schema.name as dependent_schema, + relationships.dependent_name as dependent_name + from relationships + join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id + join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id + group by referenced_schema, referenced_name, dependent_schema, dependent_name + order by referenced_schema, referenced_name, dependent_schema, dependent_name; +17:06:24.858913 [debug] [MainThread]: SQL status: SELECT 8 in 0.17 seconds +17:06:24.859803 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '9ef5d166-fa36-4c6c-a92a-178af698cc53', 'context': []} +17:06:24.859992 [debug] [MainThread]: On master: ROLLBACK +17:06:24.878499 [debug] [MainThread]: Using postgres connection "master" +17:06:24.878644 [debug] [MainThread]: On master: BEGIN +17:06:24.917116 [debug] [MainThread]: SQL status: BEGIN in 0.04 seconds +17:06:24.917714 [debug] [MainThread]: On master: COMMIT +17:06:24.918096 [debug] [MainThread]: Using postgres connection "master" +17:06:24.918421 [debug] [MainThread]: On master: COMMIT +17:06:24.937707 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +17:06:24.938509 [debug] [MainThread]: On master: Close +17:06:24.940148 [info ] [MainThread]: Concurrency: 10 threads (target='dev') +17:06:24.940744 [info ] [MainThread]: +17:06:24.945242 [debug] [Thread-1 ]: Began running node test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +17:06:24.945398 [info ] [Thread-1 ]: 1 of 13 START test not_null_my_first_dbt_model_id .............................. [RUN] +17:06:24.945645 [debug] [Thread-1 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +17:06:24.945721 [debug] [Thread-1 ]: Began compiling node test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +17:06:24.945836 [debug] [Thread-1 ]: Compiling test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +17:06:24.951832 [debug] [Thread-1 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +17:06:24.951939 [debug] [Thread-2 ]: Began running node test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +17:06:24.952028 [debug] [Thread-3 ]: Began running node test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c +17:06:24.952082 [debug] [Thread-4 ]: Began running node test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427 +17:06:24.952162 [debug] [Thread-5 ]: Began running node test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073 +17:06:24.952228 [info ] [Thread-2 ]: 2 of 13 START test not_null_my_second_dbt_model_id ............................. [RUN] +17:06:24.952281 [debug] [Thread-6 ]: Began running node test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +17:06:24.952357 [debug] [Thread-7 ]: Began running node test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +17:06:24.952436 [debug] [Thread-8 ]: Began running node test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +17:06:24.952492 [debug] [Thread-9 ]: Began running node test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20 +17:06:24.952563 [debug] [Thread-10 ]: Began running node test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe +17:06:24.952612 [info ] [Thread-3 ]: 3 of 13 START test not_null_number_played_against_num_played_against ........... [RUN] +17:06:24.952667 [debug] [Thread-1 ]: finished collecting timing info +17:06:24.952741 [info ] [Thread-4 ]: 4 of 13 START test not_null_number_played_against_player_id .................... [RUN] +17:06:24.952813 [info ] [Thread-5 ]: 5 of 13 START test not_null_number_played_against_season_id .................... [RUN] +17:06:24.953061 [debug] [Thread-2 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +17:06:24.953133 [info ] [Thread-6 ]: 6 of 13 START test not_null_wins_losses_gameid ................................. [RUN] +17:06:24.953204 [info ] [Thread-7 ]: 7 of 13 START test not_null_wins_losses_player_id .............................. [RUN] +17:06:24.953269 [info ] [Thread-8 ]: 8 of 13 START test not_null_wins_losses_seasonid ............................... [RUN] +17:06:24.953334 [info ] [Thread-9 ]: 9 of 13 START test positive_test_number_played_against_num_played_against ...... [RUN] +17:06:24.953397 [info ] [Thread-10 ]: 10 of 13 START test positive_test_wins_losses_total_losses ..................... [RUN] +17:06:24.953566 [debug] [Thread-3 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c" +17:06:24.953636 [debug] [Thread-1 ]: Began executing node test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +17:06:24.953832 [debug] [Thread-4 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427" +17:06:24.953976 [debug] [Thread-5 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073" +17:06:24.954035 [debug] [Thread-2 ]: Began compiling node test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +17:06:24.954181 [debug] [Thread-6 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +17:06:24.954340 [debug] [Thread-7 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +17:06:24.954489 [debug] [Thread-8 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +17:06:24.954652 [debug] [Thread-9 ]: Acquiring new postgres connection "test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20" +17:06:24.954796 [debug] [Thread-10 ]: Acquiring new postgres connection "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe" +17:06:24.954853 [debug] [Thread-3 ]: Began compiling node test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c +17:06:24.961561 [debug] [Thread-1 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +17:06:24.961656 [debug] [Thread-4 ]: Began compiling node test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427 +17:06:24.961730 [debug] [Thread-5 ]: Began compiling node test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073 +17:06:24.961805 [debug] [Thread-2 ]: Compiling test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +17:06:24.961868 [debug] [Thread-6 ]: Began compiling node test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +17:06:24.961931 [debug] [Thread-7 ]: Began compiling node test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +17:06:24.961990 [debug] [Thread-8 ]: Began compiling node test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +17:06:24.962052 [debug] [Thread-9 ]: Began compiling node test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20 +17:06:24.962111 [debug] [Thread-10 ]: Began compiling node test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe +17:06:24.962165 [debug] [Thread-3 ]: Compiling test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c +17:06:24.962254 [debug] [Thread-4 ]: Compiling test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427 +17:06:24.962328 [debug] [Thread-5 ]: Compiling test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073 +17:06:24.964211 [debug] [Thread-2 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +17:06:24.964299 [debug] [Thread-1 ]: Using postgres connection "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +17:06:24.964371 [debug] [Thread-6 ]: Compiling test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +17:06:24.964441 [debug] [Thread-7 ]: Compiling test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +17:06:24.964504 [debug] [Thread-8 ]: Compiling test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +17:06:24.964563 [debug] [Thread-9 ]: Compiling test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20 +17:06:24.964620 [debug] [Thread-10 ]: Compiling test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe +17:06:24.966067 [debug] [Thread-3 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c" +17:06:24.967446 [debug] [Thread-4 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427" +17:06:24.968792 [debug] [Thread-5 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073" +17:06:24.968902 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710: BEGIN +17:06:24.970303 [debug] [Thread-6 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +17:06:24.971658 [debug] [Thread-7 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +17:06:24.973021 [debug] [Thread-8 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +17:06:24.973080 [debug] [Thread-2 ]: finished collecting timing info +17:06:24.974804 [debug] [Thread-9 ]: Writing injected SQL for node "test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20" +17:06:24.976044 [debug] [Thread-10 ]: Writing injected SQL for node "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe" +17:06:24.976337 [debug] [Thread-3 ]: finished collecting timing info +17:06:24.976417 [debug] [Thread-1 ]: Opening a new connection, currently in state closed +17:06:24.976486 [debug] [Thread-4 ]: finished collecting timing info +17:06:24.976583 [debug] [Thread-5 ]: finished collecting timing info +17:06:24.976789 [debug] [Thread-2 ]: Began executing node test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +17:06:24.976851 [debug] [Thread-7 ]: finished collecting timing info +17:06:24.976910 [debug] [Thread-6 ]: finished collecting timing info +17:06:24.976996 [debug] [Thread-8 ]: finished collecting timing info +17:06:24.977099 [debug] [Thread-3 ]: Began executing node test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c +17:06:24.977147 [debug] [Thread-9 ]: finished collecting timing info +17:06:24.977279 [debug] [Thread-10 ]: finished collecting timing info +17:06:24.977339 [debug] [Thread-4 ]: Began executing node test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427 +17:06:24.977412 [debug] [Thread-5 ]: Began executing node test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073 +17:06:24.978129 [debug] [Thread-2 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +17:06:24.978204 [debug] [Thread-7 ]: Began executing node test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +17:06:24.978275 [debug] [Thread-6 ]: Began executing node test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +17:06:24.978338 [debug] [Thread-8 ]: Began executing node test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +17:06:24.978989 [debug] [Thread-3 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c" +17:06:24.979060 [debug] [Thread-9 ]: Began executing node test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20 +17:06:24.979129 [debug] [Thread-10 ]: Began executing node test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe +17:06:24.979771 [debug] [Thread-4 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427" +17:06:24.980427 [debug] [Thread-5 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073" +17:06:24.981657 [debug] [Thread-7 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +17:06:24.982269 [debug] [Thread-6 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +17:06:25.009067 [debug] [Thread-8 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +17:06:25.009226 [debug] [Thread-2 ]: Using postgres connection "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +17:06:25.010157 [debug] [Thread-9 ]: Writing runtime SQL for node "test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20" +17:06:25.010887 [debug] [Thread-10 ]: Writing runtime SQL for node "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe" +17:06:25.011233 [debug] [Thread-3 ]: Using postgres connection "test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c" +17:06:25.011412 [debug] [Thread-4 ]: Using postgres connection "test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427" +17:06:25.011562 [debug] [Thread-5 ]: Using postgres connection "test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073" +17:06:25.011726 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778: BEGIN +17:06:25.011825 [debug] [Thread-6 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +17:06:25.011906 [debug] [Thread-7 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +17:06:25.012042 [debug] [Thread-8 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +17:06:25.012208 [debug] [Thread-3 ]: On test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c: BEGIN +17:06:25.012267 [debug] [Thread-9 ]: Using postgres connection "test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20" +17:06:25.012350 [debug] [Thread-4 ]: On test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427: BEGIN +17:06:25.012499 [debug] [Thread-5 ]: On test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073: BEGIN +17:06:25.012564 [debug] [Thread-10 ]: Using postgres connection "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe" +17:06:25.012634 [debug] [Thread-2 ]: Opening a new connection, currently in state init +17:06:25.012785 [debug] [Thread-6 ]: On test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1: BEGIN +17:06:25.012840 [debug] [Thread-7 ]: On test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15: BEGIN +17:06:25.012898 [debug] [Thread-8 ]: On test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813: BEGIN +17:06:25.012961 [debug] [Thread-3 ]: Opening a new connection, currently in state init +17:06:25.013054 [debug] [Thread-9 ]: On test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20: BEGIN +17:06:25.013113 [debug] [Thread-4 ]: Opening a new connection, currently in state init +17:06:25.013167 [debug] [Thread-5 ]: Opening a new connection, currently in state init +17:06:25.013223 [debug] [Thread-10 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe: BEGIN +17:06:25.013360 [debug] [Thread-6 ]: Opening a new connection, currently in state init +17:06:25.013461 [debug] [Thread-7 ]: Opening a new connection, currently in state init +17:06:25.013539 [debug] [Thread-8 ]: Opening a new connection, currently in state init +17:06:25.013676 [debug] [Thread-9 ]: Opening a new connection, currently in state init +17:06:25.013839 [debug] [Thread-10 ]: Opening a new connection, currently in state init +17:06:25.187006 [debug] [Thread-1 ]: SQL status: BEGIN in 0.21 seconds +17:06:25.187295 [debug] [Thread-1 ]: Using postgres connection "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710" +17:06:25.187367 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select id +from "postgres"."public"."my_first_dbt_model" +where id is null + + + + + ) dbt_internal_test +17:06:25.208492 [debug] [Thread-5 ]: SQL status: BEGIN in 0.2 seconds +17:06:25.208621 [debug] [Thread-5 ]: Using postgres connection "test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073" +17:06:25.208683 [debug] [Thread-5 ]: On test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select season_id +from "postgres"."public"."number_played_against" +where season_id is null + + + + + ) dbt_internal_test +17:06:25.209694 [debug] [Thread-1 ]: SQL status: SELECT 1 in 0.02 seconds +17:06:25.211066 [debug] [Thread-1 ]: finished collecting timing info +17:06:25.211195 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710: ROLLBACK +17:06:25.212470 [debug] [Thread-3 ]: SQL status: BEGIN in 0.2 seconds +17:06:25.212550 [debug] [Thread-9 ]: SQL status: BEGIN in 0.2 seconds +17:06:25.212642 [debug] [Thread-3 ]: Using postgres connection "test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c" +17:06:25.212712 [debug] [Thread-9 ]: Using postgres connection "test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20" +17:06:25.212774 [debug] [Thread-3 ]: On test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select num_played_against +from "postgres"."public"."number_played_against" +where num_played_against is null + + + + + ) dbt_internal_test +17:06:25.212832 [debug] [Thread-9 ]: On test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + +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 + + + + ) dbt_internal_test +17:06:25.219250 [debug] [Thread-10 ]: SQL status: BEGIN in 0.21 seconds +17:06:25.219404 [debug] [Thread-10 ]: Using postgres connection "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe" +17:06:25.219463 [debug] [Thread-10 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + +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 + + + + ) dbt_internal_test +17:06:25.223837 [debug] [Thread-6 ]: SQL status: BEGIN in 0.21 seconds +17:06:25.224535 [debug] [Thread-6 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +17:06:25.224715 [debug] [Thread-6 ]: On test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select gameid +from "postgres"."public"."wins_losses" +where gameid is null + + + + + ) dbt_internal_test +17:06:25.229717 [debug] [Thread-2 ]: SQL status: BEGIN in 0.22 seconds +17:06:25.230320 [debug] [Thread-2 ]: Using postgres connection "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778" +17:06:25.230577 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select id +from "postgres"."public"."my_second_dbt_model" +where id is null + + + + + ) dbt_internal_test +17:06:25.231442 [debug] [Thread-7 ]: SQL status: BEGIN in 0.22 seconds +17:06:25.231796 [debug] [Thread-7 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +17:06:25.231955 [debug] [Thread-7 ]: On test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select player_id +from "postgres"."public"."wins_losses" +where player_id is null + + + + + ) dbt_internal_test +17:06:25.232283 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710: Close +17:06:25.233640 [info ] [Thread-1 ]: 1 of 13 PASS not_null_my_first_dbt_model_id .................................... [PASS in 0.29s] +17:06:25.234745 [debug] [Thread-1 ]: Finished running node test.wrkplay_dbt.not_null_my_first_dbt_model_id.5fb22c2710 +17:06:25.235218 [debug] [Thread-1 ]: Began running node test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77 +17:06:25.235608 [debug] [Thread-8 ]: SQL status: BEGIN in 0.22 seconds +17:06:25.235863 [info ] [Thread-1 ]: 11 of 13 START test positive_test_wins_losses_total_wins ....................... [RUN] +17:06:25.236061 [debug] [Thread-8 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +17:06:25.236558 [debug] [Thread-1 ]: Acquiring new postgres connection "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77" +17:06:25.236678 [debug] [Thread-8 ]: On test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select seasonid +from "postgres"."public"."wins_losses" +where seasonid is null + + + + + ) dbt_internal_test +17:06:25.236766 [debug] [Thread-1 ]: Began compiling node test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77 +17:06:25.236840 [debug] [Thread-4 ]: SQL status: BEGIN in 0.22 seconds +17:06:25.236964 [debug] [Thread-1 ]: Compiling test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77 +17:06:25.237025 [debug] [Thread-4 ]: Using postgres connection "test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427" +17:06:25.239370 [debug] [Thread-1 ]: Writing injected SQL for node "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77" +17:06:25.239503 [debug] [Thread-4 ]: On test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select player_id +from "postgres"."public"."number_played_against" +where player_id is null + + + + + ) dbt_internal_test +17:06:25.239835 [debug] [Thread-5 ]: SQL status: SELECT 1 in 0.03 seconds +17:06:25.240721 [debug] [Thread-5 ]: finished collecting timing info +17:06:25.240810 [debug] [Thread-1 ]: finished collecting timing info +17:06:25.240877 [debug] [Thread-5 ]: On test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073: ROLLBACK +17:06:25.240949 [debug] [Thread-1 ]: Began executing node test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77 +17:06:25.241880 [debug] [Thread-1 ]: Writing runtime SQL for node "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77" +17:06:25.242186 [debug] [Thread-1 ]: Using postgres connection "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77" +17:06:25.242266 [debug] [Thread-1 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77: BEGIN +17:06:25.242322 [debug] [Thread-1 ]: Opening a new connection, currently in state closed +17:06:25.249741 [debug] [Thread-2 ]: SQL status: SELECT 1 in 0.02 seconds +17:06:25.250357 [debug] [Thread-2 ]: finished collecting timing info +17:06:25.250430 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778: ROLLBACK +17:06:25.269830 [debug] [Thread-5 ]: On test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073: Close +17:06:25.270960 [info ] [Thread-5 ]: 5 of 13 PASS not_null_number_played_against_season_id .......................... [PASS in 0.32s] +17:06:25.271559 [debug] [Thread-5 ]: Finished running node test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073 +17:06:25.273798 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778: Close +17:06:25.282081 [debug] [Thread-4 ]: SQL status: SELECT 1 in 0.04 seconds +17:06:25.289331 [debug] [Thread-5 ]: Began running node test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +17:06:25.290343 [debug] [Thread-4 ]: finished collecting timing info +17:06:25.290551 [info ] [Thread-2 ]: 2 of 13 PASS not_null_my_second_dbt_model_id ................................... [PASS in 0.34s] +17:06:25.290630 [info ] [Thread-5 ]: 12 of 13 START test unique_my_first_dbt_model_id ............................... [RUN] +17:06:25.290715 [debug] [Thread-4 ]: On test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427: ROLLBACK +17:06:25.290882 [debug] [Thread-2 ]: Finished running node test.wrkplay_dbt.not_null_my_second_dbt_model_id.151b76d778 +17:06:25.291072 [debug] [Thread-5 ]: Acquiring new postgres connection "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +17:06:25.291189 [debug] [Thread-2 ]: Began running node test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +17:06:25.291255 [debug] [Thread-5 ]: Began compiling node test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +17:06:25.291350 [info ] [Thread-2 ]: 13 of 13 START test unique_my_second_dbt_model_id .............................. [RUN] +17:06:25.291426 [debug] [Thread-5 ]: Compiling test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +17:06:25.291592 [debug] [Thread-2 ]: Acquiring new postgres connection "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +17:06:25.294512 [debug] [Thread-5 ]: Writing injected SQL for node "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +17:06:25.294626 [debug] [Thread-2 ]: Began compiling node test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +17:06:25.294762 [debug] [Thread-2 ]: Compiling test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +17:06:25.296208 [debug] [Thread-2 ]: Writing injected SQL for node "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +17:06:25.296419 [debug] [Thread-5 ]: finished collecting timing info +17:06:25.296478 [debug] [Thread-2 ]: finished collecting timing info +17:06:25.296544 [debug] [Thread-5 ]: Began executing node test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +17:06:25.296607 [debug] [Thread-2 ]: Began executing node test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +17:06:25.297302 [debug] [Thread-5 ]: Writing runtime SQL for node "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +17:06:25.297914 [debug] [Thread-2 ]: Writing runtime SQL for node "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +17:06:25.298296 [debug] [Thread-5 ]: Using postgres connection "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +17:06:25.298359 [debug] [Thread-2 ]: Using postgres connection "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +17:06:25.298422 [debug] [Thread-5 ]: On test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321: BEGIN +17:06:25.298485 [debug] [Thread-2 ]: On test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493: BEGIN +17:06:25.298544 [debug] [Thread-5 ]: Opening a new connection, currently in state closed +17:06:25.298606 [debug] [Thread-2 ]: Opening a new connection, currently in state closed +17:06:25.301593 [debug] [Thread-10 ]: SQL status: SELECT 1 in 0.08 seconds +17:06:25.301654 [debug] [Thread-8 ]: SQL status: SELECT 1 in 0.06 seconds +17:06:25.302400 [debug] [Thread-10 ]: finished collecting timing info +17:06:25.302969 [debug] [Thread-8 ]: finished collecting timing info +17:06:25.303055 [debug] [Thread-10 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe: ROLLBACK +17:06:25.303129 [debug] [Thread-8 ]: On test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813: ROLLBACK +17:06:25.305854 [debug] [Thread-6 ]: SQL status: SELECT 1 in 0.08 seconds +17:06:25.305916 [debug] [Thread-7 ]: SQL status: SELECT 1 in 0.07 seconds +17:06:25.306482 [debug] [Thread-6 ]: finished collecting timing info +17:06:25.307019 [debug] [Thread-7 ]: finished collecting timing info +17:06:25.307107 [debug] [Thread-6 ]: On test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1: ROLLBACK +17:06:25.307177 [debug] [Thread-7 ]: On test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15: ROLLBACK +17:06:25.312115 [debug] [Thread-4 ]: On test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427: Close +17:06:25.312432 [info ] [Thread-4 ]: 4 of 13 PASS not_null_number_played_against_player_id .......................... [PASS in 0.36s] +17:06:25.312664 [debug] [Thread-4 ]: Finished running node test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427 +17:06:25.317402 [debug] [Thread-3 ]: SQL status: SELECT 1 in 0.1 seconds +17:06:25.318137 [debug] [Thread-3 ]: finished collecting timing info +17:06:25.318245 [debug] [Thread-3 ]: On test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c: ROLLBACK +17:06:25.324452 [debug] [Thread-8 ]: On test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813: Close +17:06:25.324562 [debug] [Thread-10 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe: Close +17:06:25.324890 [info ] [Thread-8 ]: 8 of 13 PASS not_null_wins_losses_seasonid ..................................... [PASS in 0.37s] +17:06:25.325001 [debug] [Thread-6 ]: On test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1: Close +17:06:25.325258 [debug] [Thread-8 ]: Finished running node test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +17:06:25.325478 [info ] [Thread-10 ]: 10 of 13 PASS positive_test_wins_losses_total_losses ........................... [PASS in 0.37s] +17:06:25.325806 [info ] [Thread-6 ]: 6 of 13 PASS not_null_wins_losses_gameid ....................................... [PASS in 0.37s] +17:06:25.325977 [debug] [Thread-10 ]: Finished running node test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe +17:06:25.326240 [debug] [Thread-6 ]: Finished running node test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +17:06:25.326566 [debug] [Thread-7 ]: On test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15: Close +17:06:25.326824 [info ] [Thread-7 ]: 7 of 13 PASS not_null_wins_losses_player_id .................................... [PASS in 0.37s] +17:06:25.326988 [debug] [Thread-7 ]: Finished running node test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +17:06:25.334122 [debug] [Thread-9 ]: SQL status: SELECT 1 in 0.12 seconds +17:06:25.334931 [debug] [Thread-9 ]: finished collecting timing info +17:06:25.335036 [debug] [Thread-9 ]: On test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20: ROLLBACK +17:06:25.337065 [debug] [Thread-3 ]: On test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c: Close +17:06:25.337376 [info ] [Thread-3 ]: 3 of 13 PASS not_null_number_played_against_num_played_against ................. [PASS in 0.38s] +17:06:25.337578 [debug] [Thread-3 ]: Finished running node test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c +17:06:25.354129 [debug] [Thread-9 ]: On test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20: Close +17:06:25.354462 [info ] [Thread-9 ]: 9 of 13 PASS positive_test_number_played_against_num_played_against ............ [PASS in 0.40s] +17:06:25.354653 [debug] [Thread-9 ]: Finished running node test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20 +17:06:25.468921 [debug] [Thread-5 ]: SQL status: BEGIN in 0.17 seconds +17:06:25.469517 [debug] [Thread-1 ]: SQL status: BEGIN in 0.23 seconds +17:06:25.469973 [debug] [Thread-5 ]: Using postgres connection "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321" +17:06:25.470166 [debug] [Thread-1 ]: Using postgres connection "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77" +17:06:25.470386 [debug] [Thread-5 ]: On test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + +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 + + + + + ) dbt_internal_test +17:06:25.470573 [debug] [Thread-1 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + +with validation as ( + + select + total_wins 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 + + + + ) dbt_internal_test +17:06:25.489038 [debug] [Thread-2 ]: SQL status: BEGIN in 0.19 seconds +17:06:25.489757 [debug] [Thread-2 ]: Using postgres connection "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493" +17:06:25.489979 [debug] [Thread-5 ]: SQL status: SELECT 1 in 0.02 seconds +17:06:25.490217 [debug] [Thread-2 ]: On test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + +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 + + + + + ) dbt_internal_test +17:06:25.493405 [debug] [Thread-5 ]: finished collecting timing info +17:06:25.493891 [debug] [Thread-5 ]: On test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321: ROLLBACK +17:06:25.503432 [debug] [Thread-1 ]: SQL status: SELECT 1 in 0.03 seconds +17:06:25.508224 [debug] [Thread-1 ]: finished collecting timing info +17:06:25.508384 [debug] [Thread-1 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77: ROLLBACK +17:06:25.512162 [debug] [Thread-5 ]: On test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321: Close +17:06:25.513887 [info ] [Thread-5 ]: 12 of 13 PASS unique_my_first_dbt_model_id ..................................... [PASS in 0.22s] +17:06:25.514716 [debug] [Thread-5 ]: Finished running node test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321 +17:06:25.514900 [debug] [Thread-2 ]: SQL status: SELECT 1 in 0.02 seconds +17:06:25.516297 [debug] [Thread-2 ]: finished collecting timing info +17:06:25.516444 [debug] [Thread-2 ]: On test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493: ROLLBACK +17:06:25.526213 [debug] [Thread-1 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77: Close +17:06:25.527850 [info ] [Thread-1 ]: 11 of 13 PASS positive_test_wins_losses_total_wins ............................. [PASS in 0.29s] +17:06:25.528588 [debug] [Thread-1 ]: Finished running node test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77 +17:06:25.535342 [debug] [Thread-2 ]: On test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493: Close +17:06:25.537076 [info ] [Thread-2 ]: 13 of 13 PASS unique_my_second_dbt_model_id .................................... [PASS in 0.25s] +17:06:25.538258 [debug] [Thread-2 ]: Finished running node test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493 +17:06:25.542352 [debug] [MainThread]: Acquiring new postgres connection "master" +17:06:25.542698 [debug] [MainThread]: Using postgres connection "master" +17:06:25.542878 [debug] [MainThread]: On master: BEGIN +17:06:25.543037 [debug] [MainThread]: Opening a new connection, currently in state closed +17:06:25.731414 [debug] [MainThread]: SQL status: BEGIN in 0.19 seconds +17:06:25.732435 [debug] [MainThread]: On master: COMMIT +17:06:25.732795 [debug] [MainThread]: Using postgres connection "master" +17:06:25.733139 [debug] [MainThread]: On master: COMMIT +17:06:25.751737 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +17:06:25.752463 [debug] [MainThread]: On master: Close +17:06:25.754521 [info ] [MainThread]: +17:06:25.754823 [info ] [MainThread]: Finished running 13 tests in 1.53s. +17:06:25.754945 [debug] [MainThread]: Connection 'master' was properly closed. +17:06:25.755005 [debug] [MainThread]: Connection 'test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77' was properly closed. +17:06:25.755064 [debug] [MainThread]: Connection 'test.wrkplay_dbt.unique_my_second_dbt_model_id.57a0f8c493' was properly closed. +17:06:25.755118 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c' was properly closed. +17:06:25.755166 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427' was properly closed. +17:06:25.755213 [debug] [MainThread]: Connection 'test.wrkplay_dbt.unique_my_first_dbt_model_id.16e066b321' was properly closed. +17:06:25.755260 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1' was properly closed. +17:06:25.755306 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15' was properly closed. +17:06:25.755351 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813' was properly closed. +17:06:25.755398 [debug] [MainThread]: Connection 'test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20' was properly closed. +17:06:25.755447 [debug] [MainThread]: Connection 'test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe' was properly closed. +17:06:25.759468 [info ] [MainThread]: +17:06:25.759585 [info ] [MainThread]: Completed successfully +17:06:25.759710 [info ] [MainThread]: +17:06:25.759798 [info ] [MainThread]: Done. PASS=13 WARN=0 ERROR=0 SKIP=0 TOTAL=13 +17:06:25.759935 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [, , ]} + + +============================== 2022-07-08 17:07:21.454822 | fc877a60-ba65-4dff-9202-668b3ea2c2b8 ============================== +17:07:21.454843 [info ] [MainThread]: Running with dbt=1.1.1 +17:07:21.455462 [debug] [MainThread]: running dbt with arguments {'write_json': True, 'use_colors': True, 'printer_width': 80, 'version_check': True, 'partial_parse': True, 'static_parser': True, 'profiles_dir': '/Users/bruno.campos/.dbt', 'send_anonymous_usage_stats': True, 'event_buffer_size': 100000, 'quiet': False, 'no_print': False, 'which': 'run', 'rpc_method': 'run', 'indirect_selection': 'eager'} +17:07:21.455555 [debug] [MainThread]: Tracking: tracking +17:07:21.476227 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [, , ]} +17:07:21.495851 [debug] [MainThread]: Partial parsing enabled: 3 files deleted, 0 files added, 0 files changed. +17:07:21.496035 [debug] [MainThread]: Partial parsing: deleted file: wrkplay_dbt://models/example/my_first_dbt_model.sql +17:07:21.496101 [debug] [MainThread]: Partial parsing: deleted file: wrkplay_dbt://models/example/my_second_dbt_model.sql +17:07:21.498052 [warn ] [MainThread]: [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. +There are 1 unused configuration paths: +- models.wrkplay_dbt.example + +17:07:21.501104 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': 'fc877a60-ba65-4dff-9202-668b3ea2c2b8', 'context': []} +17:07:21.513064 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': 'fc877a60-ba65-4dff-9202-668b3ea2c2b8', 'context': []} +17:07:21.513347 [info ] [MainThread]: Found 2 models, 9 tests, 0 snapshots, 0 analyses, 168 macros, 0 operations, 0 seed files, 0 sources, 0 exposures, 0 metrics +17:07:21.513484 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': 'fc877a60-ba65-4dff-9202-668b3ea2c2b8', 'context': []} +17:07:21.514367 [info ] [MainThread]: +17:07:21.514639 [debug] [MainThread]: Acquiring new postgres connection "master" +17:07:21.515118 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres" +17:07:21.520041 [debug] [ThreadPool]: Using postgres connection "list_postgres" +17:07:21.520173 [debug] [ThreadPool]: On list_postgres: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres"} */ + + select distinct nspname from pg_namespace + +17:07:21.520236 [debug] [ThreadPool]: Opening a new connection, currently in state init +17:07:21.777815 [debug] [ThreadPool]: SQL status: SELECT 10 in 0.26 seconds +17:07:21.781974 [debug] [ThreadPool]: On list_postgres: Close +17:07:21.783066 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres_public" +17:07:21.786392 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +17:07:21.786484 [debug] [ThreadPool]: On list_postgres_public: BEGIN +17:07:21.786548 [debug] [ThreadPool]: Opening a new connection, currently in state closed +17:07:21.977449 [debug] [ThreadPool]: SQL status: BEGIN in 0.19 seconds +17:07:21.978542 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +17:07:21.979323 [debug] [ThreadPool]: On list_postgres_public: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres_public"} */ +select + 'postgres' as database, + tablename as name, + schemaname as schema, + 'table' as type + from pg_tables + where schemaname ilike 'public' + union all + select + 'postgres' as database, + viewname as name, + schemaname as schema, + 'view' as type + from pg_views + where schemaname ilike 'public' + +17:07:22.003157 [debug] [ThreadPool]: SQL status: SELECT 20 in 0.02 seconds +17:07:22.008701 [debug] [ThreadPool]: On list_postgres_public: ROLLBACK +17:07:22.027068 [debug] [ThreadPool]: On list_postgres_public: Close +17:07:22.033954 [debug] [MainThread]: Using postgres connection "master" +17:07:22.034092 [debug] [MainThread]: On master: BEGIN +17:07:22.034149 [debug] [MainThread]: Opening a new connection, currently in state init +17:07:22.230634 [debug] [MainThread]: SQL status: BEGIN in 0.2 seconds +17:07:22.232075 [debug] [MainThread]: Using postgres connection "master" +17:07:22.232455 [debug] [MainThread]: On master: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "master"} */ +with relation as ( + select + pg_rewrite.ev_class as class, + pg_rewrite.oid as id + from pg_rewrite + ), + class as ( + select + oid as id, + relname as name, + relnamespace as schema, + relkind as kind + from pg_class + ), + dependency as ( + select distinct + pg_depend.objid as id, + pg_depend.refobjid as ref + from pg_depend + ), + schema as ( + select + pg_namespace.oid as id, + pg_namespace.nspname as name + from pg_namespace + where nspname != 'information_schema' and nspname not like 'pg\_%' + ), + referenced as ( + select + relation.id AS id, + referenced_class.name , + referenced_class.schema , + referenced_class.kind + from relation + join class as referenced_class on relation.class=referenced_class.id + where referenced_class.kind in ('r', 'v') + ), + relationships as ( + select + referenced.name as referenced_name, + referenced.schema as referenced_schema_id, + dependent_class.name as dependent_name, + dependent_class.schema as dependent_schema_id, + referenced.kind as kind + from referenced + join dependency on referenced.id=dependency.id + join class as dependent_class on dependency.ref=dependent_class.id + where + (referenced.name != dependent_class.name or + referenced.schema != dependent_class.schema) + ) + + select + referenced_schema.name as referenced_schema, + relationships.referenced_name as referenced_name, + dependent_schema.name as dependent_schema, + relationships.dependent_name as dependent_name + from relationships + join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id + join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id + group by referenced_schema, referenced_name, dependent_schema, dependent_name + order by referenced_schema, referenced_name, dependent_schema, dependent_name; +17:07:22.408669 [debug] [MainThread]: SQL status: SELECT 8 in 0.18 seconds +17:07:22.422799 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': 'fc877a60-ba65-4dff-9202-668b3ea2c2b8', 'context': []} +17:07:22.423059 [debug] [MainThread]: On master: ROLLBACK +17:07:22.442706 [debug] [MainThread]: Using postgres connection "master" +17:07:22.443534 [debug] [MainThread]: On master: BEGIN +17:07:22.483114 [debug] [MainThread]: SQL status: BEGIN in 0.04 seconds +17:07:22.483789 [debug] [MainThread]: On master: COMMIT +17:07:22.484180 [debug] [MainThread]: Using postgres connection "master" +17:07:22.484516 [debug] [MainThread]: On master: COMMIT +17:07:22.505637 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +17:07:22.506595 [debug] [MainThread]: On master: Close +17:07:22.508655 [info ] [MainThread]: Concurrency: 10 threads (target='dev') +17:07:22.509391 [info ] [MainThread]: +17:07:22.516687 [debug] [Thread-1 ]: Began running node model.wrkplay_dbt.number_played_against +17:07:22.516969 [info ] [Thread-1 ]: 1 of 2 START view model public.number_played_against ........................... [RUN] +17:07:22.517264 [debug] [Thread-1 ]: Acquiring new postgres connection "model.wrkplay_dbt.number_played_against" +17:07:22.517353 [debug] [Thread-1 ]: Began compiling node model.wrkplay_dbt.number_played_against +17:07:22.517444 [debug] [Thread-1 ]: Compiling model.wrkplay_dbt.number_played_against +17:07:22.518504 [debug] [Thread-1 ]: Writing injected SQL for node "model.wrkplay_dbt.number_played_against" +17:07:22.518653 [debug] [Thread-2 ]: Began running node model.wrkplay_dbt.wins_losses +17:07:22.518784 [info ] [Thread-2 ]: 2 of 2 START view model public.wins_losses ..................................... [RUN] +17:07:22.519001 [debug] [Thread-2 ]: Acquiring new postgres connection "model.wrkplay_dbt.wins_losses" +17:07:22.519101 [debug] [Thread-2 ]: Began compiling node model.wrkplay_dbt.wins_losses +17:07:22.519164 [debug] [Thread-2 ]: Compiling model.wrkplay_dbt.wins_losses +17:07:22.519783 [debug] [Thread-2 ]: Writing injected SQL for node "model.wrkplay_dbt.wins_losses" +17:07:22.519873 [debug] [Thread-1 ]: finished collecting timing info +17:07:22.519966 [debug] [Thread-1 ]: Began executing node model.wrkplay_dbt.number_played_against +17:07:22.531329 [debug] [Thread-1 ]: Writing runtime SQL for node "model.wrkplay_dbt.number_played_against" +17:07:22.531487 [debug] [Thread-2 ]: finished collecting timing info +17:07:22.531593 [debug] [Thread-2 ]: Began executing node model.wrkplay_dbt.wins_losses +17:07:22.532701 [debug] [Thread-2 ]: Writing runtime SQL for node "model.wrkplay_dbt.wins_losses" +17:07:22.532859 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.number_played_against" +17:07:22.532926 [debug] [Thread-1 ]: On model.wrkplay_dbt.number_played_against: BEGIN +17:07:22.532984 [debug] [Thread-1 ]: Opening a new connection, currently in state closed +17:07:22.533188 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +17:07:22.533250 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: BEGIN +17:07:22.533301 [debug] [Thread-2 ]: Opening a new connection, currently in state init +17:07:22.715470 [debug] [Thread-1 ]: SQL status: BEGIN in 0.18 seconds +17:07:22.716827 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.number_played_against" +17:07:22.717209 [debug] [Thread-1 ]: On model.wrkplay_dbt.number_played_against: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.number_played_against"} */ + + create view "postgres"."public"."number_played_against__dbt_tmp" as ( + -- 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" + ); +17:07:22.731406 [debug] [Thread-2 ]: SQL status: BEGIN in 0.2 seconds +17:07:22.732296 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +17:07:22.732514 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ + + create view "postgres"."public"."wins_losses__dbt_tmp" as ( + --number of wins and losses per player per game (per office) per season +WITH loss_table AS ( + SELECT + SUM(lt.left_losses) AS "total_losses" + , lt.left_player_id AS "loss_player_id" + , lt.gameid + , lt.seasonid + FROM + ( + SELECT + * + FROM + ( + --Begin DONE + WITH left_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore > m.rightscore THEN 0 + ELSE 1 + END) AS "left_loss" + , l."A" + , l."B" + , m."gameid" + , m."seasonid" + FROM + "_left" l + JOIN "Match" m ON + l."A" = m.id + GROUP BY + l."A" + , l."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.left_loss) AS "left_losses" + , a."B" AS "left_player_id" + , a."gameid" + , a."seasonid" + FROM + left_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + --End DONE + ) ll + UNION ALL + SELECT + * + FROM + ( + --Begin DONE + WITH right_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore < m.rightscore THEN 0 + ELSE 1 + END) AS "right_loss" + , r."A" + , r."B" + , m."gameid" + , m."seasonid" + FROM + "_right" r + JOIN "Match" m ON + r."A" = m.id + GROUP BY + r."A" + , r."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.right_loss) AS "right_losses" + , a."B" AS "right_player_id" + , a."gameid" + , a."seasonid" + FROM + right_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + --End DONE + ) rl + ) lt + -- WHERE lt.left_player_id = '' + GROUP BY + lt.left_player_id + , lt.gameid + , lt.seasonid +) +, +win_table AS ( + --number of wins for a player and gameid + SELECT + SUM(rt.right_wins) AS "total_wins" + , rt.right_player_id AS "win_player_id" + , rt.gameid + , rt."seasonid" + FROM + ( + SELECT + * + FROM + ( + WITH right_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore < m.rightscore THEN 1 + ELSE 0 + END) AS "right_won" + , r."A" + , r."B" + , m."gameid" + , m."seasonid" + FROM + "_right" r + JOIN "Match" m ON + r."A" = m.id + GROUP BY + r."A" + , r."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.right_won) AS "right_wins" + , a."B" AS "right_player_id" + , a."gameid" + , a."seasonid" + FROM + right_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + ) rw + UNION ALL + SELECT + * + FROM + ( + WITH left_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore > m.rightscore THEN 1 + ELSE 0 + END) AS "left_won" + , l."A" + , l."B" + , m."gameid" + , m."seasonid" + FROM + "_left" l + JOIN "Match" m ON + l."A" = m.id + GROUP BY + l."A" + , l."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.left_won) AS "left_wins" + , a."B" AS "left_player_id" + , a."gameid" + , a."seasonid" + FROM + left_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + ) lw + ) rt + -- WHERE rt.right_player_id = '' + GROUP BY + rt.right_player_id + , rt.gameid + , rt."seasonid" +) +SELECT + COALESCE(lt.loss_player_id, wt.win_player_id) AS "player_id" + , COALESCE(lt."gameid", wt."gameid") AS "gameid" + , COALESCE(lt.seasonid, wt.seasonid) AS "seasonid" + , wt."total_wins" + , lt."total_losses" +FROM + loss_table lt +FULL OUTER JOIN win_table wt ON + lt."loss_player_id" = wt."win_player_id" + AND lt."gameid" = wt."gameid" + AND lt."seasonid" = wt."seasonid" + ); +17:07:22.741520 [debug] [Thread-1 ]: SQL status: CREATE VIEW in 0.02 seconds +17:07:22.750182 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.number_played_against" +17:07:22.750387 [debug] [Thread-1 ]: On model.wrkplay_dbt.number_played_against: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.number_played_against"} */ +alter table "postgres"."public"."number_played_against" rename to "number_played_against__dbt_backup" +17:07:22.760008 [debug] [Thread-2 ]: SQL status: CREATE VIEW in 0.03 seconds +17:07:22.763564 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +17:07:22.763675 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ +alter table "postgres"."public"."wins_losses" rename to "wins_losses__dbt_backup" +17:07:22.768374 [debug] [Thread-1 ]: SQL status: ALTER TABLE in 0.02 seconds +17:07:22.771514 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.number_played_against" +17:07:22.771593 [debug] [Thread-1 ]: On model.wrkplay_dbt.number_played_against: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.number_played_against"} */ +alter table "postgres"."public"."number_played_against__dbt_tmp" rename to "number_played_against" +17:07:22.782983 [debug] [Thread-2 ]: SQL status: ALTER TABLE in 0.02 seconds +17:07:22.787119 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +17:07:22.787200 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ +alter table "postgres"."public"."wins_losses__dbt_tmp" rename to "wins_losses" +17:07:22.791324 [debug] [Thread-1 ]: SQL status: ALTER TABLE in 0.02 seconds +17:07:22.796951 [debug] [Thread-1 ]: On model.wrkplay_dbt.number_played_against: COMMIT +17:07:22.797070 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.number_played_against" +17:07:22.797128 [debug] [Thread-1 ]: On model.wrkplay_dbt.number_played_against: COMMIT +17:07:22.806262 [debug] [Thread-2 ]: SQL status: ALTER TABLE in 0.02 seconds +17:07:22.808122 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: COMMIT +17:07:22.808332 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +17:07:22.808509 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: COMMIT +17:07:22.815511 [debug] [Thread-1 ]: SQL status: COMMIT in 0.02 seconds +17:07:22.821295 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.number_played_against" +17:07:22.821379 [debug] [Thread-1 ]: On model.wrkplay_dbt.number_played_against: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.number_played_against"} */ +drop view if exists "postgres"."public"."number_played_against__dbt_backup" cascade +17:07:22.827350 [debug] [Thread-2 ]: SQL status: COMMIT in 0.02 seconds +17:07:22.830160 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +17:07:22.830454 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ +drop view if exists "postgres"."public"."wins_losses__dbt_backup" cascade +17:07:22.844450 [debug] [Thread-1 ]: SQL status: DROP VIEW in 0.02 seconds +17:07:22.847492 [debug] [Thread-1 ]: finished collecting timing info +17:07:22.848019 [debug] [Thread-1 ]: On model.wrkplay_dbt.number_played_against: Close +17:07:22.848737 [debug] [Thread-1 ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'fc877a60-ba65-4dff-9202-668b3ea2c2b8', 'context': []} +17:07:22.848993 [info ] [Thread-1 ]: 1 of 2 OK created view model public.number_played_against ...................... [CREATE VIEW in 0.33s] +17:07:22.849291 [debug] [Thread-1 ]: Finished running node model.wrkplay_dbt.number_played_against +17:07:22.851694 [debug] [Thread-2 ]: SQL status: DROP VIEW in 0.02 seconds +17:07:22.852334 [debug] [Thread-2 ]: finished collecting timing info +17:07:22.852411 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: Close +17:07:22.852659 [debug] [Thread-2 ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'fc877a60-ba65-4dff-9202-668b3ea2c2b8', 'context': []} +17:07:22.852791 [info ] [Thread-2 ]: 2 of 2 OK created view model public.wins_losses ................................ [CREATE VIEW in 0.33s] +17:07:22.852944 [debug] [Thread-2 ]: Finished running node model.wrkplay_dbt.wins_losses +17:07:22.854779 [debug] [MainThread]: Acquiring new postgres connection "master" +17:07:22.854905 [debug] [MainThread]: Using postgres connection "master" +17:07:22.854961 [debug] [MainThread]: On master: BEGIN +17:07:22.855014 [debug] [MainThread]: Opening a new connection, currently in state closed +17:07:23.054102 [debug] [MainThread]: SQL status: BEGIN in 0.2 seconds +17:07:23.055392 [debug] [MainThread]: On master: COMMIT +17:07:23.055650 [debug] [MainThread]: Using postgres connection "master" +17:07:23.055885 [debug] [MainThread]: On master: COMMIT +17:07:23.074881 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +17:07:23.076329 [debug] [MainThread]: On master: Close +17:07:23.078207 [info ] [MainThread]: +17:07:23.079170 [info ] [MainThread]: Finished running 2 view models in 1.56s. +17:07:23.079446 [debug] [MainThread]: Connection 'master' was properly closed. +17:07:23.079509 [debug] [MainThread]: Connection 'model.wrkplay_dbt.number_played_against' was properly closed. +17:07:23.079560 [debug] [MainThread]: Connection 'model.wrkplay_dbt.wins_losses' was properly closed. +17:07:23.083435 [info ] [MainThread]: +17:07:23.083572 [info ] [MainThread]: Completed successfully +17:07:23.083689 [info ] [MainThread]: +17:07:23.083789 [info ] [MainThread]: Done. PASS=2 WARN=0 ERROR=0 SKIP=0 TOTAL=2 +17:07:23.083931 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [, , ]} + + +============================== 2022-07-08 17:11:40.059467 | 7857e20c-b857-4917-9daa-151fb8f01a18 ============================== +17:11:40.059508 [info ] [MainThread]: Running with dbt=1.1.1 +17:11:40.060149 [debug] [MainThread]: running dbt with arguments {'write_json': True, 'use_colors': True, 'printer_width': 80, 'version_check': True, 'partial_parse': True, 'static_parser': True, 'profiles_dir': '/Users/bruno.campos/.dbt', 'send_anonymous_usage_stats': True, 'event_buffer_size': 100000, 'quiet': False, 'no_print': False, 'which': 'run', 'rpc_method': 'run', 'indirect_selection': 'eager'} +17:11:40.060237 [debug] [MainThread]: Tracking: tracking +17:11:40.082588 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [, , ]} +17:11:40.101711 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 0 files changed. +17:11:40.101817 [debug] [MainThread]: Partial parsing enabled, no changes found, skipping parsing +17:11:40.101997 [warn ] [MainThread]: [WARNING]: Configuration paths exist in your dbt_project.yml file which do not apply to any resources. +There are 1 unused configuration paths: +- models.wrkplay_dbt.example + +17:11:40.105345 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '7857e20c-b857-4917-9daa-151fb8f01a18', 'context': []} +17:11:40.108595 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '7857e20c-b857-4917-9daa-151fb8f01a18', 'context': []} +17:11:40.108784 [info ] [MainThread]: Found 2 models, 9 tests, 0 snapshots, 0 analyses, 168 macros, 0 operations, 0 seed files, 0 sources, 0 exposures, 0 metrics +17:11:40.108906 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '7857e20c-b857-4917-9daa-151fb8f01a18', 'context': []} +17:11:40.109706 [info ] [MainThread]: +17:11:40.109957 [debug] [MainThread]: Acquiring new postgres connection "master" +17:11:40.111295 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres" +17:11:40.115886 [debug] [ThreadPool]: Using postgres connection "list_postgres" +17:11:40.115987 [debug] [ThreadPool]: On list_postgres: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres"} */ + + select distinct nspname from pg_namespace + +17:11:40.116050 [debug] [ThreadPool]: Opening a new connection, currently in state init +17:11:40.365813 [debug] [ThreadPool]: SQL status: SELECT 10 in 0.25 seconds +17:11:40.371369 [debug] [ThreadPool]: On list_postgres: Close +17:11:40.372614 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres_public" +17:11:40.376052 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +17:11:40.376157 [debug] [ThreadPool]: On list_postgres_public: BEGIN +17:11:40.376219 [debug] [ThreadPool]: Opening a new connection, currently in state closed +17:11:40.560194 [debug] [ThreadPool]: SQL status: BEGIN in 0.18 seconds +17:11:40.561097 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +17:11:40.562017 [debug] [ThreadPool]: On list_postgres_public: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres_public"} */ +select + 'postgres' as database, + tablename as name, + schemaname as schema, + 'table' as type + from pg_tables + where schemaname ilike 'public' + union all + select + 'postgres' as database, + viewname as name, + schemaname as schema, + 'view' as type + from pg_views + where schemaname ilike 'public' + +17:11:40.584374 [debug] [ThreadPool]: SQL status: SELECT 18 in 0.02 seconds +17:11:40.588811 [debug] [ThreadPool]: On list_postgres_public: ROLLBACK +17:11:40.606602 [debug] [ThreadPool]: On list_postgres_public: Close +17:11:40.615566 [debug] [MainThread]: Using postgres connection "master" +17:11:40.615724 [debug] [MainThread]: On master: BEGIN +17:11:40.615784 [debug] [MainThread]: Opening a new connection, currently in state init +17:11:40.808560 [debug] [MainThread]: SQL status: BEGIN in 0.19 seconds +17:11:40.809191 [debug] [MainThread]: Using postgres connection "master" +17:11:40.809448 [debug] [MainThread]: On master: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "master"} */ +with relation as ( + select + pg_rewrite.ev_class as class, + pg_rewrite.oid as id + from pg_rewrite + ), + class as ( + select + oid as id, + relname as name, + relnamespace as schema, + relkind as kind + from pg_class + ), + dependency as ( + select distinct + pg_depend.objid as id, + pg_depend.refobjid as ref + from pg_depend + ), + schema as ( + select + pg_namespace.oid as id, + pg_namespace.nspname as name + from pg_namespace + where nspname != 'information_schema' and nspname not like 'pg\_%' + ), + referenced as ( + select + relation.id AS id, + referenced_class.name , + referenced_class.schema , + referenced_class.kind + from relation + join class as referenced_class on relation.class=referenced_class.id + where referenced_class.kind in ('r', 'v') + ), + relationships as ( + select + referenced.name as referenced_name, + referenced.schema as referenced_schema_id, + dependent_class.name as dependent_name, + dependent_class.schema as dependent_schema_id, + referenced.kind as kind + from referenced + join dependency on referenced.id=dependency.id + join class as dependent_class on dependency.ref=dependent_class.id + where + (referenced.name != dependent_class.name or + referenced.schema != dependent_class.schema) + ) + + select + referenced_schema.name as referenced_schema, + relationships.referenced_name as referenced_name, + dependent_schema.name as dependent_schema, + relationships.dependent_name as dependent_name + from relationships + join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id + join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id + group by referenced_schema, referenced_name, dependent_schema, dependent_name + order by referenced_schema, referenced_name, dependent_schema, dependent_name; +17:11:40.975442 [debug] [MainThread]: SQL status: SELECT 7 in 0.17 seconds +17:11:40.982785 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '7857e20c-b857-4917-9daa-151fb8f01a18', 'context': []} +17:11:40.983269 [debug] [MainThread]: On master: ROLLBACK +17:11:41.008785 [debug] [MainThread]: Using postgres connection "master" +17:11:41.009584 [debug] [MainThread]: On master: BEGIN +17:11:41.071597 [debug] [MainThread]: SQL status: BEGIN in 0.06 seconds +17:11:41.073608 [debug] [MainThread]: On master: COMMIT +17:11:41.074028 [debug] [MainThread]: Using postgres connection "master" +17:11:41.074306 [debug] [MainThread]: On master: COMMIT +17:11:41.094343 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +17:11:41.095796 [debug] [MainThread]: On master: Close +17:11:41.097879 [info ] [MainThread]: Concurrency: 10 threads (target='dev') +17:11:41.098480 [info ] [MainThread]: +17:11:41.104513 [debug] [Thread-1 ]: Began running node model.wrkplay_dbt.number_played_against +17:11:41.104763 [debug] [Thread-2 ]: Began running node model.wrkplay_dbt.wins_losses +17:11:41.105108 [info ] [Thread-1 ]: 1 of 2 START view model public.number_played_against ........................... [RUN] +17:11:41.105354 [info ] [Thread-2 ]: 2 of 2 START view model public.wins_losses ..................................... [RUN] +17:11:41.105696 [debug] [Thread-1 ]: Acquiring new postgres connection "model.wrkplay_dbt.number_played_against" +17:11:41.105916 [debug] [Thread-2 ]: Acquiring new postgres connection "model.wrkplay_dbt.wins_losses" +17:11:41.106101 [debug] [Thread-2 ]: Began compiling node model.wrkplay_dbt.wins_losses +17:11:41.106022 [debug] [Thread-1 ]: Began compiling node model.wrkplay_dbt.number_played_against +17:11:41.106321 [debug] [Thread-1 ]: Compiling model.wrkplay_dbt.number_played_against +17:11:41.106245 [debug] [Thread-2 ]: Compiling model.wrkplay_dbt.wins_losses +17:11:41.107991 [debug] [Thread-1 ]: Writing injected SQL for node "model.wrkplay_dbt.number_played_against" +17:11:41.109388 [debug] [Thread-2 ]: Writing injected SQL for node "model.wrkplay_dbt.wins_losses" +17:11:41.110043 [debug] [Thread-1 ]: finished collecting timing info +17:11:41.110197 [debug] [Thread-1 ]: Began executing node model.wrkplay_dbt.number_played_against +17:11:41.116682 [debug] [Thread-2 ]: finished collecting timing info +17:11:41.121437 [debug] [Thread-1 ]: Writing runtime SQL for node "model.wrkplay_dbt.number_played_against" +17:11:41.121563 [debug] [Thread-2 ]: Began executing node model.wrkplay_dbt.wins_losses +17:11:41.122756 [debug] [Thread-2 ]: Writing runtime SQL for node "model.wrkplay_dbt.wins_losses" +17:11:41.122967 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.number_played_against" +17:11:41.123052 [debug] [Thread-1 ]: On model.wrkplay_dbt.number_played_against: BEGIN +17:11:41.123115 [debug] [Thread-1 ]: Opening a new connection, currently in state closed +17:11:41.123342 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +17:11:41.123409 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: BEGIN +17:11:41.123459 [debug] [Thread-2 ]: Opening a new connection, currently in state init +17:11:41.299737 [debug] [Thread-2 ]: SQL status: BEGIN in 0.18 seconds +17:11:41.300495 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +17:11:41.300910 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ + + create view "postgres"."public"."wins_losses__dbt_tmp" as ( + --number of wins and losses per player per game (per office) per season +WITH loss_table AS ( + SELECT + SUM(lt.left_losses) AS "total_losses" + , lt.left_player_id AS "loss_player_id" + , lt.gameid + , lt.seasonid + FROM + ( + SELECT + * + FROM + ( + --Begin DONE + WITH left_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore > m.rightscore THEN 0 + ELSE 1 + END) AS "left_loss" + , l."A" + , l."B" + , m."gameid" + , m."seasonid" + FROM + "_left" l + JOIN "Match" m ON + l."A" = m.id + GROUP BY + l."A" + , l."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.left_loss) AS "left_losses" + , a."B" AS "left_player_id" + , a."gameid" + , a."seasonid" + FROM + left_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + --End DONE + ) ll + UNION ALL + SELECT + * + FROM + ( + --Begin DONE + WITH right_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore < m.rightscore THEN 0 + ELSE 1 + END) AS "right_loss" + , r."A" + , r."B" + , m."gameid" + , m."seasonid" + FROM + "_right" r + JOIN "Match" m ON + r."A" = m.id + GROUP BY + r."A" + , r."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.right_loss) AS "right_losses" + , a."B" AS "right_player_id" + , a."gameid" + , a."seasonid" + FROM + right_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + --End DONE + ) rl + ) lt + -- WHERE lt.left_player_id = '' + GROUP BY + lt.left_player_id + , lt.gameid + , lt.seasonid +) +, +win_table AS ( + --number of wins for a player and gameid + SELECT + SUM(rt.right_wins) AS "total_wins" + , rt.right_player_id AS "win_player_id" + , rt.gameid + , rt."seasonid" + FROM + ( + SELECT + * + FROM + ( + WITH right_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore < m.rightscore THEN 1 + ELSE 0 + END) AS "right_won" + , r."A" + , r."B" + , m."gameid" + , m."seasonid" + FROM + "_right" r + JOIN "Match" m ON + r."A" = m.id + GROUP BY + r."A" + , r."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.right_won) AS "right_wins" + , a."B" AS "right_player_id" + , a."gameid" + , a."seasonid" + FROM + right_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + ) rw + UNION ALL + SELECT + * + FROM + ( + WITH left_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore > m.rightscore THEN 1 + ELSE 0 + END) AS "left_won" + , l."A" + , l."B" + , m."gameid" + , m."seasonid" + FROM + "_left" l + JOIN "Match" m ON + l."A" = m.id + GROUP BY + l."A" + , l."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.left_won) AS "left_wins" + , a."B" AS "left_player_id" + , a."gameid" + , a."seasonid" + FROM + left_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + ) lw + ) rt + -- WHERE rt.right_player_id = '' + GROUP BY + rt.right_player_id + , rt.gameid + , rt."seasonid" +) +SELECT + COALESCE(lt.loss_player_id, wt.win_player_id) AS "player_id" + , COALESCE(lt."gameid", wt."gameid") AS "gameid" + , COALESCE(lt.seasonid, wt.seasonid) AS "seasonid" + , wt."total_wins" + , lt."total_losses" +FROM + loss_table lt +FULL OUTER JOIN win_table wt ON + lt."loss_player_id" = wt."win_player_id" + AND lt."gameid" = wt."gameid" + AND lt."seasonid" = wt."seasonid" + ); +17:11:41.306762 [debug] [Thread-1 ]: SQL status: BEGIN in 0.18 seconds +17:11:41.307200 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.number_played_against" +17:11:41.307445 [debug] [Thread-1 ]: On model.wrkplay_dbt.number_played_against: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.number_played_against"} */ + + create view "postgres"."public"."number_played_against__dbt_tmp" as ( + -- 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" + ); +17:11:41.329022 [debug] [Thread-2 ]: SQL status: CREATE VIEW in 0.03 seconds +17:11:41.336525 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +17:11:41.336712 [debug] [Thread-1 ]: SQL status: CREATE VIEW in 0.03 seconds +17:11:41.336781 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ +alter table "postgres"."public"."wins_losses" rename to "wins_losses__dbt_backup" +17:11:41.337902 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.number_played_against" +17:11:41.338054 [debug] [Thread-1 ]: On model.wrkplay_dbt.number_played_against: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.number_played_against"} */ +alter table "postgres"."public"."number_played_against" rename to "number_played_against__dbt_backup" +17:11:41.365956 [debug] [Thread-2 ]: SQL status: ALTER TABLE in 0.03 seconds +17:11:41.371134 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +17:11:41.371238 [debug] [Thread-1 ]: SQL status: ALTER TABLE in 0.03 seconds +17:11:41.371289 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ +alter table "postgres"."public"."wins_losses__dbt_tmp" rename to "wins_losses" +17:11:41.372209 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.number_played_against" +17:11:41.372337 [debug] [Thread-1 ]: On model.wrkplay_dbt.number_played_against: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.number_played_against"} */ +alter table "postgres"."public"."number_played_against__dbt_tmp" rename to "number_played_against" +17:11:41.391260 [debug] [Thread-2 ]: SQL status: ALTER TABLE in 0.02 seconds +17:11:41.391599 [debug] [Thread-1 ]: SQL status: ALTER TABLE in 0.02 seconds +17:11:41.399027 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: COMMIT +17:11:41.399648 [debug] [Thread-1 ]: On model.wrkplay_dbt.number_played_against: COMMIT +17:11:41.399726 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +17:11:41.399791 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.number_played_against" +17:11:41.399848 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: COMMIT +17:11:41.399901 [debug] [Thread-1 ]: On model.wrkplay_dbt.number_played_against: COMMIT +17:11:41.418172 [debug] [Thread-2 ]: SQL status: COMMIT in 0.02 seconds +17:11:41.423482 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +17:11:41.423587 [debug] [Thread-1 ]: SQL status: COMMIT in 0.02 seconds +17:11:41.423637 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ +drop view if exists "postgres"."public"."wins_losses__dbt_backup" cascade +17:11:41.424394 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.number_played_against" +17:11:41.424493 [debug] [Thread-1 ]: On model.wrkplay_dbt.number_played_against: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.number_played_against"} */ +drop view if exists "postgres"."public"."number_played_against__dbt_backup" cascade +17:11:41.446541 [debug] [Thread-2 ]: SQL status: DROP VIEW in 0.02 seconds +17:11:41.446931 [debug] [Thread-1 ]: SQL status: DROP VIEW in 0.02 seconds +17:11:41.449760 [debug] [Thread-2 ]: finished collecting timing info +17:11:41.451387 [debug] [Thread-1 ]: finished collecting timing info +17:11:41.451552 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: Close +17:11:41.451625 [debug] [Thread-1 ]: On model.wrkplay_dbt.number_played_against: Close +17:11:41.452007 [debug] [Thread-2 ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '7857e20c-b857-4917-9daa-151fb8f01a18', 'context': []} +17:11:41.452225 [info ] [Thread-2 ]: 2 of 2 OK created view model public.wins_losses ................................ [CREATE VIEW in 0.35s] +17:11:41.452454 [debug] [Thread-2 ]: Finished running node model.wrkplay_dbt.wins_losses +17:11:41.452698 [debug] [Thread-1 ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '7857e20c-b857-4917-9daa-151fb8f01a18', 'context': []} +17:11:41.452828 [info ] [Thread-1 ]: 1 of 2 OK created view model public.number_played_against ...................... [CREATE VIEW in 0.35s] +17:11:41.452976 [debug] [Thread-1 ]: Finished running node model.wrkplay_dbt.number_played_against +17:11:41.453692 [debug] [MainThread]: Acquiring new postgres connection "master" +17:11:41.453784 [debug] [MainThread]: Using postgres connection "master" +17:11:41.453848 [debug] [MainThread]: On master: BEGIN +17:11:41.453901 [debug] [MainThread]: Opening a new connection, currently in state closed +17:11:41.661758 [debug] [MainThread]: SQL status: BEGIN in 0.21 seconds +17:11:41.663861 [debug] [MainThread]: On master: COMMIT +17:11:41.664242 [debug] [MainThread]: Using postgres connection "master" +17:11:41.664465 [debug] [MainThread]: On master: COMMIT +17:11:41.684164 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +17:11:41.685155 [debug] [MainThread]: On master: Close +17:11:41.686910 [info ] [MainThread]: +17:11:41.687581 [info ] [MainThread]: Finished running 2 view models in 1.58s. +17:11:41.688044 [debug] [MainThread]: Connection 'master' was properly closed. +17:11:41.688200 [debug] [MainThread]: Connection 'model.wrkplay_dbt.number_played_against' was properly closed. +17:11:41.688276 [debug] [MainThread]: Connection 'model.wrkplay_dbt.wins_losses' was properly closed. +17:11:41.691950 [info ] [MainThread]: +17:11:41.692108 [info ] [MainThread]: Completed successfully +17:11:41.692237 [info ] [MainThread]: +17:11:41.692350 [info ] [MainThread]: Done. PASS=2 WARN=0 ERROR=0 SKIP=0 TOTAL=2 +17:11:41.692560 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [, , ]} + + +============================== 2022-07-08 17:12:49.993530 | c7be8485-b86a-4ed7-8aad-a35f5748a3f6 ============================== +17:12:49.993564 [info ] [MainThread]: Running with dbt=1.1.1 +17:12:49.994465 [debug] [MainThread]: running dbt with arguments {'write_json': True, 'use_colors': True, 'printer_width': 80, 'version_check': True, 'partial_parse': True, 'static_parser': True, 'profiles_dir': '/Users/bruno.campos/.dbt', 'send_anonymous_usage_stats': True, 'event_buffer_size': 100000, 'quiet': False, 'no_print': False, 'which': 'run', 'rpc_method': 'run', 'indirect_selection': 'eager'} +17:12:49.994564 [debug] [MainThread]: Tracking: tracking +17:12:50.020150 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [, , ]} +17:12:50.030189 [info ] [MainThread]: Unable to do partial parsing because a project config has changed +17:12:50.030375 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'partial_parser', 'label': 'c7be8485-b86a-4ed7-8aad-a35f5748a3f6', 'context': []} +17:12:50.038393 [debug] [MainThread]: Parsing macros/positive_test.sql +17:12:50.038844 [debug] [MainThread]: Parsing macros/catalog.sql +17:12:50.040418 [debug] [MainThread]: Parsing macros/relations.sql +17:12:50.041130 [debug] [MainThread]: Parsing macros/adapters.sql +17:12:50.054243 [debug] [MainThread]: Parsing macros/materializations/snapshot_merge.sql +17:12:50.055206 [debug] [MainThread]: Parsing macros/materializations/hooks.sql +17:12:50.056962 [debug] [MainThread]: Parsing macros/materializations/configs.sql +17:12:50.057980 [debug] [MainThread]: Parsing macros/materializations/snapshots/snapshot_merge.sql +17:12:50.058730 [debug] [MainThread]: Parsing macros/materializations/snapshots/strategies.sql +17:12:50.066874 [debug] [MainThread]: Parsing macros/materializations/snapshots/helpers.sql +17:12:50.073421 [debug] [MainThread]: Parsing macros/materializations/snapshots/snapshot.sql +17:12:50.078907 [debug] [MainThread]: Parsing macros/materializations/tests/test.sql +17:12:50.080971 [debug] [MainThread]: Parsing macros/materializations/tests/helpers.sql +17:12:50.081789 [debug] [MainThread]: Parsing macros/materializations/tests/where_subquery.sql +17:12:50.082602 [debug] [MainThread]: Parsing macros/materializations/models/incremental/column_helpers.sql +17:12:50.084620 [debug] [MainThread]: Parsing macros/materializations/models/incremental/merge.sql +17:12:50.093142 [debug] [MainThread]: Parsing macros/materializations/models/incremental/is_incremental.sql +17:12:50.093893 [debug] [MainThread]: Parsing macros/materializations/models/incremental/incremental.sql +17:12:50.098922 [debug] [MainThread]: Parsing macros/materializations/models/incremental/on_schema_change.sql +17:12:50.106671 [debug] [MainThread]: Parsing macros/materializations/models/table/table.sql +17:12:50.110430 [debug] [MainThread]: Parsing macros/materializations/models/table/create_table_as.sql +17:12:50.111756 [debug] [MainThread]: Parsing macros/materializations/models/view/view.sql +17:12:50.115341 [debug] [MainThread]: Parsing macros/materializations/models/view/helpers.sql +17:12:50.115932 [debug] [MainThread]: Parsing macros/materializations/models/view/create_or_replace_view.sql +17:12:50.117184 [debug] [MainThread]: Parsing macros/materializations/models/view/create_view_as.sql +17:12:50.118194 [debug] [MainThread]: Parsing macros/materializations/seeds/seed.sql +17:12:50.121056 [debug] [MainThread]: Parsing macros/materializations/seeds/helpers.sql +17:12:50.129128 [debug] [MainThread]: Parsing macros/get_custom_name/get_custom_alias.sql +17:12:50.129803 [debug] [MainThread]: Parsing macros/get_custom_name/get_custom_schema.sql +17:12:50.130928 [debug] [MainThread]: Parsing macros/get_custom_name/get_custom_database.sql +17:12:50.131627 [debug] [MainThread]: Parsing macros/generic_test_sql/relationships.sql +17:12:50.132030 [debug] [MainThread]: Parsing macros/generic_test_sql/not_null.sql +17:12:50.132390 [debug] [MainThread]: Parsing macros/generic_test_sql/unique.sql +17:12:50.132694 [debug] [MainThread]: Parsing macros/generic_test_sql/accepted_values.sql +17:12:50.133309 [debug] [MainThread]: Parsing macros/etc/statement.sql +17:12:50.135342 [debug] [MainThread]: Parsing macros/etc/datetime.sql +17:12:50.139365 [debug] [MainThread]: Parsing macros/adapters/schema.sql +17:12:50.140322 [debug] [MainThread]: Parsing macros/adapters/indexes.sql +17:12:50.141510 [debug] [MainThread]: Parsing macros/adapters/relation.sql +17:12:50.145948 [debug] [MainThread]: Parsing macros/adapters/freshness.sql +17:12:50.147260 [debug] [MainThread]: Parsing macros/adapters/persist_docs.sql +17:12:50.149267 [debug] [MainThread]: Parsing macros/adapters/metadata.sql +17:12:50.152620 [debug] [MainThread]: Parsing macros/adapters/columns.sql +17:12:50.157204 [debug] [MainThread]: Parsing tests/generic/builtin.sql +17:12:50.238380 [debug] [MainThread]: 1699: static parser successfully parsed number_played_against.sql +17:12:50.243504 [debug] [MainThread]: 1699: static parser successfully parsed wins_losses.sql +17:12:50.301289 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': 'c7be8485-b86a-4ed7-8aad-a35f5748a3f6', 'context': []} +17:12:50.303944 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': 'c7be8485-b86a-4ed7-8aad-a35f5748a3f6', 'context': []} +17:12:50.304066 [info ] [MainThread]: Found 2 models, 9 tests, 0 snapshots, 0 analyses, 168 macros, 0 operations, 0 seed files, 0 sources, 0 exposures, 0 metrics +17:12:50.304183 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': 'c7be8485-b86a-4ed7-8aad-a35f5748a3f6', 'context': []} +17:12:50.304742 [info ] [MainThread]: +17:12:50.304930 [debug] [MainThread]: Acquiring new postgres connection "master" +17:12:50.305262 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres" +17:12:50.309467 [debug] [ThreadPool]: Using postgres connection "list_postgres" +17:12:50.309542 [debug] [ThreadPool]: On list_postgres: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres"} */ + + select distinct nspname from pg_namespace + +17:12:50.309597 [debug] [ThreadPool]: Opening a new connection, currently in state init +17:12:50.559504 [debug] [ThreadPool]: SQL status: SELECT 10 in 0.25 seconds +17:12:50.564526 [debug] [ThreadPool]: On list_postgres: Close +17:12:50.565793 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres_public" +17:12:50.569560 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +17:12:50.569646 [debug] [ThreadPool]: On list_postgres_public: BEGIN +17:12:50.569705 [debug] [ThreadPool]: Opening a new connection, currently in state closed +17:12:50.748812 [debug] [ThreadPool]: SQL status: BEGIN in 0.18 seconds +17:12:50.749880 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +17:12:50.750264 [debug] [ThreadPool]: On list_postgres_public: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres_public"} */ +select + 'postgres' as database, + tablename as name, + schemaname as schema, + 'table' as type + from pg_tables + where schemaname ilike 'public' + union all + select + 'postgres' as database, + viewname as name, + schemaname as schema, + 'view' as type + from pg_views + where schemaname ilike 'public' + +17:12:50.775600 [debug] [ThreadPool]: SQL status: SELECT 18 in 0.02 seconds +17:12:50.781761 [debug] [ThreadPool]: On list_postgres_public: ROLLBACK +17:12:50.798342 [debug] [ThreadPool]: On list_postgres_public: Close +17:12:50.805374 [debug] [MainThread]: Using postgres connection "master" +17:12:50.805557 [debug] [MainThread]: On master: BEGIN +17:12:50.805621 [debug] [MainThread]: Opening a new connection, currently in state init +17:12:50.991762 [debug] [MainThread]: SQL status: BEGIN in 0.19 seconds +17:12:50.992604 [debug] [MainThread]: Using postgres connection "master" +17:12:50.992956 [debug] [MainThread]: On master: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "master"} */ +with relation as ( + select + pg_rewrite.ev_class as class, + pg_rewrite.oid as id + from pg_rewrite + ), + class as ( + select + oid as id, + relname as name, + relnamespace as schema, + relkind as kind + from pg_class + ), + dependency as ( + select distinct + pg_depend.objid as id, + pg_depend.refobjid as ref + from pg_depend + ), + schema as ( + select + pg_namespace.oid as id, + pg_namespace.nspname as name + from pg_namespace + where nspname != 'information_schema' and nspname not like 'pg\_%' + ), + referenced as ( + select + relation.id AS id, + referenced_class.name , + referenced_class.schema , + referenced_class.kind + from relation + join class as referenced_class on relation.class=referenced_class.id + where referenced_class.kind in ('r', 'v') + ), + relationships as ( + select + referenced.name as referenced_name, + referenced.schema as referenced_schema_id, + dependent_class.name as dependent_name, + dependent_class.schema as dependent_schema_id, + referenced.kind as kind + from referenced + join dependency on referenced.id=dependency.id + join class as dependent_class on dependency.ref=dependent_class.id + where + (referenced.name != dependent_class.name or + referenced.schema != dependent_class.schema) + ) + + select + referenced_schema.name as referenced_schema, + relationships.referenced_name as referenced_name, + dependent_schema.name as dependent_schema, + relationships.dependent_name as dependent_name + from relationships + join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id + join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id + group by referenced_schema, referenced_name, dependent_schema, dependent_name + order by referenced_schema, referenced_name, dependent_schema, dependent_name; +17:12:51.156815 [debug] [MainThread]: SQL status: SELECT 7 in 0.16 seconds +17:12:51.161866 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': 'c7be8485-b86a-4ed7-8aad-a35f5748a3f6', 'context': []} +17:12:51.162399 [debug] [MainThread]: On master: ROLLBACK +17:12:51.180482 [debug] [MainThread]: Using postgres connection "master" +17:12:51.181188 [debug] [MainThread]: On master: BEGIN +17:12:51.219419 [debug] [MainThread]: SQL status: BEGIN in 0.04 seconds +17:12:51.220601 [debug] [MainThread]: On master: COMMIT +17:12:51.221162 [debug] [MainThread]: Using postgres connection "master" +17:12:51.221505 [debug] [MainThread]: On master: COMMIT +17:12:51.239338 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +17:12:51.240220 [debug] [MainThread]: On master: Close +17:12:51.241874 [info ] [MainThread]: Concurrency: 10 threads (target='dev') +17:12:51.242692 [info ] [MainThread]: +17:12:51.247695 [debug] [Thread-1 ]: Began running node model.wrkplay_dbt.number_played_against +17:12:51.247921 [info ] [Thread-1 ]: 1 of 2 START view model public.number_played_against ........................... [RUN] +17:12:51.248195 [debug] [Thread-1 ]: Acquiring new postgres connection "model.wrkplay_dbt.number_played_against" +17:12:51.248277 [debug] [Thread-1 ]: Began compiling node model.wrkplay_dbt.number_played_against +17:12:51.248364 [debug] [Thread-1 ]: Compiling model.wrkplay_dbt.number_played_against +17:12:51.249436 [debug] [Thread-1 ]: Writing injected SQL for node "model.wrkplay_dbt.number_played_against" +17:12:51.249580 [debug] [Thread-2 ]: Began running node model.wrkplay_dbt.wins_losses +17:12:51.249704 [info ] [Thread-2 ]: 2 of 2 START view model public.wins_losses ..................................... [RUN] +17:12:51.249908 [debug] [Thread-2 ]: Acquiring new postgres connection "model.wrkplay_dbt.wins_losses" +17:12:51.249973 [debug] [Thread-2 ]: Began compiling node model.wrkplay_dbt.wins_losses +17:12:51.250031 [debug] [Thread-2 ]: Compiling model.wrkplay_dbt.wins_losses +17:12:51.250676 [debug] [Thread-2 ]: Writing injected SQL for node "model.wrkplay_dbt.wins_losses" +17:12:51.250910 [debug] [Thread-1 ]: finished collecting timing info +17:12:51.250985 [debug] [Thread-1 ]: Began executing node model.wrkplay_dbt.number_played_against +17:12:51.261451 [debug] [Thread-1 ]: Writing runtime SQL for node "model.wrkplay_dbt.number_played_against" +17:12:51.261691 [debug] [Thread-2 ]: finished collecting timing info +17:12:51.261815 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.number_played_against" +17:12:51.261880 [debug] [Thread-2 ]: Began executing node model.wrkplay_dbt.wins_losses +17:12:51.261975 [debug] [Thread-1 ]: On model.wrkplay_dbt.number_played_against: BEGIN +17:12:51.263110 [debug] [Thread-2 ]: Writing runtime SQL for node "model.wrkplay_dbt.wins_losses" +17:12:51.263206 [debug] [Thread-1 ]: Opening a new connection, currently in state closed +17:12:51.263429 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +17:12:51.263496 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: BEGIN +17:12:51.263546 [debug] [Thread-2 ]: Opening a new connection, currently in state init +17:12:51.439640 [debug] [Thread-2 ]: SQL status: BEGIN in 0.18 seconds +17:12:51.441261 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +17:12:51.441673 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ + + create view "postgres"."public"."wins_losses__dbt_tmp" as ( + --number of wins and losses per player per game (per office) per season +WITH loss_table AS ( + SELECT + SUM(lt.left_losses) AS "total_losses" + , lt.left_player_id AS "loss_player_id" + , lt.gameid + , lt.seasonid + FROM + ( + SELECT + * + FROM + ( + --Begin DONE + WITH left_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore > m.rightscore THEN 0 + ELSE 1 + END) AS "left_loss" + , l."A" + , l."B" + , m."gameid" + , m."seasonid" + FROM + "_left" l + JOIN "Match" m ON + l."A" = m.id + GROUP BY + l."A" + , l."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.left_loss) AS "left_losses" + , a."B" AS "left_player_id" + , a."gameid" + , a."seasonid" + FROM + left_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + --End DONE + ) ll + UNION ALL + SELECT + * + FROM + ( + --Begin DONE + WITH right_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore < m.rightscore THEN 0 + ELSE 1 + END) AS "right_loss" + , r."A" + , r."B" + , m."gameid" + , m."seasonid" + FROM + "_right" r + JOIN "Match" m ON + r."A" = m.id + GROUP BY + r."A" + , r."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.right_loss) AS "right_losses" + , a."B" AS "right_player_id" + , a."gameid" + , a."seasonid" + FROM + right_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + --End DONE + ) rl + ) lt + -- WHERE lt.left_player_id = '' + GROUP BY + lt.left_player_id + , lt.gameid + , lt.seasonid +) +, +win_table AS ( + --number of wins for a player and gameid + SELECT + SUM(rt.right_wins) AS "total_wins" + , rt.right_player_id AS "win_player_id" + , rt.gameid + , rt."seasonid" + FROM + ( + SELECT + * + FROM + ( + WITH right_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore < m.rightscore THEN 1 + ELSE 0 + END) AS "right_won" + , r."A" + , r."B" + , m."gameid" + , m."seasonid" + FROM + "_right" r + JOIN "Match" m ON + r."A" = m.id + GROUP BY + r."A" + , r."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.right_won) AS "right_wins" + , a."B" AS "right_player_id" + , a."gameid" + , a."seasonid" + FROM + right_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + ) rw + UNION ALL + SELECT + * + FROM + ( + WITH left_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore > m.rightscore THEN 1 + ELSE 0 + END) AS "left_won" + , l."A" + , l."B" + , m."gameid" + , m."seasonid" + FROM + "_left" l + JOIN "Match" m ON + l."A" = m.id + GROUP BY + l."A" + , l."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.left_won) AS "left_wins" + , a."B" AS "left_player_id" + , a."gameid" + , a."seasonid" + FROM + left_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + ) lw + ) rt + -- WHERE rt.right_player_id = '' + GROUP BY + rt.right_player_id + , rt.gameid + , rt."seasonid" +) +SELECT + COALESCE(lt.loss_player_id, wt.win_player_id) AS "player_id" + , COALESCE(lt."gameid", wt."gameid") AS "gameid" + , COALESCE(lt.seasonid, wt.seasonid) AS "seasonid" + , wt."total_wins" + , lt."total_losses" +FROM + loss_table lt +FULL OUTER JOIN win_table wt ON + lt."loss_player_id" = wt."win_player_id" + AND lt."gameid" = wt."gameid" + AND lt."seasonid" = wt."seasonid" + ); +17:12:51.454436 [debug] [Thread-1 ]: SQL status: BEGIN in 0.19 seconds +17:12:51.455127 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.number_played_against" +17:12:51.455340 [debug] [Thread-1 ]: On model.wrkplay_dbt.number_played_against: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.number_played_against"} */ + + create view "postgres"."public"."number_played_against__dbt_tmp" as ( + -- 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" + ); +17:12:51.476159 [debug] [Thread-2 ]: SQL status: CREATE VIEW in 0.03 seconds +17:12:51.483508 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +17:12:51.483654 [debug] [Thread-1 ]: SQL status: CREATE VIEW in 0.03 seconds +17:12:51.483808 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ +alter table "postgres"."public"."wins_losses" rename to "wins_losses__dbt_backup" +17:12:51.484908 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.number_played_against" +17:12:51.485060 [debug] [Thread-1 ]: On model.wrkplay_dbt.number_played_against: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.number_played_against"} */ +alter table "postgres"."public"."number_played_against" rename to "number_played_against__dbt_backup" +17:12:51.502679 [debug] [Thread-2 ]: SQL status: ALTER TABLE in 0.02 seconds +17:12:51.507453 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +17:12:51.507536 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ +alter table "postgres"."public"."wins_losses__dbt_tmp" rename to "wins_losses" +17:12:51.507609 [debug] [Thread-1 ]: SQL status: ALTER TABLE in 0.02 seconds +17:12:51.508536 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.number_played_against" +17:12:51.508599 [debug] [Thread-1 ]: On model.wrkplay_dbt.number_played_against: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.number_played_against"} */ +alter table "postgres"."public"."number_played_against__dbt_tmp" rename to "number_played_against" +17:12:51.525760 [debug] [Thread-2 ]: SQL status: ALTER TABLE in 0.02 seconds +17:12:51.533128 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: COMMIT +17:12:51.533219 [debug] [Thread-1 ]: SQL status: ALTER TABLE in 0.02 seconds +17:12:51.533269 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +17:12:51.533742 [debug] [Thread-1 ]: On model.wrkplay_dbt.number_played_against: COMMIT +17:12:51.533812 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: COMMIT +17:12:51.533869 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.number_played_against" +17:12:51.533955 [debug] [Thread-1 ]: On model.wrkplay_dbt.number_played_against: COMMIT +17:12:51.552888 [debug] [Thread-2 ]: SQL status: COMMIT in 0.02 seconds +17:12:51.561267 [debug] [Thread-1 ]: SQL status: COMMIT in 0.03 seconds +17:12:51.561193 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +17:12:51.562000 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.number_played_against" +17:12:51.562077 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ +drop view if exists "postgres"."public"."wins_losses__dbt_backup" cascade +17:12:51.562139 [debug] [Thread-1 ]: On model.wrkplay_dbt.number_played_against: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.number_played_against"} */ +drop view if exists "postgres"."public"."number_played_against__dbt_backup" cascade +17:12:51.585594 [debug] [Thread-2 ]: SQL status: DROP VIEW in 0.02 seconds +17:12:51.589819 [debug] [Thread-2 ]: finished collecting timing info +17:12:51.591313 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: Close +17:12:51.591512 [debug] [Thread-1 ]: SQL status: DROP VIEW in 0.03 seconds +17:12:51.592816 [debug] [Thread-1 ]: finished collecting timing info +17:12:51.592926 [debug] [Thread-1 ]: On model.wrkplay_dbt.number_played_against: Close +17:12:51.593183 [debug] [Thread-2 ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c7be8485-b86a-4ed7-8aad-a35f5748a3f6', 'context': []} +17:12:51.593338 [debug] [Thread-1 ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': 'c7be8485-b86a-4ed7-8aad-a35f5748a3f6', 'context': []} +17:12:51.593535 [info ] [Thread-2 ]: 2 of 2 OK created view model public.wins_losses ................................ [CREATE VIEW in 0.34s] +17:12:51.593694 [info ] [Thread-1 ]: 1 of 2 OK created view model public.number_played_against ...................... [CREATE VIEW in 0.35s] +17:12:51.593939 [debug] [Thread-2 ]: Finished running node model.wrkplay_dbt.wins_losses +17:12:51.594090 [debug] [Thread-1 ]: Finished running node model.wrkplay_dbt.number_played_against +17:12:51.594881 [debug] [MainThread]: Acquiring new postgres connection "master" +17:12:51.594983 [debug] [MainThread]: Using postgres connection "master" +17:12:51.595041 [debug] [MainThread]: On master: BEGIN +17:12:51.595092 [debug] [MainThread]: Opening a new connection, currently in state closed +17:12:51.792874 [debug] [MainThread]: SQL status: BEGIN in 0.2 seconds +17:12:51.794314 [debug] [MainThread]: On master: COMMIT +17:12:51.795194 [debug] [MainThread]: Using postgres connection "master" +17:12:51.795478 [debug] [MainThread]: On master: COMMIT +17:12:51.814310 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +17:12:51.815124 [debug] [MainThread]: On master: Close +17:12:51.816862 [info ] [MainThread]: +17:12:51.817499 [info ] [MainThread]: Finished running 2 view models in 1.51s. +17:12:51.817818 [debug] [MainThread]: Connection 'master' was properly closed. +17:12:51.817989 [debug] [MainThread]: Connection 'model.wrkplay_dbt.number_played_against' was properly closed. +17:12:51.818147 [debug] [MainThread]: Connection 'model.wrkplay_dbt.wins_losses' was properly closed. +17:12:51.822193 [info ] [MainThread]: +17:12:51.822413 [info ] [MainThread]: Completed successfully +17:12:51.822537 [info ] [MainThread]: +17:12:51.822627 [info ] [MainThread]: Done. PASS=2 WARN=0 ERROR=0 SKIP=0 TOTAL=2 +17:12:51.822813 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [, , ]} + + +============================== 2022-07-11 08:45:24.194684 | e1ecc8fe-243e-49e3-94e1-29d46bb8d9c3 ============================== +08:45:24.194708 [info ] [MainThread]: Running with dbt=1.1.1 +08:45:24.195340 [debug] [MainThread]: running dbt with arguments {'write_json': True, 'use_colors': True, 'printer_width': 80, 'version_check': True, 'partial_parse': True, 'static_parser': True, 'profiles_dir': '/Users/bruno.campos/.dbt', 'send_anonymous_usage_stats': True, 'event_buffer_size': 100000, 'quiet': False, 'no_print': False, 'compile': True, 'which': 'generate', 'rpc_method': 'docs.generate', 'indirect_selection': 'eager'} +08:45:24.195431 [debug] [MainThread]: Tracking: tracking +08:45:24.224103 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [, , ]} +08:45:24.245822 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 0 files changed. +08:45:24.246006 [debug] [MainThread]: Partial parsing enabled, no changes found, skipping parsing +08:45:24.250279 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': 'e1ecc8fe-243e-49e3-94e1-29d46bb8d9c3', 'context': []} +08:45:24.254260 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': 'e1ecc8fe-243e-49e3-94e1-29d46bb8d9c3', 'context': []} +08:45:24.254497 [info ] [MainThread]: Found 2 models, 9 tests, 0 snapshots, 0 analyses, 168 macros, 0 operations, 0 seed files, 0 sources, 0 exposures, 0 metrics +08:45:24.254644 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': 'e1ecc8fe-243e-49e3-94e1-29d46bb8d9c3', 'context': []} +08:45:24.255582 [info ] [MainThread]: +08:45:24.255839 [debug] [MainThread]: Acquiring new postgres connection "master" +08:45:24.256255 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres_public" +08:45:24.261097 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +08:45:24.261250 [debug] [ThreadPool]: On list_postgres_public: BEGIN +08:45:24.261324 [debug] [ThreadPool]: Opening a new connection, currently in state init +08:45:24.694310 [debug] [ThreadPool]: SQL status: BEGIN in 0.43 seconds +08:45:24.694772 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +08:45:24.694938 [debug] [ThreadPool]: On list_postgres_public: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres_public"} */ +select + 'postgres' as database, + tablename as name, + schemaname as schema, + 'table' as type + from pg_tables + where schemaname ilike 'public' + union all + select + 'postgres' as database, + viewname as name, + schemaname as schema, + 'view' as type + from pg_views + where schemaname ilike 'public' + +08:45:24.910019 [debug] [ThreadPool]: SQL status: SELECT 18 in 0.21 seconds +08:45:24.913481 [debug] [ThreadPool]: On list_postgres_public: ROLLBACK +08:45:24.957374 [debug] [ThreadPool]: On list_postgres_public: Close +08:45:24.962935 [debug] [MainThread]: Using postgres connection "master" +08:45:24.963063 [debug] [MainThread]: On master: BEGIN +08:45:24.963134 [debug] [MainThread]: Opening a new connection, currently in state init +08:45:25.604049 [debug] [MainThread]: SQL status: BEGIN in 0.64 seconds +08:45:25.604743 [debug] [MainThread]: Using postgres connection "master" +08:45:25.604998 [debug] [MainThread]: On master: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "master"} */ +with relation as ( + select + pg_rewrite.ev_class as class, + pg_rewrite.oid as id + from pg_rewrite + ), + class as ( + select + oid as id, + relname as name, + relnamespace as schema, + relkind as kind + from pg_class + ), + dependency as ( + select distinct + pg_depend.objid as id, + pg_depend.refobjid as ref + from pg_depend + ), + schema as ( + select + pg_namespace.oid as id, + pg_namespace.nspname as name + from pg_namespace + where nspname != 'information_schema' and nspname not like 'pg\_%' + ), + referenced as ( + select + relation.id AS id, + referenced_class.name , + referenced_class.schema , + referenced_class.kind + from relation + join class as referenced_class on relation.class=referenced_class.id + where referenced_class.kind in ('r', 'v') + ), + relationships as ( + select + referenced.name as referenced_name, + referenced.schema as referenced_schema_id, + dependent_class.name as dependent_name, + dependent_class.schema as dependent_schema_id, + referenced.kind as kind + from referenced + join dependency on referenced.id=dependency.id + join class as dependent_class on dependency.ref=dependent_class.id + where + (referenced.name != dependent_class.name or + referenced.schema != dependent_class.schema) + ) + + select + referenced_schema.name as referenced_schema, + relationships.referenced_name as referenced_name, + dependent_schema.name as dependent_schema, + relationships.dependent_name as dependent_name + from relationships + join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id + join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id + group by referenced_schema, referenced_name, dependent_schema, dependent_name + order by referenced_schema, referenced_name, dependent_schema, dependent_name; +08:45:25.778882 [debug] [MainThread]: SQL status: SELECT 7 in 0.17 seconds +08:45:25.782280 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': 'e1ecc8fe-243e-49e3-94e1-29d46bb8d9c3', 'context': []} +08:45:25.782928 [debug] [MainThread]: On master: ROLLBACK +08:45:25.953203 [debug] [MainThread]: On master: Close +08:45:25.955916 [info ] [MainThread]: Concurrency: 10 threads (target='dev') +08:45:25.956861 [info ] [MainThread]: +08:45:25.961363 [debug] [Thread-1 ]: Began running node model.wrkplay_dbt.number_played_against +08:45:25.961456 [debug] [Thread-2 ]: Began running node model.wrkplay_dbt.wins_losses +08:45:25.961681 [debug] [Thread-1 ]: Acquiring new postgres connection "model.wrkplay_dbt.number_played_against" +08:45:25.961840 [debug] [Thread-2 ]: Acquiring new postgres connection "model.wrkplay_dbt.wins_losses" +08:45:25.961922 [debug] [Thread-1 ]: Began compiling node model.wrkplay_dbt.number_played_against +08:45:25.962005 [debug] [Thread-2 ]: Began compiling node model.wrkplay_dbt.wins_losses +08:45:25.962097 [debug] [Thread-1 ]: Compiling model.wrkplay_dbt.number_played_against +08:45:25.962160 [debug] [Thread-2 ]: Compiling model.wrkplay_dbt.wins_losses +08:45:25.962917 [debug] [Thread-1 ]: Writing injected SQL for node "model.wrkplay_dbt.number_played_against" +08:45:25.963523 [debug] [Thread-2 ]: Writing injected SQL for node "model.wrkplay_dbt.wins_losses" +08:45:25.964059 [debug] [Thread-2 ]: finished collecting timing info +08:45:25.964159 [debug] [Thread-2 ]: Began executing node model.wrkplay_dbt.wins_losses +08:45:25.964234 [debug] [Thread-2 ]: finished collecting timing info +08:45:25.964280 [debug] [Thread-1 ]: finished collecting timing info +08:45:25.964503 [debug] [Thread-2 ]: Finished running node model.wrkplay_dbt.wins_losses +08:45:25.964593 [debug] [Thread-1 ]: Began executing node model.wrkplay_dbt.number_played_against +08:45:25.964818 [debug] [Thread-4 ]: Began running node test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +08:45:25.964873 [debug] [Thread-1 ]: finished collecting timing info +08:45:25.964924 [debug] [Thread-5 ]: Began running node test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +08:45:25.964976 [debug] [Thread-6 ]: Began running node test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +08:45:25.965024 [debug] [Thread-7 ]: Began running node test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe +08:45:25.965091 [debug] [Thread-8 ]: Began running node test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77 +08:45:25.965209 [debug] [Thread-4 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +08:45:25.965379 [debug] [Thread-1 ]: Finished running node model.wrkplay_dbt.number_played_against +08:45:25.965502 [debug] [Thread-5 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +08:45:25.965678 [debug] [Thread-6 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +08:45:25.965792 [debug] [Thread-7 ]: Acquiring new postgres connection "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe" +08:45:25.965907 [debug] [Thread-8 ]: Acquiring new postgres connection "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77" +08:45:25.965968 [debug] [Thread-4 ]: Began compiling node test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +08:45:25.966118 [debug] [Thread-5 ]: Began compiling node test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +08:45:25.966176 [debug] [Thread-10 ]: Began running node test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c +08:45:25.966226 [debug] [Thread-3 ]: Began running node test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427 +08:45:25.966279 [debug] [Thread-2 ]: Began running node test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073 +08:45:25.966325 [debug] [Thread-6 ]: Began compiling node test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +08:45:25.966376 [debug] [Thread-9 ]: Began running node test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20 +08:45:25.966431 [debug] [Thread-7 ]: Began compiling node test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe +08:45:25.966487 [debug] [Thread-8 ]: Began compiling node test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77 +08:45:25.966544 [debug] [Thread-4 ]: Compiling test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +08:45:25.966600 [debug] [Thread-5 ]: Compiling test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +08:45:25.966711 [debug] [Thread-10 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c" +08:45:25.966821 [debug] [Thread-3 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427" +08:45:25.966926 [debug] [Thread-2 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073" +08:45:25.966985 [debug] [Thread-6 ]: Compiling test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +08:45:25.967133 [debug] [Thread-9 ]: Acquiring new postgres connection "test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20" +08:45:25.967201 [debug] [Thread-7 ]: Compiling test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe +08:45:25.967278 [debug] [Thread-8 ]: Compiling test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77 +08:45:25.973136 [debug] [Thread-4 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +08:45:25.974587 [debug] [Thread-5 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +08:45:25.974675 [debug] [Thread-10 ]: Began compiling node test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c +08:45:25.974739 [debug] [Thread-3 ]: Began compiling node test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427 +08:45:25.974795 [debug] [Thread-2 ]: Began compiling node test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073 +08:45:25.976688 [debug] [Thread-6 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +08:45:25.976770 [debug] [Thread-9 ]: Began compiling node test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20 +08:45:25.978489 [debug] [Thread-7 ]: Writing injected SQL for node "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe" +08:45:25.979694 [debug] [Thread-8 ]: Writing injected SQL for node "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77" +08:45:25.979888 [debug] [Thread-10 ]: Compiling test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c +08:45:25.979954 [debug] [Thread-3 ]: Compiling test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427 +08:45:25.980029 [debug] [Thread-2 ]: Compiling test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073 +08:45:25.980131 [debug] [Thread-9 ]: Compiling test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20 +08:45:25.981757 [debug] [Thread-10 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c" +08:45:25.983270 [debug] [Thread-3 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427" +08:45:25.983423 [debug] [Thread-8 ]: finished collecting timing info +08:45:25.984820 [debug] [Thread-2 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073" +08:45:25.984885 [debug] [Thread-6 ]: finished collecting timing info +08:45:25.984942 [debug] [Thread-7 ]: finished collecting timing info +08:45:25.984998 [debug] [Thread-4 ]: finished collecting timing info +08:45:25.985046 [debug] [Thread-5 ]: finished collecting timing info +08:45:25.986369 [debug] [Thread-9 ]: Writing injected SQL for node "test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20" +08:45:25.986547 [debug] [Thread-8 ]: Began executing node test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77 +08:45:25.986752 [debug] [Thread-6 ]: Began executing node test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +08:45:25.986831 [debug] [Thread-10 ]: finished collecting timing info +08:45:25.986887 [debug] [Thread-7 ]: Began executing node test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe +08:45:25.986948 [debug] [Thread-3 ]: finished collecting timing info +08:45:25.987041 [debug] [Thread-4 ]: Began executing node test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +08:45:25.987090 [debug] [Thread-2 ]: finished collecting timing info +08:45:25.987154 [debug] [Thread-5 ]: Began executing node test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +08:45:25.987261 [debug] [Thread-8 ]: finished collecting timing info +08:45:25.987323 [debug] [Thread-6 ]: finished collecting timing info +08:45:25.987394 [debug] [Thread-10 ]: Began executing node test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c +08:45:25.987462 [debug] [Thread-7 ]: finished collecting timing info +08:45:25.987510 [debug] [Thread-9 ]: finished collecting timing info +08:45:25.987566 [debug] [Thread-3 ]: Began executing node test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427 +08:45:25.987626 [debug] [Thread-4 ]: finished collecting timing info +08:45:25.987691 [debug] [Thread-2 ]: Began executing node test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073 +08:45:25.987749 [debug] [Thread-5 ]: finished collecting timing info +08:45:25.987940 [debug] [Thread-8 ]: Finished running node test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77 +08:45:25.988101 [debug] [Thread-6 ]: Finished running node test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +08:45:25.988170 [debug] [Thread-10 ]: finished collecting timing info +08:45:25.988315 [debug] [Thread-7 ]: Finished running node test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe +08:45:25.988378 [debug] [Thread-9 ]: Began executing node test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20 +08:45:25.988437 [debug] [Thread-3 ]: finished collecting timing info +08:45:25.988580 [debug] [Thread-4 ]: Finished running node test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +08:45:25.988646 [debug] [Thread-2 ]: finished collecting timing info +08:45:25.988782 [debug] [Thread-5 ]: Finished running node test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +08:45:25.989016 [debug] [Thread-10 ]: Finished running node test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c +08:45:25.989119 [debug] [Thread-9 ]: finished collecting timing info +08:45:25.989265 [debug] [Thread-3 ]: Finished running node test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427 +08:45:25.989443 [debug] [Thread-2 ]: Finished running node test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073 +08:45:25.989671 [debug] [Thread-9 ]: Finished running node test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20 +08:45:25.990278 [debug] [MainThread]: Connection 'master' was properly closed. +08:45:25.990339 [debug] [MainThread]: Connection 'model.wrkplay_dbt.number_played_against' was properly closed. +08:45:25.990390 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073' was properly closed. +08:45:25.990437 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1' was properly closed. +08:45:25.990484 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15' was properly closed. +08:45:25.990530 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813' was properly closed. +08:45:25.990574 [debug] [MainThread]: Connection 'test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe' was properly closed. +08:45:25.990619 [debug] [MainThread]: Connection 'test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77' was properly closed. +08:45:25.990662 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c' was properly closed. +08:45:25.990705 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427' was properly closed. +08:45:25.990747 [debug] [MainThread]: Connection 'test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20' was properly closed. +08:45:25.993186 [info ] [MainThread]: Done. +08:45:25.994647 [debug] [MainThread]: Acquiring new postgres connection "generate_catalog" +08:45:25.994733 [info ] [MainThread]: Building catalog +08:45:25.995247 [debug] [ThreadPool]: Acquiring new postgres connection "postgres.information_schema" +08:45:25.998360 [debug] [ThreadPool]: Using postgres connection "postgres.information_schema" +08:45:25.998443 [debug] [ThreadPool]: On postgres.information_schema: BEGIN +08:45:25.998499 [debug] [ThreadPool]: Opening a new connection, currently in state init +08:45:26.613950 [debug] [ThreadPool]: SQL status: BEGIN in 0.62 seconds +08:45:26.614430 [debug] [ThreadPool]: Using postgres connection "postgres.information_schema" +08:45:26.614774 [debug] [ThreadPool]: On postgres.information_schema: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "postgres.information_schema"} */ + + + + + select + 'postgres' as table_database, + sch.nspname as table_schema, + tbl.relname as table_name, + case tbl.relkind + when 'v' then 'VIEW' + else 'BASE TABLE' + end as table_type, + tbl_desc.description as table_comment, + col.attname as column_name, + col.attnum as column_index, + pg_catalog.format_type(col.atttypid, col.atttypmod) as column_type, + col_desc.description as column_comment, + pg_get_userbyid(tbl.relowner) as table_owner + + from pg_catalog.pg_namespace sch + join pg_catalog.pg_class tbl on tbl.relnamespace = sch.oid + join pg_catalog.pg_attribute col on col.attrelid = tbl.oid + left outer join pg_catalog.pg_description tbl_desc on (tbl_desc.objoid = tbl.oid and tbl_desc.objsubid = 0) + left outer join pg_catalog.pg_description col_desc on (col_desc.objoid = tbl.oid and col_desc.objsubid = col.attnum) + + where (upper(sch.nspname) = upper('public')) + and not pg_is_other_temp_schema(sch.oid) -- not a temporary schema belonging to another session + and tbl.relpersistence in ('p', 'u') -- [p]ermanent table or [u]nlogged table. Exclude [t]emporary tables + and tbl.relkind in ('r', 'v', 'f', 'p') -- o[r]dinary table, [v]iew, [f]oreign table, [p]artitioned table. Other values are [i]ndex, [S]equence, [c]omposite type, [t]OAST table, [m]aterialized view + and col.attnum > 0 -- negative numbers are used for system columns such as oid + and not col.attisdropped -- column as not been dropped + + order by + sch.nspname, + tbl.relname, + col.attnum +08:45:26.678956 [debug] [ThreadPool]: SQL status: SELECT 92 in 0.06 seconds +08:45:26.689072 [debug] [ThreadPool]: On postgres.information_schema: ROLLBACK +08:45:26.763956 [debug] [ThreadPool]: On postgres.information_schema: Close +08:45:26.771930 [info ] [MainThread]: Catalog written to /Users/bruno.campos/Documents/Documents - MACQ199NQ496F/saltplay/wrkplay_dbt/target/catalog.json +08:45:26.772165 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [, , ]} +08:45:27.406644 [debug] [MainThread]: Connection 'generate_catalog' was properly closed. +08:45:27.407376 [debug] [MainThread]: Connection 'postgres.information_schema' was properly closed. + + +============================== 2022-07-11 08:45:36.489150 | 561a10e2-d2fb-4579-98f1-9643e72ca294 ============================== +08:45:36.489185 [info ] [MainThread]: Running with dbt=1.1.1 +08:45:36.489740 [debug] [MainThread]: running dbt with arguments {'write_json': True, 'use_colors': True, 'printer_width': 80, 'version_check': True, 'partial_parse': True, 'static_parser': True, 'profiles_dir': '/Users/bruno.campos/.dbt', 'send_anonymous_usage_stats': True, 'event_buffer_size': 100000, 'quiet': False, 'no_print': False, 'port': 8080, 'open_browser': True, 'which': 'serve', 'indirect_selection': 'eager'} +08:45:36.489858 [debug] [MainThread]: Tracking: tracking +08:45:36.505912 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [, , ]} +08:45:36.508384 [info ] [MainThread]: Serving docs at 0.0.0.0:8080 +08:45:36.508612 [info ] [MainThread]: To access from your browser, navigate to: http://localhost:8080 +08:45:36.508733 [info ] [MainThread]: +08:45:36.508827 [info ] [MainThread]: +08:45:36.508915 [info ] [MainThread]: Press Ctrl+C to exit. + + +============================== 2022-07-11 14:43:22.893605 | 9e1a48b9-6ed9-4527-98eb-26f2ae90997f ============================== +14:43:22.893630 [info ] [MainThread]: Running with dbt=1.1.1 +14:43:22.894465 [debug] [MainThread]: running dbt with arguments {'write_json': True, 'use_colors': True, 'printer_width': 80, 'version_check': True, 'partial_parse': True, 'static_parser': True, 'profiles_dir': '/Users/bruno.campos/.dbt', 'send_anonymous_usage_stats': True, 'event_buffer_size': 100000, 'quiet': False, 'no_print': False, 'which': 'run', 'rpc_method': 'run', 'indirect_selection': 'eager'} +14:43:22.894550 [debug] [MainThread]: Tracking: tracking +14:43:22.912469 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [, , ]} +14:43:22.931617 [debug] [MainThread]: Partial parsing enabled: 3 files deleted, 4 files added, 0 files changed. +14:43:22.931797 [debug] [MainThread]: Partial parsing: added file: wrkplay_dbt://models/marts/number_played_against.sql +14:43:22.931892 [debug] [MainThread]: Partial parsing: added file: wrkplay_dbt://macros/column_not_empty_test.sql +14:43:22.932022 [debug] [MainThread]: Partial parsing: added file: wrkplay_dbt://models/marts/schema.yml +14:43:22.932099 [debug] [MainThread]: Partial parsing: added file: wrkplay_dbt://models/marts/wins_losses.sql +14:43:22.932186 [debug] [MainThread]: Partial parsing: deleted file: wrkplay_dbt://models/wins_losses.sql +14:43:22.932242 [debug] [MainThread]: Partial parsing: deleted file: wrkplay_dbt://models/number_played_against.sql +14:43:22.932312 [debug] [MainThread]: Parsing macros/column_not_empty_test.sql +14:43:22.939822 [debug] [MainThread]: 1699: static parser successfully parsed marts/number_played_against.sql +14:43:22.945878 [debug] [MainThread]: 1699: static parser successfully parsed marts/wins_losses.sql +14:43:22.972900 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '9e1a48b9-6ed9-4527-98eb-26f2ae90997f', 'context': []} +14:43:22.975788 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '9e1a48b9-6ed9-4527-98eb-26f2ae90997f', 'context': []} +14:43:22.975930 [info ] [MainThread]: Found 2 models, 9 tests, 0 snapshots, 0 analyses, 169 macros, 0 operations, 0 seed files, 0 sources, 0 exposures, 0 metrics +14:43:22.976055 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '9e1a48b9-6ed9-4527-98eb-26f2ae90997f', 'context': []} +14:43:22.976707 [info ] [MainThread]: +14:43:22.976899 [debug] [MainThread]: Acquiring new postgres connection "master" +14:43:22.977241 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres" +14:43:22.981478 [debug] [ThreadPool]: Using postgres connection "list_postgres" +14:43:22.981552 [debug] [ThreadPool]: On list_postgres: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres"} */ + + select distinct nspname from pg_namespace + +14:43:22.981612 [debug] [ThreadPool]: Opening a new connection, currently in state init +14:43:23.363085 [debug] [ThreadPool]: SQL status: SELECT 10 in 0.38 seconds +14:43:23.367721 [debug] [ThreadPool]: On list_postgres: Close +14:43:23.371038 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres_public" +14:43:23.374448 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +14:43:23.374538 [debug] [ThreadPool]: On list_postgres_public: BEGIN +14:43:23.374597 [debug] [ThreadPool]: Opening a new connection, currently in state closed +14:43:23.801712 [debug] [ThreadPool]: SQL status: BEGIN in 0.43 seconds +14:43:23.802764 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +14:43:23.803301 [debug] [ThreadPool]: On list_postgres_public: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres_public"} */ +select + 'postgres' as database, + tablename as name, + schemaname as schema, + 'table' as type + from pg_tables + where schemaname ilike 'public' + union all + select + 'postgres' as database, + viewname as name, + schemaname as schema, + 'view' as type + from pg_views + where schemaname ilike 'public' + +14:43:23.859202 [debug] [ThreadPool]: SQL status: SELECT 18 in 0.06 seconds +14:43:23.864264 [debug] [ThreadPool]: On list_postgres_public: ROLLBACK +14:43:23.892691 [debug] [ThreadPool]: On list_postgres_public: Close +14:43:23.906221 [debug] [MainThread]: Using postgres connection "master" +14:43:23.906598 [debug] [MainThread]: On master: BEGIN +14:43:23.906684 [debug] [MainThread]: Opening a new connection, currently in state init +14:43:24.273864 [debug] [MainThread]: SQL status: BEGIN in 0.37 seconds +14:43:24.275394 [debug] [MainThread]: Using postgres connection "master" +14:43:24.275789 [debug] [MainThread]: On master: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "master"} */ +with relation as ( + select + pg_rewrite.ev_class as class, + pg_rewrite.oid as id + from pg_rewrite + ), + class as ( + select + oid as id, + relname as name, + relnamespace as schema, + relkind as kind + from pg_class + ), + dependency as ( + select distinct + pg_depend.objid as id, + pg_depend.refobjid as ref + from pg_depend + ), + schema as ( + select + pg_namespace.oid as id, + pg_namespace.nspname as name + from pg_namespace + where nspname != 'information_schema' and nspname not like 'pg\_%' + ), + referenced as ( + select + relation.id AS id, + referenced_class.name , + referenced_class.schema , + referenced_class.kind + from relation + join class as referenced_class on relation.class=referenced_class.id + where referenced_class.kind in ('r', 'v') + ), + relationships as ( + select + referenced.name as referenced_name, + referenced.schema as referenced_schema_id, + dependent_class.name as dependent_name, + dependent_class.schema as dependent_schema_id, + referenced.kind as kind + from referenced + join dependency on referenced.id=dependency.id + join class as dependent_class on dependency.ref=dependent_class.id + where + (referenced.name != dependent_class.name or + referenced.schema != dependent_class.schema) + ) + + select + referenced_schema.name as referenced_schema, + relationships.referenced_name as referenced_name, + dependent_schema.name as dependent_schema, + relationships.dependent_name as dependent_name + from relationships + join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id + join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id + group by referenced_schema, referenced_name, dependent_schema, dependent_name + order by referenced_schema, referenced_name, dependent_schema, dependent_name; +14:43:24.441720 [debug] [MainThread]: SQL status: SELECT 7 in 0.17 seconds +14:43:24.469243 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '9e1a48b9-6ed9-4527-98eb-26f2ae90997f', 'context': []} +14:43:24.469816 [debug] [MainThread]: On master: ROLLBACK +14:43:24.506221 [debug] [MainThread]: Using postgres connection "master" +14:43:24.506529 [debug] [MainThread]: On master: BEGIN +14:43:24.545134 [debug] [MainThread]: SQL status: BEGIN in 0.04 seconds +14:43:24.545774 [debug] [MainThread]: On master: COMMIT +14:43:24.546147 [debug] [MainThread]: Using postgres connection "master" +14:43:24.546479 [debug] [MainThread]: On master: COMMIT +14:43:24.565126 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +14:43:24.565772 [debug] [MainThread]: On master: Close +14:43:24.567019 [info ] [MainThread]: Concurrency: 10 threads (target='dev') +14:43:24.567800 [info ] [MainThread]: +14:43:24.575841 [debug] [Thread-1 ]: Began running node model.wrkplay_dbt.number_played_against +14:43:24.576020 [info ] [Thread-1 ]: 1 of 2 START view model public.number_played_against ........................... [RUN] +14:43:24.576249 [debug] [Thread-1 ]: Acquiring new postgres connection "model.wrkplay_dbt.number_played_against" +14:43:24.576320 [debug] [Thread-1 ]: Began compiling node model.wrkplay_dbt.number_played_against +14:43:24.576413 [debug] [Thread-1 ]: Compiling model.wrkplay_dbt.number_played_against +14:43:24.577164 [debug] [Thread-1 ]: Writing injected SQL for node "model.wrkplay_dbt.number_played_against" +14:43:24.577274 [debug] [Thread-2 ]: Began running node model.wrkplay_dbt.wins_losses +14:43:24.577397 [info ] [Thread-2 ]: 2 of 2 START view model public.wins_losses ..................................... [RUN] +14:43:24.577584 [debug] [Thread-2 ]: Acquiring new postgres connection "model.wrkplay_dbt.wins_losses" +14:43:24.577653 [debug] [Thread-2 ]: Began compiling node model.wrkplay_dbt.wins_losses +14:43:24.577746 [debug] [Thread-2 ]: Compiling model.wrkplay_dbt.wins_losses +14:43:24.578428 [debug] [Thread-2 ]: Writing injected SQL for node "model.wrkplay_dbt.wins_losses" +14:43:24.578529 [debug] [Thread-1 ]: finished collecting timing info +14:43:24.578611 [debug] [Thread-1 ]: Began executing node model.wrkplay_dbt.number_played_against +14:43:24.589760 [debug] [Thread-1 ]: Writing runtime SQL for node "model.wrkplay_dbt.number_played_against" +14:43:24.589852 [debug] [Thread-2 ]: finished collecting timing info +14:43:24.590003 [debug] [Thread-2 ]: Began executing node model.wrkplay_dbt.wins_losses +14:43:24.612659 [debug] [Thread-2 ]: Writing runtime SQL for node "model.wrkplay_dbt.wins_losses" +14:43:24.612837 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.number_played_against" +14:43:24.612948 [debug] [Thread-1 ]: On model.wrkplay_dbt.number_played_against: BEGIN +14:43:24.613032 [debug] [Thread-1 ]: Opening a new connection, currently in state closed +14:43:24.613180 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +14:43:24.613248 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: BEGIN +14:43:24.613301 [debug] [Thread-2 ]: Opening a new connection, currently in state init +14:43:25.034229 [debug] [Thread-2 ]: SQL status: BEGIN in 0.42 seconds +14:43:25.035073 [debug] [Thread-1 ]: SQL status: BEGIN in 0.42 seconds +14:43:25.035855 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +14:43:25.036242 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.number_played_against" +14:43:25.036639 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ + + create view "postgres"."public"."wins_losses__dbt_tmp" as ( + --number of wins and losses per player per game (per office) per season +WITH loss_table AS ( + SELECT + SUM(lt.left_losses) AS "total_losses" + , lt.left_player_id AS "loss_player_id" + , lt.gameid + , lt.seasonid + FROM + ( + SELECT + * + FROM + ( + --Begin DONE + WITH left_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore > m.rightscore THEN 0 + ELSE 1 + END) AS "left_loss" + , l."A" + , l."B" + , m."gameid" + , m."seasonid" + FROM + "_left" l + JOIN "Match" m ON + l."A" = m.id + GROUP BY + l."A" + , l."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.left_loss) AS "left_losses" + , a."B" AS "left_player_id" + , a."gameid" + , a."seasonid" + FROM + left_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + --End DONE + ) ll + UNION ALL + SELECT + * + FROM + ( + --Begin DONE + WITH right_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore < m.rightscore THEN 0 + ELSE 1 + END) AS "right_loss" + , r."A" + , r."B" + , m."gameid" + , m."seasonid" + FROM + "_right" r + JOIN "Match" m ON + r."A" = m.id + GROUP BY + r."A" + , r."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.right_loss) AS "right_losses" + , a."B" AS "right_player_id" + , a."gameid" + , a."seasonid" + FROM + right_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + --End DONE + ) rl + ) lt + -- WHERE lt.left_player_id = '' + GROUP BY + lt.left_player_id + , lt.gameid + , lt.seasonid +) +, +win_table AS ( + --number of wins for a player and gameid + SELECT + SUM(rt.right_wins) AS "total_wins" + , rt.right_player_id AS "win_player_id" + , rt.gameid + , rt."seasonid" + FROM + ( + SELECT + * + FROM + ( + WITH right_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore < m.rightscore THEN 1 + ELSE 0 + END) AS "right_won" + , r."A" + , r."B" + , m."gameid" + , m."seasonid" + FROM + "_right" r + JOIN "Match" m ON + r."A" = m.id + GROUP BY + r."A" + , r."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.right_won) AS "right_wins" + , a."B" AS "right_player_id" + , a."gameid" + , a."seasonid" + FROM + right_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + ) rw + UNION ALL + SELECT + * + FROM + ( + WITH left_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore > m.rightscore THEN 1 + ELSE 0 + END) AS "left_won" + , l."A" + , l."B" + , m."gameid" + , m."seasonid" + FROM + "_left" l + JOIN "Match" m ON + l."A" = m.id + GROUP BY + l."A" + , l."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.left_won) AS "left_wins" + , a."B" AS "left_player_id" + , a."gameid" + , a."seasonid" + FROM + left_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + ) lw + ) rt + -- WHERE rt.right_player_id = '' + GROUP BY + rt.right_player_id + , rt.gameid + , rt."seasonid" +) +SELECT + COALESCE(lt.loss_player_id, wt.win_player_id) AS "player_id" + , COALESCE(lt."gameid", wt."gameid") AS "gameid" + , COALESCE(lt.seasonid, wt.seasonid) AS "seasonid" + , wt."total_wins" + , lt."total_losses" +FROM + loss_table lt +FULL OUTER JOIN win_table wt ON + lt."loss_player_id" = wt."win_player_id" + AND lt."gameid" = wt."gameid" + AND lt."seasonid" = wt."seasonid" + ); +14:43:25.036857 [debug] [Thread-1 ]: On model.wrkplay_dbt.number_played_against: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.number_played_against"} */ + + create view "postgres"."public"."number_played_against__dbt_tmp" as ( + -- 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" + ); +14:43:25.173187 [debug] [Thread-2 ]: SQL status: CREATE VIEW in 0.14 seconds +14:43:25.174124 [debug] [Thread-1 ]: SQL status: CREATE VIEW in 0.14 seconds +14:43:25.180528 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +14:43:25.181639 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.number_played_against" +14:43:25.181725 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ +alter table "postgres"."public"."wins_losses" rename to "wins_losses__dbt_backup" +14:43:25.181791 [debug] [Thread-1 ]: On model.wrkplay_dbt.number_played_against: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.number_played_against"} */ +alter table "postgres"."public"."number_played_against" rename to "number_played_against__dbt_backup" +14:43:25.202468 [debug] [Thread-1 ]: SQL status: ALTER TABLE in 0.02 seconds +14:43:25.203311 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.number_played_against" +14:43:25.203379 [debug] [Thread-1 ]: On model.wrkplay_dbt.number_played_against: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.number_played_against"} */ +alter table "postgres"."public"."number_played_against__dbt_tmp" rename to "number_played_against" +14:43:25.203451 [debug] [Thread-2 ]: SQL status: ALTER TABLE in 0.02 seconds +14:43:25.204388 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +14:43:25.204461 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ +alter table "postgres"."public"."wins_losses__dbt_tmp" rename to "wins_losses" +14:43:25.223452 [debug] [Thread-2 ]: SQL status: ALTER TABLE in 0.02 seconds +14:43:25.223762 [debug] [Thread-1 ]: SQL status: ALTER TABLE in 0.02 seconds +14:43:25.228072 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: COMMIT +14:43:25.228683 [debug] [Thread-1 ]: On model.wrkplay_dbt.number_played_against: COMMIT +14:43:25.228761 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +14:43:25.228825 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.number_played_against" +14:43:25.228883 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: COMMIT +14:43:25.228938 [debug] [Thread-1 ]: On model.wrkplay_dbt.number_played_against: COMMIT +14:43:25.250942 [debug] [Thread-2 ]: SQL status: COMMIT in 0.02 seconds +14:43:25.251339 [debug] [Thread-1 ]: SQL status: COMMIT in 0.02 seconds +14:43:25.256653 [debug] [Thread-2 ]: Using postgres connection "model.wrkplay_dbt.wins_losses" +14:43:25.257421 [debug] [Thread-1 ]: Using postgres connection "model.wrkplay_dbt.number_played_against" +14:43:25.257501 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.wins_losses"} */ +drop view if exists "postgres"."public"."wins_losses__dbt_backup" cascade +14:43:25.257578 [debug] [Thread-1 ]: On model.wrkplay_dbt.number_played_against: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "model.wrkplay_dbt.number_played_against"} */ +drop view if exists "postgres"."public"."number_played_against__dbt_backup" cascade +14:43:25.298074 [debug] [Thread-2 ]: SQL status: DROP VIEW in 0.04 seconds +14:43:25.302311 [debug] [Thread-2 ]: finished collecting timing info +14:43:25.302580 [debug] [Thread-1 ]: SQL status: DROP VIEW in 0.04 seconds +14:43:25.303074 [debug] [Thread-2 ]: On model.wrkplay_dbt.wins_losses: Close +14:43:25.304199 [debug] [Thread-1 ]: finished collecting timing info +14:43:25.304420 [debug] [Thread-1 ]: On model.wrkplay_dbt.number_played_against: Close +14:43:25.304748 [debug] [Thread-1 ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '9e1a48b9-6ed9-4527-98eb-26f2ae90997f', 'context': []} +14:43:25.304998 [info ] [Thread-1 ]: 1 of 2 OK created view model public.number_played_against ...................... [CREATE VIEW in 0.73s] +14:43:25.305271 [debug] [Thread-1 ]: Finished running node model.wrkplay_dbt.number_played_against +14:43:25.305551 [debug] [Thread-2 ]: Sending event: {'category': 'dbt', 'action': 'run_model', 'label': '9e1a48b9-6ed9-4527-98eb-26f2ae90997f', 'context': []} +14:43:25.305680 [info ] [Thread-2 ]: 2 of 2 OK created view model public.wins_losses ................................ [CREATE VIEW in 0.73s] +14:43:25.305830 [debug] [Thread-2 ]: Finished running node model.wrkplay_dbt.wins_losses +14:43:25.306770 [debug] [MainThread]: Acquiring new postgres connection "master" +14:43:25.306901 [debug] [MainThread]: Using postgres connection "master" +14:43:25.306961 [debug] [MainThread]: On master: BEGIN +14:43:25.307016 [debug] [MainThread]: Opening a new connection, currently in state closed +14:43:25.543988 [debug] [MainThread]: SQL status: BEGIN in 0.24 seconds +14:43:25.545622 [debug] [MainThread]: On master: COMMIT +14:43:25.546014 [debug] [MainThread]: Using postgres connection "master" +14:43:25.546401 [debug] [MainThread]: On master: COMMIT +14:43:25.564616 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +14:43:25.565470 [debug] [MainThread]: On master: Close +14:43:25.567460 [info ] [MainThread]: +14:43:25.568083 [info ] [MainThread]: Finished running 2 view models in 2.59s. +14:43:25.568523 [debug] [MainThread]: Connection 'master' was properly closed. +14:43:25.568686 [debug] [MainThread]: Connection 'model.wrkplay_dbt.number_played_against' was properly closed. +14:43:25.568742 [debug] [MainThread]: Connection 'model.wrkplay_dbt.wins_losses' was properly closed. +14:43:25.573381 [info ] [MainThread]: +14:43:25.573509 [info ] [MainThread]: Completed successfully +14:43:25.573621 [info ] [MainThread]: +14:43:25.573709 [info ] [MainThread]: Done. PASS=2 WARN=0 ERROR=0 SKIP=0 TOTAL=2 +14:43:25.573843 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [, , ]} + + +============================== 2022-07-11 14:43:33.293063 | 2bd1cbb2-621f-40bb-84bd-067b02dacb3e ============================== +14:43:33.293084 [info ] [MainThread]: Running with dbt=1.1.1 +14:43:33.293390 [debug] [MainThread]: running dbt with arguments {'write_json': True, 'use_colors': True, 'printer_width': 80, 'version_check': True, 'partial_parse': True, 'static_parser': True, 'profiles_dir': '/Users/bruno.campos/.dbt', 'send_anonymous_usage_stats': True, 'event_buffer_size': 100000, 'quiet': False, 'no_print': False, 'indirect_selection': 'eager', 'which': 'test', 'rpc_method': 'test'} +14:43:33.293468 [debug] [MainThread]: Tracking: tracking +14:43:33.308057 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'start', 'context': [, , ]} +14:43:33.325083 [debug] [MainThread]: Partial parsing enabled: 0 files deleted, 0 files added, 0 files changed. +14:43:33.325197 [debug] [MainThread]: Partial parsing enabled, no changes found, skipping parsing +14:43:33.328487 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'load_project', 'label': '2bd1cbb2-621f-40bb-84bd-067b02dacb3e', 'context': []} +14:43:33.331325 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'resource_counts', 'label': '2bd1cbb2-621f-40bb-84bd-067b02dacb3e', 'context': []} +14:43:33.331459 [info ] [MainThread]: Found 2 models, 9 tests, 0 snapshots, 0 analyses, 169 macros, 0 operations, 0 seed files, 0 sources, 0 exposures, 0 metrics +14:43:33.331599 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '2bd1cbb2-621f-40bb-84bd-067b02dacb3e', 'context': []} +14:43:33.332385 [info ] [MainThread]: +14:43:33.332584 [debug] [MainThread]: Acquiring new postgres connection "master" +14:43:33.332997 [debug] [ThreadPool]: Acquiring new postgres connection "list_postgres_public" +14:43:33.337290 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +14:43:33.337371 [debug] [ThreadPool]: On list_postgres_public: BEGIN +14:43:33.337431 [debug] [ThreadPool]: Opening a new connection, currently in state init +14:43:33.666632 [debug] [ThreadPool]: SQL status: BEGIN in 0.33 seconds +14:43:33.667129 [debug] [ThreadPool]: Using postgres connection "list_postgres_public" +14:43:33.667295 [debug] [ThreadPool]: On list_postgres_public: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "list_postgres_public"} */ +select + 'postgres' as database, + tablename as name, + schemaname as schema, + 'table' as type + from pg_tables + where schemaname ilike 'public' + union all + select + 'postgres' as database, + viewname as name, + schemaname as schema, + 'view' as type + from pg_views + where schemaname ilike 'public' + +14:43:33.691830 [debug] [ThreadPool]: SQL status: SELECT 18 in 0.02 seconds +14:43:33.694630 [debug] [ThreadPool]: On list_postgres_public: ROLLBACK +14:43:33.712370 [debug] [ThreadPool]: On list_postgres_public: Close +14:43:33.717811 [debug] [MainThread]: Using postgres connection "master" +14:43:33.717966 [debug] [MainThread]: On master: BEGIN +14:43:33.718027 [debug] [MainThread]: Opening a new connection, currently in state init +14:43:33.952692 [debug] [MainThread]: SQL status: BEGIN in 0.23 seconds +14:43:33.954216 [debug] [MainThread]: Using postgres connection "master" +14:43:33.954611 [debug] [MainThread]: On master: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "connection_name": "master"} */ +with relation as ( + select + pg_rewrite.ev_class as class, + pg_rewrite.oid as id + from pg_rewrite + ), + class as ( + select + oid as id, + relname as name, + relnamespace as schema, + relkind as kind + from pg_class + ), + dependency as ( + select distinct + pg_depend.objid as id, + pg_depend.refobjid as ref + from pg_depend + ), + schema as ( + select + pg_namespace.oid as id, + pg_namespace.nspname as name + from pg_namespace + where nspname != 'information_schema' and nspname not like 'pg\_%' + ), + referenced as ( + select + relation.id AS id, + referenced_class.name , + referenced_class.schema , + referenced_class.kind + from relation + join class as referenced_class on relation.class=referenced_class.id + where referenced_class.kind in ('r', 'v') + ), + relationships as ( + select + referenced.name as referenced_name, + referenced.schema as referenced_schema_id, + dependent_class.name as dependent_name, + dependent_class.schema as dependent_schema_id, + referenced.kind as kind + from referenced + join dependency on referenced.id=dependency.id + join class as dependent_class on dependency.ref=dependent_class.id + where + (referenced.name != dependent_class.name or + referenced.schema != dependent_class.schema) + ) + + select + referenced_schema.name as referenced_schema, + relationships.referenced_name as referenced_name, + dependent_schema.name as dependent_schema, + relationships.dependent_name as dependent_name + from relationships + join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id + join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id + group by referenced_schema, referenced_name, dependent_schema, dependent_name + order by referenced_schema, referenced_name, dependent_schema, dependent_name; +14:43:34.219415 [debug] [MainThread]: SQL status: SELECT 7 in 0.26 seconds +14:43:34.224781 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'runnable_timing', 'label': '2bd1cbb2-621f-40bb-84bd-067b02dacb3e', 'context': []} +14:43:34.225558 [debug] [MainThread]: On master: ROLLBACK +14:43:34.246037 [debug] [MainThread]: Using postgres connection "master" +14:43:34.246855 [debug] [MainThread]: On master: BEGIN +14:43:34.286954 [debug] [MainThread]: SQL status: BEGIN in 0.04 seconds +14:43:34.287690 [debug] [MainThread]: On master: COMMIT +14:43:34.287911 [debug] [MainThread]: Using postgres connection "master" +14:43:34.288103 [debug] [MainThread]: On master: COMMIT +14:43:34.333261 [debug] [MainThread]: SQL status: COMMIT in 0.04 seconds +14:43:34.334352 [debug] [MainThread]: On master: Close +14:43:34.336075 [info ] [MainThread]: Concurrency: 10 threads (target='dev') +14:43:34.336851 [info ] [MainThread]: +14:43:34.341941 [debug] [Thread-1 ]: Began running node test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c +14:43:34.342096 [debug] [Thread-2 ]: Began running node test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427 +14:43:34.342197 [debug] [Thread-3 ]: Began running node test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073 +14:43:34.342257 [debug] [Thread-4 ]: Began running node test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +14:43:34.342332 [info ] [Thread-1 ]: 1 of 9 START test not_null_number_played_against_num_played_against ............ [RUN] +14:43:34.342394 [debug] [Thread-5 ]: Began running node test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +14:43:34.342501 [info ] [Thread-2 ]: 2 of 9 START test not_null_number_played_against_player_id ..................... [RUN] +14:43:34.342553 [debug] [Thread-6 ]: Began running node test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +14:43:34.342629 [debug] [Thread-7 ]: Began running node test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20 +14:43:34.342693 [info ] [Thread-3 ]: 3 of 9 START test not_null_number_played_against_season_id ..................... [RUN] +14:43:34.342748 [debug] [Thread-8 ]: Began running node test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe +14:43:34.342831 [debug] [Thread-9 ]: Began running node test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77 +14:43:34.342878 [info ] [Thread-4 ]: 4 of 9 START test not_null_wins_losses_gameid .................................. [RUN] +14:43:34.343156 [debug] [Thread-1 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c" +14:43:34.343228 [info ] [Thread-5 ]: 5 of 9 START test not_null_wins_losses_player_id ............................... [RUN] +14:43:34.343397 [debug] [Thread-2 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427" +14:43:34.343462 [info ] [Thread-6 ]: 6 of 9 START test not_null_wins_losses_seasonid ................................ [RUN] +14:43:34.343524 [info ] [Thread-7 ]: 7 of 9 START test positive_test_number_played_against_num_played_against ....... [RUN] +14:43:34.343675 [debug] [Thread-3 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073" +14:43:34.343739 [info ] [Thread-8 ]: 8 of 9 START test positive_test_wins_losses_total_losses ....................... [RUN] +14:43:34.343804 [info ] [Thread-9 ]: 9 of 9 START test positive_test_wins_losses_total_wins ......................... [RUN] +14:43:34.343952 [debug] [Thread-4 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +14:43:34.344033 [debug] [Thread-1 ]: Began compiling node test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c +14:43:34.344228 [debug] [Thread-5 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +14:43:34.344286 [debug] [Thread-2 ]: Began compiling node test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427 +14:43:34.344449 [debug] [Thread-6 ]: Acquiring new postgres connection "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +14:43:34.344647 [debug] [Thread-7 ]: Acquiring new postgres connection "test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20" +14:43:34.344708 [debug] [Thread-3 ]: Began compiling node test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073 +14:43:34.344868 [debug] [Thread-8 ]: Acquiring new postgres connection "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe" +14:43:34.345023 [debug] [Thread-9 ]: Acquiring new postgres connection "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77" +14:43:34.345084 [debug] [Thread-4 ]: Began compiling node test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +14:43:34.345158 [debug] [Thread-1 ]: Compiling test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c +14:43:34.345220 [debug] [Thread-5 ]: Began compiling node test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +14:43:34.345277 [debug] [Thread-2 ]: Compiling test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427 +14:43:34.345333 [debug] [Thread-6 ]: Began compiling node test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +14:43:34.345387 [debug] [Thread-7 ]: Began compiling node test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20 +14:43:34.345442 [debug] [Thread-3 ]: Compiling test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073 +14:43:34.345497 [debug] [Thread-8 ]: Began compiling node test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe +14:43:34.345554 [debug] [Thread-9 ]: Began compiling node test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77 +14:43:34.345607 [debug] [Thread-4 ]: Compiling test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +14:43:34.351509 [debug] [Thread-1 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c" +14:43:34.351621 [debug] [Thread-5 ]: Compiling test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +14:43:34.353110 [debug] [Thread-2 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427" +14:43:34.353191 [debug] [Thread-6 ]: Compiling test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +14:43:34.353257 [debug] [Thread-7 ]: Compiling test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20 +14:43:34.354650 [debug] [Thread-3 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073" +14:43:34.354733 [debug] [Thread-8 ]: Compiling test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe +14:43:34.354798 [debug] [Thread-9 ]: Compiling test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77 +14:43:34.356160 [debug] [Thread-4 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +14:43:34.358115 [debug] [Thread-5 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +14:43:34.359733 [debug] [Thread-6 ]: Writing injected SQL for node "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +14:43:34.361417 [debug] [Thread-7 ]: Writing injected SQL for node "test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20" +14:43:34.361504 [debug] [Thread-1 ]: finished collecting timing info +14:43:34.361598 [debug] [Thread-2 ]: finished collecting timing info +14:43:34.362924 [debug] [Thread-8 ]: Writing injected SQL for node "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe" +14:43:34.364178 [debug] [Thread-9 ]: Writing injected SQL for node "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77" +14:43:34.364310 [debug] [Thread-3 ]: finished collecting timing info +14:43:34.364455 [debug] [Thread-4 ]: finished collecting timing info +14:43:34.364577 [debug] [Thread-5 ]: finished collecting timing info +14:43:34.364648 [debug] [Thread-6 ]: finished collecting timing info +14:43:34.364706 [debug] [Thread-1 ]: Began executing node test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c +14:43:34.364782 [debug] [Thread-2 ]: Began executing node test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427 +14:43:34.364830 [debug] [Thread-7 ]: finished collecting timing info +14:43:34.364956 [debug] [Thread-3 ]: Began executing node test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073 +14:43:34.365041 [debug] [Thread-4 ]: Began executing node test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +14:43:34.365095 [debug] [Thread-8 ]: finished collecting timing info +14:43:34.365155 [debug] [Thread-9 ]: finished collecting timing info +14:43:34.365203 [debug] [Thread-5 ]: Began executing node test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +14:43:34.365268 [debug] [Thread-6 ]: Began executing node test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +14:43:34.371563 [debug] [Thread-1 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c" +14:43:34.372297 [debug] [Thread-2 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427" +14:43:34.372380 [debug] [Thread-7 ]: Began executing node test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20 +14:43:34.373045 [debug] [Thread-3 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073" +14:43:34.373758 [debug] [Thread-4 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +14:43:34.373841 [debug] [Thread-8 ]: Began executing node test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe +14:43:34.373917 [debug] [Thread-9 ]: Began executing node test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77 +14:43:34.374587 [debug] [Thread-5 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +14:43:34.375269 [debug] [Thread-6 ]: Writing runtime SQL for node "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +14:43:34.376039 [debug] [Thread-7 ]: Writing runtime SQL for node "test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20" +14:43:34.376275 [debug] [Thread-2 ]: Using postgres connection "test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427" +14:43:34.376386 [debug] [Thread-1 ]: Using postgres connection "test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c" +14:43:34.377010 [debug] [Thread-8 ]: Writing runtime SQL for node "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe" +14:43:34.377091 [debug] [Thread-3 ]: Using postgres connection "test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073" +14:43:34.377731 [debug] [Thread-9 ]: Writing runtime SQL for node "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77" +14:43:34.377816 [debug] [Thread-4 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +14:43:34.378007 [debug] [Thread-5 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +14:43:34.378071 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427: BEGIN +14:43:34.378138 [debug] [Thread-6 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +14:43:34.378211 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c: BEGIN +14:43:34.378267 [debug] [Thread-7 ]: Using postgres connection "test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20" +14:43:34.378360 [debug] [Thread-3 ]: On test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073: BEGIN +14:43:34.378477 [debug] [Thread-8 ]: Using postgres connection "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe" +14:43:34.378535 [debug] [Thread-4 ]: On test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1: BEGIN +14:43:34.378604 [debug] [Thread-9 ]: Using postgres connection "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77" +14:43:34.378644 [debug] [Thread-5 ]: On test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15: BEGIN +14:43:34.378702 [debug] [Thread-2 ]: Opening a new connection, currently in state init +14:43:34.378763 [debug] [Thread-6 ]: On test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813: BEGIN +14:43:34.378822 [debug] [Thread-1 ]: Opening a new connection, currently in state closed +14:43:34.378877 [debug] [Thread-7 ]: On test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20: BEGIN +14:43:34.378929 [debug] [Thread-3 ]: Opening a new connection, currently in state init +14:43:34.378982 [debug] [Thread-8 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe: BEGIN +14:43:34.379033 [debug] [Thread-4 ]: Opening a new connection, currently in state init +14:43:34.379086 [debug] [Thread-9 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77: BEGIN +14:43:34.379137 [debug] [Thread-5 ]: Opening a new connection, currently in state init +14:43:34.379259 [debug] [Thread-6 ]: Opening a new connection, currently in state init +14:43:34.379364 [debug] [Thread-7 ]: Opening a new connection, currently in state init +14:43:34.379459 [debug] [Thread-8 ]: Opening a new connection, currently in state init +14:43:34.379573 [debug] [Thread-9 ]: Opening a new connection, currently in state init +14:43:34.770693 [debug] [Thread-9 ]: SQL status: BEGIN in 0.39 seconds +14:43:34.771168 [debug] [Thread-2 ]: SQL status: BEGIN in 0.39 seconds +14:43:34.771487 [debug] [Thread-9 ]: Using postgres connection "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77" +14:43:34.771677 [debug] [Thread-2 ]: Using postgres connection "test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427" +14:43:34.771879 [debug] [Thread-9 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + +with validation as ( + + select + total_wins 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 + + + + ) dbt_internal_test +14:43:34.772076 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select player_id +from "postgres"."public"."number_played_against" +where player_id is null + + + + + ) dbt_internal_test +14:43:34.795184 [debug] [Thread-7 ]: SQL status: BEGIN in 0.42 seconds +14:43:34.795462 [debug] [Thread-6 ]: SQL status: BEGIN in 0.42 seconds +14:43:34.795609 [debug] [Thread-1 ]: SQL status: BEGIN in 0.42 seconds +14:43:34.795745 [debug] [Thread-4 ]: SQL status: BEGIN in 0.42 seconds +14:43:34.795984 [debug] [Thread-8 ]: SQL status: BEGIN in 0.42 seconds +14:43:34.797109 [debug] [Thread-8 ]: Using postgres connection "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe" +14:43:34.797267 [debug] [Thread-8 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + +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 + + + + ) dbt_internal_test +14:43:34.796382 [debug] [Thread-7 ]: Using postgres connection "test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20" +14:43:34.796560 [debug] [Thread-6 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" +14:43:34.796763 [debug] [Thread-1 ]: Using postgres connection "test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c" +14:43:34.797896 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select num_played_against +from "postgres"."public"."number_played_against" +where num_played_against is null + + + + + ) dbt_internal_test +14:43:34.796940 [debug] [Thread-4 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" +14:43:34.796113 [debug] [Thread-3 ]: SQL status: BEGIN in 0.42 seconds +14:43:34.797509 [debug] [Thread-7 ]: On test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + +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 + + + + ) dbt_internal_test +14:43:34.797696 [debug] [Thread-6 ]: On test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select seasonid +from "postgres"."public"."wins_losses" +where seasonid is null + + + + + ) dbt_internal_test +14:43:34.796239 [debug] [Thread-5 ]: SQL status: BEGIN in 0.42 seconds +14:43:34.798171 [debug] [Thread-4 ]: On test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select gameid +from "postgres"."public"."wins_losses" +where gameid is null + + + + + ) dbt_internal_test +14:43:34.798342 [debug] [Thread-3 ]: Using postgres connection "test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073" +14:43:34.798704 [debug] [Thread-5 ]: Using postgres connection "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" +14:43:34.798943 [debug] [Thread-3 ]: On test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select season_id +from "postgres"."public"."number_played_against" +where season_id is null + + + + + ) dbt_internal_test +14:43:34.799099 [debug] [Thread-5 ]: On test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15: /* {"app": "dbt", "dbt_version": "1.1.1", "profile_name": "wrkplay_dbt", "target_name": "dev", "node_id": "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15"} */ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select player_id +from "postgres"."public"."wins_losses" +where player_id is null + + + + + ) dbt_internal_test +14:43:34.804980 [debug] [Thread-2 ]: SQL status: SELECT 1 in 0.03 seconds +14:43:34.808545 [debug] [Thread-2 ]: finished collecting timing info +14:43:34.808862 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427: ROLLBACK +14:43:34.810959 [debug] [Thread-9 ]: SQL status: SELECT 1 in 0.04 seconds +14:43:34.812592 [debug] [Thread-9 ]: finished collecting timing info +14:43:34.812903 [debug] [Thread-9 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77: ROLLBACK +14:43:34.839703 [debug] [Thread-9 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77: Close +14:43:34.843347 [info ] [Thread-9 ]: 9 of 9 PASS positive_test_wins_losses_total_wins ............................... [PASS in 0.50s] +14:43:34.848527 [debug] [Thread-2 ]: On test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427: Close +14:43:34.865089 [debug] [Thread-9 ]: Finished running node test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77 +14:43:34.866057 [info ] [Thread-2 ]: 2 of 9 PASS not_null_number_played_against_player_id ........................... [PASS in 0.52s] +14:43:34.866607 [debug] [Thread-2 ]: Finished running node test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427 +14:43:34.899624 [debug] [Thread-8 ]: SQL status: SELECT 1 in 0.1 seconds +14:43:34.899989 [debug] [Thread-4 ]: SQL status: SELECT 1 in 0.1 seconds +14:43:34.900235 [debug] [Thread-6 ]: SQL status: SELECT 1 in 0.1 seconds +14:43:34.902655 [debug] [Thread-8 ]: finished collecting timing info +14:43:34.902904 [debug] [Thread-3 ]: SQL status: SELECT 1 in 0.1 seconds +14:43:34.903051 [debug] [Thread-5 ]: SQL status: SELECT 1 in 0.1 seconds +14:43:34.905170 [debug] [Thread-4 ]: finished collecting timing info +14:43:34.906909 [debug] [Thread-6 ]: finished collecting timing info +14:43:34.907080 [debug] [Thread-8 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe: ROLLBACK +14:43:34.907758 [debug] [Thread-3 ]: finished collecting timing info +14:43:34.908298 [debug] [Thread-5 ]: finished collecting timing info +14:43:34.908668 [debug] [Thread-5 ]: On test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15: ROLLBACK +14:43:34.908459 [debug] [Thread-6 ]: On test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813: ROLLBACK +14:43:34.908571 [debug] [Thread-3 ]: On test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073: ROLLBACK +14:43:34.908390 [debug] [Thread-4 ]: On test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1: ROLLBACK +14:43:34.920405 [debug] [Thread-1 ]: SQL status: SELECT 1 in 0.12 seconds +14:43:34.921142 [debug] [Thread-1 ]: finished collecting timing info +14:43:34.921242 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c: ROLLBACK +14:43:34.939579 [debug] [Thread-3 ]: On test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073: Close +14:43:34.939746 [debug] [Thread-8 ]: On test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe: Close +14:43:34.939804 [debug] [Thread-4 ]: On test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1: Close +14:43:34.939860 [debug] [Thread-7 ]: SQL status: SELECT 1 in 0.14 seconds +14:43:34.939901 [debug] [Thread-5 ]: On test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15: Close +14:43:34.939939 [debug] [Thread-6 ]: On test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813: Close +14:43:34.940706 [debug] [Thread-7 ]: finished collecting timing info +14:43:34.940875 [info ] [Thread-8 ]: 8 of 9 PASS positive_test_wins_losses_total_losses ............................. [PASS in 0.60s] +14:43:34.941034 [info ] [Thread-3 ]: 3 of 9 PASS not_null_number_played_against_season_id ........................... [PASS in 0.60s] +14:43:34.941142 [info ] [Thread-4 ]: 4 of 9 PASS not_null_wins_losses_gameid ........................................ [PASS in 0.60s] +14:43:34.941279 [debug] [Thread-7 ]: On test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20: ROLLBACK +14:43:34.941404 [info ] [Thread-5 ]: 5 of 9 PASS not_null_wins_losses_player_id ..................................... [PASS in 0.60s] +14:43:34.941595 [debug] [Thread-8 ]: Finished running node test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe +14:43:34.941734 [debug] [Thread-3 ]: Finished running node test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073 +14:43:34.941868 [info ] [Thread-6 ]: 6 of 9 PASS not_null_wins_losses_seasonid ...................................... [PASS in 0.60s] +14:43:34.942010 [debug] [Thread-4 ]: Finished running node test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1 +14:43:34.942227 [debug] [Thread-5 ]: Finished running node test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15 +14:43:34.942528 [debug] [Thread-6 ]: Finished running node test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813 +14:43:34.944116 [debug] [Thread-1 ]: On test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c: Close +14:43:34.944425 [info ] [Thread-1 ]: 1 of 9 PASS not_null_number_played_against_num_played_against .................. [PASS in 0.60s] +14:43:34.944595 [debug] [Thread-1 ]: Finished running node test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c +14:43:35.005442 [debug] [Thread-7 ]: On test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20: Close +14:43:35.006707 [info ] [Thread-7 ]: 7 of 9 PASS positive_test_number_played_against_num_played_against ............. [PASS in 0.66s] +14:43:35.006963 [debug] [Thread-7 ]: Finished running node test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20 +14:43:35.008206 [debug] [MainThread]: Acquiring new postgres connection "master" +14:43:35.008417 [debug] [MainThread]: Using postgres connection "master" +14:43:35.008482 [debug] [MainThread]: On master: BEGIN +14:43:35.008539 [debug] [MainThread]: Opening a new connection, currently in state closed +14:43:35.444791 [debug] [MainThread]: SQL status: BEGIN in 0.44 seconds +14:43:35.446209 [debug] [MainThread]: On master: COMMIT +14:43:35.446567 [debug] [MainThread]: Using postgres connection "master" +14:43:35.446905 [debug] [MainThread]: On master: COMMIT +14:43:35.465632 [debug] [MainThread]: SQL status: COMMIT in 0.02 seconds +14:43:35.466427 [debug] [MainThread]: On master: Close +14:43:35.468393 [info ] [MainThread]: +14:43:35.469105 [info ] [MainThread]: Finished running 9 tests in 2.14s. +14:43:35.469760 [debug] [MainThread]: Connection 'master' was properly closed. +14:43:35.469993 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c' was properly closed. +14:43:35.470056 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427' was properly closed. +14:43:35.470110 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073' was properly closed. +14:43:35.470160 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1' was properly closed. +14:43:35.470206 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15' was properly closed. +14:43:35.470251 [debug] [MainThread]: Connection 'test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813' was properly closed. +14:43:35.470296 [debug] [MainThread]: Connection 'test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20' was properly closed. +14:43:35.470341 [debug] [MainThread]: Connection 'test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe' was properly closed. +14:43:35.470386 [debug] [MainThread]: Connection 'test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77' was properly closed. +14:43:35.500321 [info ] [MainThread]: +14:43:35.500483 [info ] [MainThread]: Completed successfully +14:43:35.500602 [info ] [MainThread]: +14:43:35.500688 [info ] [MainThread]: Done. PASS=9 WARN=0 ERROR=0 SKIP=0 TOTAL=9 +14:43:35.500814 [debug] [MainThread]: Sending event: {'category': 'dbt', 'action': 'invocation', 'label': 'end', 'context': [, , ]} diff --git a/wrkplay_dbt/logs/dbt.log.legacy b/wrkplay_dbt/logs/dbt.log.legacy new file mode 100644 index 0000000..99a6946 --- /dev/null +++ b/wrkplay_dbt/logs/dbt.log.legacy @@ -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. diff --git a/wrkplay_dbt/target/catalog.json b/wrkplay_dbt/target/catalog.json new file mode 100644 index 0000000..df4707d --- /dev/null +++ b/wrkplay_dbt/target/catalog.json @@ -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 +} diff --git a/wrkplay_dbt/target/compiled/wrkplay_dbt/models/example/my_first_dbt_model.sql b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/example/my_first_dbt_model.sql new file mode 100644 index 0000000..872f16a --- /dev/null +++ b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/example/my_first_dbt_model.sql @@ -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 \ No newline at end of file diff --git a/wrkplay_dbt/target/compiled/wrkplay_dbt/models/example/my_second_dbt_model.sql b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/example/my_second_dbt_model.sql new file mode 100644 index 0000000..43d3aa2 --- /dev/null +++ b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/example/my_second_dbt_model.sql @@ -0,0 +1,5 @@ +-- Use the `ref` function to select from other models + +select * +from "postgres"."public"."my_first_dbt_model" +where id = 1 \ No newline at end of file diff --git a/wrkplay_dbt/target/compiled/wrkplay_dbt/models/example/schema.yml/not_null_my_first_dbt_model_id.sql b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/example/schema.yml/not_null_my_first_dbt_model_id.sql new file mode 100644 index 0000000..7d47bef --- /dev/null +++ b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/example/schema.yml/not_null_my_first_dbt_model_id.sql @@ -0,0 +1,11 @@ + + + + + + +select id +from "postgres"."public"."my_first_dbt_model" +where id is null + + diff --git a/wrkplay_dbt/target/compiled/wrkplay_dbt/models/example/schema.yml/not_null_my_second_dbt_model_id.sql b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/example/schema.yml/not_null_my_second_dbt_model_id.sql new file mode 100644 index 0000000..3e659e7 --- /dev/null +++ b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/example/schema.yml/not_null_my_second_dbt_model_id.sql @@ -0,0 +1,11 @@ + + + + + + +select id +from "postgres"."public"."my_second_dbt_model" +where id is null + + diff --git a/wrkplay_dbt/target/compiled/wrkplay_dbt/models/example/schema.yml/unique_my_first_dbt_model_id.sql b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/example/schema.yml/unique_my_first_dbt_model_id.sql new file mode 100644 index 0000000..92b9397 --- /dev/null +++ b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/example/schema.yml/unique_my_first_dbt_model_id.sql @@ -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 + + diff --git a/wrkplay_dbt/target/compiled/wrkplay_dbt/models/example/schema.yml/unique_my_second_dbt_model_id.sql b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/example/schema.yml/unique_my_second_dbt_model_id.sql new file mode 100644 index 0000000..2bcc1ae --- /dev/null +++ b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/example/schema.yml/unique_my_second_dbt_model_id.sql @@ -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 + + diff --git a/wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/number_played_against.sql b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/number_played_against.sql new file mode 100644 index 0000000..f58a88c --- /dev/null +++ b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/number_played_against.sql @@ -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" \ No newline at end of file diff --git a/wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/not_null_number_played_against_num_played_against.sql b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/not_null_number_played_against_num_played_against.sql new file mode 100644 index 0000000..5278059 --- /dev/null +++ b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/not_null_number_played_against_num_played_against.sql @@ -0,0 +1,11 @@ + + + + + + +select num_played_against +from "postgres"."public"."number_played_against" +where num_played_against is null + + diff --git a/wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/not_null_number_played_against_player_id.sql b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/not_null_number_played_against_player_id.sql new file mode 100644 index 0000000..03754fa --- /dev/null +++ b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/not_null_number_played_against_player_id.sql @@ -0,0 +1,11 @@ + + + + + + +select player_id +from "postgres"."public"."number_played_against" +where player_id is null + + diff --git a/wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/not_null_number_played_against_season_id.sql b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/not_null_number_played_against_season_id.sql new file mode 100644 index 0000000..3f33b2e --- /dev/null +++ b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/not_null_number_played_against_season_id.sql @@ -0,0 +1,11 @@ + + + + + + +select season_id +from "postgres"."public"."number_played_against" +where season_id is null + + diff --git a/wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/not_null_wins_losses_gameid.sql b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/not_null_wins_losses_gameid.sql new file mode 100644 index 0000000..6128ce7 --- /dev/null +++ b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/not_null_wins_losses_gameid.sql @@ -0,0 +1,11 @@ + + + + + + +select gameid +from "postgres"."public"."wins_losses" +where gameid is null + + diff --git a/wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/not_null_wins_losses_player_id.sql b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/not_null_wins_losses_player_id.sql new file mode 100644 index 0000000..dc01c36 --- /dev/null +++ b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/not_null_wins_losses_player_id.sql @@ -0,0 +1,11 @@ + + + + + + +select player_id +from "postgres"."public"."wins_losses" +where player_id is null + + diff --git a/wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/not_null_wins_losses_seasonid.sql b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/not_null_wins_losses_seasonid.sql new file mode 100644 index 0000000..6a930cc --- /dev/null +++ b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/not_null_wins_losses_seasonid.sql @@ -0,0 +1,11 @@ + + + + + + +select seasonid +from "postgres"."public"."wins_losses" +where seasonid is null + + diff --git a/wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/positive_test_number_played_against_num_played_against.sql b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/positive_test_number_played_against_num_played_against.sql new file mode 100644 index 0000000..6aba985 --- /dev/null +++ b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/positive_test_number_played_against_num_played_against.sql @@ -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 + diff --git a/wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/positive_test_wins_losses_total_losses.sql b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/positive_test_wins_losses_total_losses.sql new file mode 100644 index 0000000..86321de --- /dev/null +++ b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/positive_test_wins_losses_total_losses.sql @@ -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 + diff --git a/wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/positive_test_wins_losses_total_wins.sql b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/positive_test_wins_losses_total_wins.sql new file mode 100644 index 0000000..b555e93 --- /dev/null +++ b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/schema.yml/positive_test_wins_losses_total_wins.sql @@ -0,0 +1,25 @@ + + +with validation as ( + + select + total_wins 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 + diff --git a/wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/wins_losses.sql b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/wins_losses.sql new file mode 100644 index 0000000..56d7305 --- /dev/null +++ b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/marts/wins_losses.sql @@ -0,0 +1,195 @@ +--number of wins and losses per player per game (per office) per season +WITH loss_table AS ( + SELECT + SUM(lt.left_losses) AS "total_losses" + , lt.left_player_id AS "loss_player_id" + , lt.gameid + , lt.seasonid + FROM + ( + SELECT + * + FROM + ( + --Begin DONE + WITH left_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore > m.rightscore THEN 0 + ELSE 1 + END) AS "left_loss" + , l."A" + , l."B" + , m."gameid" + , m."seasonid" + FROM + "_left" l + JOIN "Match" m ON + l."A" = m.id + GROUP BY + l."A" + , l."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.left_loss) AS "left_losses" + , a."B" AS "left_player_id" + , a."gameid" + , a."seasonid" + FROM + left_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + --End DONE + ) ll + UNION ALL + SELECT + * + FROM + ( + --Begin DONE + WITH right_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore < m.rightscore THEN 0 + ELSE 1 + END) AS "right_loss" + , r."A" + , r."B" + , m."gameid" + , m."seasonid" + FROM + "_right" r + JOIN "Match" m ON + r."A" = m.id + GROUP BY + r."A" + , r."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.right_loss) AS "right_losses" + , a."B" AS "right_player_id" + , a."gameid" + , a."seasonid" + FROM + right_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + --End DONE + ) rl + ) lt + -- WHERE lt.left_player_id = '' + GROUP BY + lt.left_player_id + , lt.gameid + , lt.seasonid +) +, +win_table AS ( + --number of wins for a player and gameid + SELECT + SUM(rt.right_wins) AS "total_wins" + , rt.right_player_id AS "win_player_id" + , rt.gameid + , rt."seasonid" + FROM + ( + SELECT + * + FROM + ( + WITH right_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore < m.rightscore THEN 1 + ELSE 0 + END) AS "right_won" + , r."A" + , r."B" + , m."gameid" + , m."seasonid" + FROM + "_right" r + JOIN "Match" m ON + r."A" = m.id + GROUP BY + r."A" + , r."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.right_won) AS "right_wins" + , a."B" AS "right_player_id" + , a."gameid" + , a."seasonid" + FROM + right_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + ) rw + UNION ALL + SELECT + * + FROM + ( + WITH left_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore > m.rightscore THEN 1 + ELSE 0 + END) AS "left_won" + , l."A" + , l."B" + , m."gameid" + , m."seasonid" + FROM + "_left" l + JOIN "Match" m ON + l."A" = m.id + GROUP BY + l."A" + , l."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.left_won) AS "left_wins" + , a."B" AS "left_player_id" + , a."gameid" + , a."seasonid" + FROM + left_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + ) lw + ) rt + -- WHERE rt.right_player_id = '' + GROUP BY + rt.right_player_id + , rt.gameid + , rt."seasonid" +) +SELECT + COALESCE(lt.loss_player_id, wt.win_player_id) AS "player_id" + , COALESCE(lt."gameid", wt."gameid") AS "gameid" + , COALESCE(lt.seasonid, wt.seasonid) AS "seasonid" + , wt."total_wins" + , lt."total_losses" +FROM + loss_table lt +FULL OUTER JOIN win_table wt ON + lt."loss_player_id" = wt."win_player_id" + AND lt."gameid" = wt."gameid" + AND lt."seasonid" = wt."seasonid" \ No newline at end of file diff --git a/wrkplay_dbt/target/compiled/wrkplay_dbt/models/number_played_against.sql b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/number_played_against.sql new file mode 100644 index 0000000..f58a88c --- /dev/null +++ b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/number_played_against.sql @@ -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" \ No newline at end of file diff --git a/wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/not_null_number_played_against_num_played_against.sql b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/not_null_number_played_against_num_played_against.sql new file mode 100644 index 0000000..5278059 --- /dev/null +++ b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/not_null_number_played_against_num_played_against.sql @@ -0,0 +1,11 @@ + + + + + + +select num_played_against +from "postgres"."public"."number_played_against" +where num_played_against is null + + diff --git a/wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/not_null_number_played_against_player_id.sql b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/not_null_number_played_against_player_id.sql new file mode 100644 index 0000000..03754fa --- /dev/null +++ b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/not_null_number_played_against_player_id.sql @@ -0,0 +1,11 @@ + + + + + + +select player_id +from "postgres"."public"."number_played_against" +where player_id is null + + diff --git a/wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/not_null_number_played_against_season_id.sql b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/not_null_number_played_against_season_id.sql new file mode 100644 index 0000000..3f33b2e --- /dev/null +++ b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/not_null_number_played_against_season_id.sql @@ -0,0 +1,11 @@ + + + + + + +select season_id +from "postgres"."public"."number_played_against" +where season_id is null + + diff --git a/wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/not_null_wins_losses_gameid.sql b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/not_null_wins_losses_gameid.sql new file mode 100644 index 0000000..6128ce7 --- /dev/null +++ b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/not_null_wins_losses_gameid.sql @@ -0,0 +1,11 @@ + + + + + + +select gameid +from "postgres"."public"."wins_losses" +where gameid is null + + diff --git a/wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/not_null_wins_losses_player_id.sql b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/not_null_wins_losses_player_id.sql new file mode 100644 index 0000000..dc01c36 --- /dev/null +++ b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/not_null_wins_losses_player_id.sql @@ -0,0 +1,11 @@ + + + + + + +select player_id +from "postgres"."public"."wins_losses" +where player_id is null + + diff --git a/wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/not_null_wins_losses_seasonid.sql b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/not_null_wins_losses_seasonid.sql new file mode 100644 index 0000000..6a930cc --- /dev/null +++ b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/not_null_wins_losses_seasonid.sql @@ -0,0 +1,11 @@ + + + + + + +select seasonid +from "postgres"."public"."wins_losses" +where seasonid is null + + diff --git a/wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/positive_test_number_played_against_num_played_against.sql b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/positive_test_number_played_against_num_played_against.sql new file mode 100644 index 0000000..6aba985 --- /dev/null +++ b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/positive_test_number_played_against_num_played_against.sql @@ -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 + diff --git a/wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/positive_test_wins_losses_total_losses.sql b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/positive_test_wins_losses_total_losses.sql new file mode 100644 index 0000000..86321de --- /dev/null +++ b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/positive_test_wins_losses_total_losses.sql @@ -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 + diff --git a/wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/positive_test_wins_losses_total_wins.sql b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/positive_test_wins_losses_total_wins.sql new file mode 100644 index 0000000..b555e93 --- /dev/null +++ b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/positive_test_wins_losses_total_wins.sql @@ -0,0 +1,25 @@ + + +with validation as ( + + select + total_wins 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 + diff --git a/wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/unique_wins_losses_seasonid.sql b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/unique_wins_losses_seasonid.sql new file mode 100644 index 0000000..8344178 --- /dev/null +++ b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/schema.yml/unique_wins_losses_seasonid.sql @@ -0,0 +1,14 @@ + + + + +select + seasonid as unique_field, + count(*) as n_records + +from "postgres"."public"."wins_losses" +where seasonid is not null +group by seasonid +having count(*) > 1 + + diff --git a/wrkplay_dbt/target/compiled/wrkplay_dbt/models/wins_losses.sql b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/wins_losses.sql new file mode 100644 index 0000000..56d7305 --- /dev/null +++ b/wrkplay_dbt/target/compiled/wrkplay_dbt/models/wins_losses.sql @@ -0,0 +1,195 @@ +--number of wins and losses per player per game (per office) per season +WITH loss_table AS ( + SELECT + SUM(lt.left_losses) AS "total_losses" + , lt.left_player_id AS "loss_player_id" + , lt.gameid + , lt.seasonid + FROM + ( + SELECT + * + FROM + ( + --Begin DONE + WITH left_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore > m.rightscore THEN 0 + ELSE 1 + END) AS "left_loss" + , l."A" + , l."B" + , m."gameid" + , m."seasonid" + FROM + "_left" l + JOIN "Match" m ON + l."A" = m.id + GROUP BY + l."A" + , l."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.left_loss) AS "left_losses" + , a."B" AS "left_player_id" + , a."gameid" + , a."seasonid" + FROM + left_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + --End DONE + ) ll + UNION ALL + SELECT + * + FROM + ( + --Begin DONE + WITH right_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore < m.rightscore THEN 0 + ELSE 1 + END) AS "right_loss" + , r."A" + , r."B" + , m."gameid" + , m."seasonid" + FROM + "_right" r + JOIN "Match" m ON + r."A" = m.id + GROUP BY + r."A" + , r."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.right_loss) AS "right_losses" + , a."B" AS "right_player_id" + , a."gameid" + , a."seasonid" + FROM + right_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + --End DONE + ) rl + ) lt + -- WHERE lt.left_player_id = '' + GROUP BY + lt.left_player_id + , lt.gameid + , lt.seasonid +) +, +win_table AS ( + --number of wins for a player and gameid + SELECT + SUM(rt.right_wins) AS "total_wins" + , rt.right_player_id AS "win_player_id" + , rt.gameid + , rt."seasonid" + FROM + ( + SELECT + * + FROM + ( + WITH right_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore < m.rightscore THEN 1 + ELSE 0 + END) AS "right_won" + , r."A" + , r."B" + , m."gameid" + , m."seasonid" + FROM + "_right" r + JOIN "Match" m ON + r."A" = m.id + GROUP BY + r."A" + , r."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.right_won) AS "right_wins" + , a."B" AS "right_player_id" + , a."gameid" + , a."seasonid" + FROM + right_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + ) rw + UNION ALL + SELECT + * + FROM + ( + WITH left_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore > m.rightscore THEN 1 + ELSE 0 + END) AS "left_won" + , l."A" + , l."B" + , m."gameid" + , m."seasonid" + FROM + "_left" l + JOIN "Match" m ON + l."A" = m.id + GROUP BY + l."A" + , l."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.left_won) AS "left_wins" + , a."B" AS "left_player_id" + , a."gameid" + , a."seasonid" + FROM + left_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + ) lw + ) rt + -- WHERE rt.right_player_id = '' + GROUP BY + rt.right_player_id + , rt.gameid + , rt."seasonid" +) +SELECT + COALESCE(lt.loss_player_id, wt.win_player_id) AS "player_id" + , COALESCE(lt."gameid", wt."gameid") AS "gameid" + , COALESCE(lt.seasonid, wt.seasonid) AS "seasonid" + , wt."total_wins" + , lt."total_losses" +FROM + loss_table lt +FULL OUTER JOIN win_table wt ON + lt."loss_player_id" = wt."win_player_id" + AND lt."gameid" = wt."gameid" + AND lt."seasonid" = wt."seasonid" \ No newline at end of file diff --git a/wrkplay_dbt/target/graph.gpickle b/wrkplay_dbt/target/graph.gpickle new file mode 100644 index 0000000000000000000000000000000000000000..579c902e2f1236e6ce382c059c8bdfe975653312 GIT binary patch literal 16031 zcmeHOOK%*<5msVK;;t;m7Hr9I{1|O)bE%NaeLoCI5k*ojP-M(UYy%Mny)(VrL+;K{ z^Uzu`gd{f^n42f({Dd5GF%Ty(l1q?75Cj2|AV5wAa*N@AkgD#P*_nNCmn)KS0udm% z-Cf;P)m>jzb@lQmCx7N$J;8t6mvw4)40HFxjM5^OMXijgHBGX|Joognc9Vbl#GC!8 z_sC1T7x;)wY}=GoO|j($QEbC}=(*E%M{C)dZh7t$j(DGV?hCr1(l{NPcF*(P{v}}O z6{7C6G|QF^$EH0TqQjc54;VgA)g~Pv8_YZ@GV7r&gw8?(Vh7Ls_lc z8Qp2uVP$MnRVGaW3fY|av`IR$b-(4kzxK?D6Z7*@liHSKGb)KWlF^X(G}DrZ|4CxR z5+7B`UrRDfsiWCU+M}jqQDPZ-a&u*MWoav!P%^1{E+s8)N-43Dtf{GFVorhqL5dxG zyxZjChNIi*<=dNEx7U`oki4Ex&2mBzu1A|x^2Wyc-DD!2OeEgBy>&|>t(G7G$$>Za zCjyb+V=I$d6inO1R+x|p`sXAVx!x}>AF?u5%W3wBnn(!VK$DVNv|*>D7P7muetS(y z-Np4&Qd?SI!?l6y6{(%kRH;j{$#*OzSxD2)h;0ChE0X0CZm->jp~cnJ9yQER4O3o( zUFBjzr>}u2Uk^GXvYT>rqhr#WT9bkJW>>bT_=4L6;?Kf*-OVStOvDuUc7lZ<%Q=bU z`^WOZ7|iQR-hT|iDMXK+@+e&Q9=WN{YLg-JDHf3l;nH2RyI~bGroM) zH^k)4jrHyCOV>XLhWbp}bI+R8G8|K(vi)$60!leFJvXV+J*umgZ0HU+ zB#2}DVZZ(&S2tRg9L?*124K@OeX*ErroGkrhVtCP;fqYwCsxAI?O4iMQq^ z_6*COXNIwh0#EOmG-x>Pv`TDJCl<__MzSXC0IVcdh7WsAy`?Fh`%L4$4zttowPAyZ zX~Tq<274^(CLCS6?@)lN$IgL@MA;?a9d**~mD5d_hGENl#0HnYy0C4*ZYjGG zX@hJF%ZB2#scuI;N%PX(#ie(1wc6Ud#aj8sf<;<3daZ@%7PwPl)i=1b3j<}%pi_0v z82~6vCoQ?5wWu%5+uRDQg^{zTgjz#3!#xQHPKIxmI}OLF>{?D6Er{KKQ(z=tDtqjX zd#zBZD%FBQluET;E-3|?&8uZvQ0nzUyHO1^Ur6%fE82Qvo$bp_tqBEAfll44hk;fJi{0h#2Q8((4H6r z1}uyg?KKTnh|$bMOAzWsI@qSWv;{Hj_Az%kbsX zbV(R!hRf@*?>zEQPsdG!ekb78?Er4yLvB1a06*eKz#cxE+{usRbgn>C#iZcUAXTxwn~Q(@ z<=NkU_OE|C?rZ&-O$Ra=xn*F2$9L()_wPN2c}#adkU}E5DhVo{p$KE(ADiGgq%@{2 zMx&uAbT*p8@I(UV$-;g`9uWqz&F#DCmYu;v6Wg!>@q!E5c+uj1MT_w>l7T1w7k9su?v5ME-0#kc@+x4SAwBX zAx^mXgPZB4#Z8`dWjRHBi+ESh4n;PIuOm*I2+?}9 z<}7_J$6OvPYX!g*+SRPo!d!P)etHn&lB<2e!=#`?(*c;-we@wV)NvD z{A?OdaHxGo^J-s$o|8%(hIGU2v%4X}K)db17AnRM!9>MEM{c7g+9;T+4S(k6(XVZ+ z3~eIUa{lfUqZ|448;{ zQAd1`K*YmN^pq!xJA;so7dswzAOMANM{w#G`cq)@z!UCA6xV@4gi$4^7U1PSZV4gD zfdWtTybmk#%t~elPW(WD=E!oMfwsrPZQS$@Bdh4xD zxXL*xIzLFn`OKgpCWUSwJ|oCM`HY|;W&|zH1tdv{+mUYzJU04W!G%eL7k)Vs*DeU# zH?~(-rSBz+T3p!z=eZ_9~PI*z4Gm9%HS5*9_kBi*RfP3JA0C`(5~*4=ZYL$z@p}&Ewo+ zq*BJpVTp`Y?+q=Fox$A;uDz69VHUd@ucWbShg|bw*WH&y!79R=7rEH7`)cgI-$!r* zWQz#QZuPY9hyqTuK2@xi)l!Y-%B2eYmh1UaHJ2?Eva~>Q`D`Iuq_v__Db{MG5-DV> zYEi9{Vx!(rXg!}J*{Y~dv31zwcj0%_{b13ryx5G`5|kTkd<4N)0$v0{`6jFqcx)Tx ze@`fJq*bU>!b<&mP|zAs?LxYFQPAkALfyoAhd|EoYS(mN>^`S%8+cvosjLaw9yXif z6}ysMXW+An_5ic%OT1VCRkfaqPBbTm(iN{}MU>_pLb7fp%Y8OlneiFM`+(*00G7fv z@moNUh>y#Zm(SP^;J@|QVr_TKN*OagW_vIR%3;j(YheGd9QPfYTHwy3k9$z%)*X25 zieRkk{WH~Sy;`Z{)m(`y{Gz+?(MJ+40xyPQV*1i0d?l2d6rLY7MdpLM9bz`&8u18f ze`k3QzBXWWKd^~lI#l%qF%GzA{D%cmx{jjZf;$JC;eAo=;FU_YoH|tU&4+2IA*W{| z!q3cdwvNNj!(#_X>V@9cy}(~eGWe(&)4?O?h(}cjN!L@C-EX1Jd=Z&Ass>yl-kY;^ z!R{Zxme}wRd~#)DV|~MO6AhxZWQDZg5o4O)Tho_jp)?KKrOR3a3Z)mXNLd(zDyIR} z>9D8I(VrKkX1?_?G4^r%uLqkx_^>^U1)m;AEJ*DyNDvqI23-s4KN(Z3yq2|Nv*E4@-pGTh;+_U`gW|uzn-x1xeoyb}fb^KfWT2zB&#Vy|IrJ<6vlCEdW6KkN2R5eZe2~ zFlm|`JXhwU2Kc2r7%R2$uo9#p8B)wDg<83qD;z#rBFW8DybQf^yf)BMg9F0Avm<@u z#EIho&Bc9183#5almXz3qBsiZtTq5T5o;U-e{{Dn`O1p20bT69j@>D6#8}6U@{TZGW_UD&i zn}?qo9&fOEGp27WVs#IgV{rYLFqj@kqH&-&o@#)|F$s?Xm_K|TfEhFFVbHvOU}%b) zWu{!t7YnpX>-;;M>_zuTz}a)xeG1S1^4lc0vbRTpK^!s%=#P&HpqIvzX&i`-s~&)K zY|^8E>Cc}7nD&_XFrY5?0X0l2M4?GkP{J=uM+z$Ng*ZZJrI-)m=z$9=K?v=?xy9=x z<$dZU1Eq{qP7ZL58~Y362P~f)Z;VWjdw?8aT^#=Z8U77X{3jSlg1q=*){YI_Eo8~89S1-A ztfBdUH-!k$?C_=#1)3l7rqGC;+c9`kXa>za-V_=_^FD71O`&OG(*dC@M^U_;HZ+}j F=0A*q>XrZi literal 0 HcmV?d00001 diff --git a/wrkplay_dbt/target/index.html b/wrkplay_dbt/target/index.html new file mode 100644 index 0000000..7f33f0a --- /dev/null +++ b/wrkplay_dbt/target/index.html @@ -0,0 +1,102 @@ + + + + + + + dbt Docs + + + + + + + + + + + + + + + + + +
icons
+
+ + diff --git a/wrkplay_dbt/target/manifest.json b/wrkplay_dbt/target/manifest.json new file mode 100644 index 0000000..ed8f633 --- /dev/null +++ b/wrkplay_dbt/target/manifest.json @@ -0,0 +1,3959 @@ +{ + "metadata": { + "dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v5.json", + "dbt_version": "1.1.1", + "generated_at": "2022-07-11T14:43:33.317205Z", + "invocation_id": "2bd1cbb2-621f-40bb-84bd-067b02dacb3e", + "env": {}, + "project_id": "0277e004dac9feee986f2513a29fe001", + "user_id": "8b987dbd-bac4-4df5-80d2-fbf9e0907c7e", + "send_anonymous_usage_stats": true, + "adapter_type": "postgres" + }, + "nodes": { + "model.wrkplay_dbt.number_played_against": { + "raw_sql": "-- gets the number of players a player has played against or with per season\nSELECT\n\tc.\"b1\" AS \"player_id\"\n\t, c.\"season_id\" AS \"season_id\"\n\t, count(DISTINCT c.\"b2\") AS \"num_played_against\"\nFROM\n\t(\n\t\tWITH all_players AS (\n\t\t\tSELECT\n\t\t\t\tl.\"A\" AS \"match_id\"\n\t\t\t\t, l.\"B\" AS \"player_id\"\n\t\t\t\t, s.slug AS \"season_id\"\n\t\t\tFROM\n\t\t\t\t\"_left\" l\n\t\t\tJOIN \"Match\" m ON l.\"A\" = m.id \n\t\t\tJOIN \"Season\" s ON m.seasonid = s.id \n\t\tUNION ALL\n\t\t\tSELECT\n\t\t\t\tr.\"A\" AS \"r_A\"\n\t\t\t\t, r.\"B\" AS \"r_B\"\n\t\t\t\t, s.slug AS \"r_season_id\"\n\t\t\tFROM\n\t\t\t\t\"_right\" r\n\t\t\tJOIN \"Match\" m ON r.\"A\" = m.id \n\t\t\tJOIN \"Season\" s ON m.seasonid = s.id \n\t\t)\n\t\tSELECT\n\t\t\ta1.\"player_id\" AS \"b1\"\n\t\t\t, a2.\"player_id\" AS \"b2\"\n\t\t\t, a1.\"season_id\" AS \"season_id\"\n\t\tFROM\n\t\t\tall_players a1\n\t\tJOIN all_players a2 ON\n\t\t\ta1.\"match_id\" = a2.\"match_id\"\n\t) c\nWHERE\n\tc.\"b1\" <> c.\"b2\"\nGROUP BY\n\tc.\"b1\"\n\t, c.\"season_id\"", + "resource_type": "model", + "depends_on": { "macros": [], "nodes": [] }, + "config": { + "enabled": true, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "meta": {}, + "materialized": "view", + "persist_docs": {}, + "quoting": {}, + "column_types": {}, + "full_refresh": null, + "unique_key": null, + "on_schema_change": "ignore", + "wrkplay_dbt": null, + "post-hook": [], + "pre-hook": [] + }, + "database": "postgres", + "schema": "public", + "fqn": ["wrkplay_dbt", "marts", "number_played_against"], + "unique_id": "model.wrkplay_dbt.number_played_against", + "package_name": "wrkplay_dbt", + "root_path": "/Users/bruno.campos/Documents/Documents - MACQ199NQ496F/saltplay/wrkplay_dbt", + "path": "marts/number_played_against.sql", + "original_file_path": "models/marts/number_played_against.sql", + "name": "number_played_against", + "alias": "number_played_against", + "checksum": { "name": "sha256", "checksum": "378c83cac78b65c3e02d6e3cbb3bb6a9145fc64798d65f0402c7bf2b3b98f14f" }, + "tags": [], + "refs": [], + "sources": [], + "description": "This table gets the number of unique players players have played against", + "columns": { + "player_id": { + "name": "player_id", + "description": "The ID of each player/user linked to the User table in public.table", + "meta": {}, + "data_type": null, + "quote": null, + "tags": [] + }, + "season_id": { + "name": "season_id", + "description": "The slug of a season linked to the Season table in public.table", + "meta": {}, + "data_type": null, + "quote": null, + "tags": [] + }, + "num_played_against": { + "name": "num_played_against", + "description": "The number of players each player has played against in a given season, i.e. season-1", + "meta": {}, + "data_type": null, + "quote": null, + "tags": [] + } + }, + "meta": {}, + "docs": { "show": true }, + "patch_path": "wrkplay_dbt://models/marts/schema.yml", + "compiled_path": null, + "build_path": null, + "deferred": false, + "unrendered_config": { "wrkplay_dbt": null }, + "created_at": 1657550602.9516559 + }, + "model.wrkplay_dbt.wins_losses": { + "raw_sql": "--number of wins and losses per player per game (per office) per season\nWITH loss_table AS (\n\tSELECT\n\t\tSUM(lt.left_losses) AS \"total_losses\"\n\t\t, lt.left_player_id AS \"loss_player_id\"\n\t\t, lt.gameid\n\t\t, lt.seasonid\n\tFROM\n\t\t(\n\t\t\tSELECT\n\t\t\t\t*\n\t\t\tFROM\n\t\t\t\t(\n\t\t\t\t\t--Begin DONE\n\t\t\t\t\tWITH left_count AS (\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\tAVG(CASE\n\t\tWHEN m.leftscore > m.rightscore THEN 0\n\t\tELSE 1\n\tEND) AS \"left_loss\"\n\t\t\t\t\t\t\t, l.\"A\"\n\t\t\t\t\t\t\t, l.\"B\"\n\t\t\t\t\t\t\t, m.\"gameid\"\n\t\t\t\t\t\t\t, m.\"seasonid\"\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t\"_left\" l\n\t\t\t\t\t\tJOIN \"Match\" m ON\n\t\t\t\t\t\t\tl.\"A\" = m.id\n\t\t\t\t\t\tGROUP BY\n\t\t\t\t\t\t\tl.\"A\"\n\t\t\t\t\t\t\t, l.\"B\"\n\t\t\t\t\t\t\t, m.\"gameid\"\n\t\t\t\t\t\t\t, m.\"seasonid\"\n\t\t\t\t\t)\n\t\t\t\t\tSELECT\n\t\t\t\t\t\tSUM(a.left_loss) AS \"left_losses\"\n\t\t\t\t\t\t, a.\"B\" AS \"left_player_id\"\n\t\t\t\t\t\t, a.\"gameid\"\n\t\t\t\t\t\t, a.\"seasonid\"\n\t\t\t\t\tFROM\n\t\t\t\t\t\tleft_count a\n\t\t\t\t\tGROUP BY\n\t\t\t\t\t\ta.\"B\"\n\t\t\t\t\t\t, a.\"gameid\"\n\t\t\t\t\t\t, a.\"seasonid\"\n\t\t\t\t\t\t--End DONE\n\t\t\t\t) ll\n\t\tUNION ALL\n\t\t\tSELECT\n\t\t\t\t*\n\t\t\tFROM\n\t\t\t\t(\n\t\t\t\t\t--Begin DONE\n\t\t\t\t\tWITH right_count AS (\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\tAVG(CASE\n\t\tWHEN m.leftscore < m.rightscore THEN 0\n\t\tELSE 1\n\tEND) AS \"right_loss\"\n\t\t\t\t\t\t\t, r.\"A\"\n\t\t\t\t\t\t\t, r.\"B\"\n\t\t\t\t\t\t\t, m.\"gameid\"\n\t\t\t\t\t\t\t, m.\"seasonid\"\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t\"_right\" r\n\t\t\t\t\t\tJOIN \"Match\" m ON\n\t\t\t\t\t\t\tr.\"A\" = m.id\n\t\t\t\t\t\tGROUP BY\n\t\t\t\t\t\t\tr.\"A\"\n\t\t\t\t\t\t\t, r.\"B\"\n\t\t\t\t\t\t\t, m.\"gameid\"\n\t\t\t\t\t\t\t, m.\"seasonid\"\n\t\t\t\t\t)\n\t\t\t\t\tSELECT\n\t\t\t\t\t\tSUM(a.right_loss) AS \"right_losses\"\n\t\t\t\t\t\t, a.\"B\" AS \"right_player_id\"\n\t\t\t\t\t\t, a.\"gameid\"\n\t\t\t\t\t\t, a.\"seasonid\"\n\t\t\t\t\tFROM\n\t\t\t\t\t\tright_count a\n\t\t\t\t\tGROUP BY\n\t\t\t\t\t\ta.\"B\"\n\t\t\t\t\t\t, a.\"gameid\"\n\t\t\t\t\t\t, a.\"seasonid\"\n\t\t\t\t\t\t--End DONE\n\t\t\t\t) rl\n\t\t) lt\n\t\t--\tWHERE lt.left_player_id = ''\n\tGROUP BY\n\t\tlt.left_player_id\n\t\t, lt.gameid\n\t\t, lt.seasonid\n)\n,\nwin_table AS (\n\t--number of wins for a player and gameid\n\tSELECT\n\t\tSUM(rt.right_wins) AS \"total_wins\"\n\t\t, rt.right_player_id AS \"win_player_id\"\n\t\t, rt.gameid\n\t\t, rt.\"seasonid\"\n\tFROM\n\t\t(\n\t\t\tSELECT\n\t\t\t\t*\n\t\t\tFROM\n\t\t\t\t(\n\t\t\t\t\tWITH right_count AS (\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\tAVG(CASE\n\t\tWHEN m.leftscore < m.rightscore THEN 1\n\t\tELSE 0\n\tEND) AS \"right_won\"\n\t\t\t\t\t\t\t, r.\"A\"\n\t\t\t\t\t\t\t, r.\"B\"\n\t\t\t\t\t\t\t, m.\"gameid\"\n\t\t\t\t\t\t\t, m.\"seasonid\"\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t\"_right\" r\n\t\t\t\t\t\tJOIN \"Match\" m ON\n\t\t\t\t\t\t\tr.\"A\" = m.id\n\t\t\t\t\t\tGROUP BY\n\t\t\t\t\t\t\tr.\"A\"\n\t\t\t\t\t\t\t, r.\"B\"\n\t\t\t\t\t\t\t, m.\"gameid\"\n\t\t\t\t\t\t\t, m.\"seasonid\"\n\t\t\t\t\t)\n\t\t\t\t\tSELECT\n\t\t\t\t\t\tSUM(a.right_won) AS \"right_wins\"\n\t\t\t\t\t\t, a.\"B\" AS \"right_player_id\"\n\t\t\t\t\t\t, a.\"gameid\"\n\t\t\t\t\t\t, a.\"seasonid\"\n\t\t\t\t\tFROM\n\t\t\t\t\t\tright_count a\n\t\t\t\t\tGROUP BY\n\t\t\t\t\t\ta.\"B\"\n\t\t\t\t\t\t, a.\"gameid\"\n\t\t\t\t\t\t, a.\"seasonid\"\n\t\t\t\t) rw\n\t\tUNION ALL\n\t\t\tSELECT\n\t\t\t\t*\n\t\t\tFROM\n\t\t\t\t(\n\t\t\t\t\tWITH left_count AS (\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\tAVG(CASE\n\t\tWHEN m.leftscore > m.rightscore THEN 1\n\t\tELSE 0\n\tEND) AS \"left_won\"\n\t\t\t\t\t\t\t, l.\"A\"\n\t\t\t\t\t\t\t, l.\"B\"\n\t\t\t\t\t\t\t, m.\"gameid\"\n\t\t\t\t\t\t\t, m.\"seasonid\"\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t\"_left\" l\n\t\t\t\t\t\tJOIN \"Match\" m ON\n\t\t\t\t\t\t\tl.\"A\" = m.id\n\t\t\t\t\t\tGROUP BY\n\t\t\t\t\t\t\tl.\"A\"\n\t\t\t\t\t\t\t, l.\"B\"\n\t\t\t\t\t\t\t, m.\"gameid\"\n\t\t\t\t\t\t\t, m.\"seasonid\"\n\t\t\t\t\t)\n\t\t\t\t\tSELECT\n\t\t\t\t\t\tSUM(a.left_won) AS \"left_wins\"\n\t\t\t\t\t\t, a.\"B\" AS \"left_player_id\"\n\t\t\t\t\t\t, a.\"gameid\"\n\t\t\t\t\t\t, a.\"seasonid\"\n\t\t\t\t\tFROM\n\t\t\t\t\t\tleft_count a\n\t\t\t\t\tGROUP BY\n\t\t\t\t\t\ta.\"B\"\n\t\t\t\t\t\t, a.\"gameid\"\n\t\t\t\t\t\t, a.\"seasonid\"\n\t\t\t\t) lw\n\t\t) rt\n\t\t-- WHERE rt.right_player_id = ''\n\tGROUP BY\n\t\trt.right_player_id\n\t\t, rt.gameid\n\t\t, rt.\"seasonid\"\n)\nSELECT\n\tCOALESCE(lt.loss_player_id, wt.win_player_id) AS \"player_id\"\n\t, COALESCE(lt.\"gameid\", wt.\"gameid\") AS \"gameid\"\n\t, COALESCE(lt.seasonid, wt.seasonid) AS \"seasonid\"\n\t, wt.\"total_wins\"\n\t, lt.\"total_losses\"\nFROM\n\tloss_table lt\nFULL OUTER JOIN win_table wt ON\n\tlt.\"loss_player_id\" = wt.\"win_player_id\"\n\tAND lt.\"gameid\" = wt.\"gameid\"\n\tAND lt.\"seasonid\" = wt.\"seasonid\"", + "resource_type": "model", + "depends_on": { "macros": [], "nodes": [] }, + "config": { + "enabled": true, + "alias": null, + "schema": null, + "database": null, + "tags": [], + "meta": {}, + "materialized": "view", + "persist_docs": {}, + "quoting": {}, + "column_types": {}, + "full_refresh": null, + "unique_key": null, + "on_schema_change": "ignore", + "wrkplay_dbt": null, + "post-hook": [], + "pre-hook": [] + }, + "database": "postgres", + "schema": "public", + "fqn": ["wrkplay_dbt", "marts", "wins_losses"], + "unique_id": "model.wrkplay_dbt.wins_losses", + "package_name": "wrkplay_dbt", + "root_path": "/Users/bruno.campos/Documents/Documents - MACQ199NQ496F/saltplay/wrkplay_dbt", + "path": "marts/wins_losses.sql", + "original_file_path": "models/marts/wins_losses.sql", + "name": "wins_losses", + "alias": "wins_losses", + "checksum": { "name": "sha256", "checksum": "486d59e16571656b25810330e3a120304e94c749955a308d4d8a4fbfceb21a08" }, + "tags": [], + "refs": [], + "sources": [], + "description": "A table that contains all the wins and losses per player per game (per office) per season", + "columns": { + "player_id": { + "name": "player_id", + "description": "The ID of each player/user linked to the User table in public.table", + "meta": {}, + "data_type": null, + "quote": null, + "tags": [] + }, + "gameid": { + "name": "gameid", + "description": "The ID of each game-office linked to the Game table in public.table", + "meta": {}, + "data_type": null, + "quote": null, + "tags": [] + }, + "seasonid": { + "name": "seasonid", + "description": "The ID of each season linked to the Season table in public.table", + "meta": {}, + "data_type": null, + "quote": null, + "tags": [] + }, + "total_wins": { + "name": "total_wins", + "description": "Count of number of wins for a player, in a game-office in a season", + "meta": {}, + "data_type": null, + "quote": null, + "tags": [] + }, + "total_losses": { + "name": "total_losses", + "description": "Count of number of losses for a player, in a game-office in a season", + "meta": {}, + "data_type": null, + "quote": null, + "tags": [] + } + }, + "meta": {}, + "docs": { "show": true }, + "patch_path": "wrkplay_dbt://models/marts/schema.yml", + "compiled_path": null, + "build_path": null, + "deferred": false, + "unrendered_config": { "wrkplay_dbt": null }, + "created_at": 1657550602.950894 + }, + "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15": { + "raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", + "test_metadata": { + "name": "not_null", + "kwargs": { "column_name": "player_id", "model": "{{ get_where_subquery(ref('wins_losses')) }}" }, + "namespace": null + }, + "compiled": true, + "resource_type": "test", + "depends_on": { + "macros": [ + "macro.dbt.test_not_null", + "macro.dbt.get_where_subquery", + "macro.dbt.should_store_failures", + "macro.dbt.statement" + ], + "nodes": ["model.wrkplay_dbt.wins_losses"] + }, + "config": { + "enabled": true, + "alias": null, + "schema": "dbt_test__audit", + "database": null, + "tags": [], + "meta": {}, + "materialized": "test", + "severity": "ERROR", + "store_failures": null, + "where": null, + "limit": null, + "fail_calc": "count(*)", + "warn_if": "!= 0", + "error_if": "!= 0" + }, + "database": "postgres", + "schema": "public_dbt_test__audit", + "fqn": ["wrkplay_dbt", "marts", "not_null_wins_losses_player_id"], + "unique_id": "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15", + "package_name": "wrkplay_dbt", + "root_path": "/Users/bruno.campos/Documents/Documents - MACQ199NQ496F/saltplay/wrkplay_dbt", + "path": "not_null_wins_losses_player_id.sql", + "original_file_path": "models/marts/schema.yml", + "name": "not_null_wins_losses_player_id", + "alias": "not_null_wins_losses_player_id", + "checksum": { "name": "none", "checksum": "" }, + "tags": [], + "refs": [["wins_losses"]], + "sources": [], + "description": "", + "columns": {}, + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "compiled_path": "target/compiled/wrkplay_dbt/models/marts/schema.yml/not_null_wins_losses_player_id.sql", + "build_path": "target/run/wrkplay_dbt/models/marts/schema.yml/not_null_wins_losses_player_id.sql", + "deferred": false, + "unrendered_config": {}, + "created_at": 1657550602.955557, + "compiled_sql": "\n \n \n\n\n\nselect player_id\nfrom \"postgres\".\"public\".\"wins_losses\"\nwhere player_id is null\n\n\n", + "extra_ctes_injected": true, + "extra_ctes": [], + "relation_name": null, + "column_name": "player_id", + "file_key_name": "models.wins_losses" + }, + "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1": { + "raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", + "test_metadata": { + "name": "not_null", + "kwargs": { "column_name": "gameid", "model": "{{ get_where_subquery(ref('wins_losses')) }}" }, + "namespace": null + }, + "compiled": true, + "resource_type": "test", + "depends_on": { + "macros": [ + "macro.dbt.test_not_null", + "macro.dbt.get_where_subquery", + "macro.dbt.should_store_failures", + "macro.dbt.statement" + ], + "nodes": ["model.wrkplay_dbt.wins_losses"] + }, + "config": { + "enabled": true, + "alias": null, + "schema": "dbt_test__audit", + "database": null, + "tags": [], + "meta": {}, + "materialized": "test", + "severity": "ERROR", + "store_failures": null, + "where": null, + "limit": null, + "fail_calc": "count(*)", + "warn_if": "!= 0", + "error_if": "!= 0" + }, + "database": "postgres", + "schema": "public_dbt_test__audit", + "fqn": ["wrkplay_dbt", "marts", "not_null_wins_losses_gameid"], + "unique_id": "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1", + "package_name": "wrkplay_dbt", + "root_path": "/Users/bruno.campos/Documents/Documents - MACQ199NQ496F/saltplay/wrkplay_dbt", + "path": "not_null_wins_losses_gameid.sql", + "original_file_path": "models/marts/schema.yml", + "name": "not_null_wins_losses_gameid", + "alias": "not_null_wins_losses_gameid", + "checksum": { "name": "none", "checksum": "" }, + "tags": [], + "refs": [["wins_losses"]], + "sources": [], + "description": "", + "columns": {}, + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "compiled_path": "target/compiled/wrkplay_dbt/models/marts/schema.yml/not_null_wins_losses_gameid.sql", + "build_path": "target/run/wrkplay_dbt/models/marts/schema.yml/not_null_wins_losses_gameid.sql", + "deferred": false, + "unrendered_config": {}, + "created_at": 1657550602.9568589, + "compiled_sql": "\n \n \n\n\n\nselect gameid\nfrom \"postgres\".\"public\".\"wins_losses\"\nwhere gameid is null\n\n\n", + "extra_ctes_injected": true, + "extra_ctes": [], + "relation_name": null, + "column_name": "gameid", + "file_key_name": "models.wins_losses" + }, + "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813": { + "raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", + "test_metadata": { + "name": "not_null", + "kwargs": { "column_name": "seasonid", "model": "{{ get_where_subquery(ref('wins_losses')) }}" }, + "namespace": null + }, + "compiled": true, + "resource_type": "test", + "depends_on": { + "macros": [ + "macro.dbt.test_not_null", + "macro.dbt.get_where_subquery", + "macro.dbt.should_store_failures", + "macro.dbt.statement" + ], + "nodes": ["model.wrkplay_dbt.wins_losses"] + }, + "config": { + "enabled": true, + "alias": null, + "schema": "dbt_test__audit", + "database": null, + "tags": [], + "meta": {}, + "materialized": "test", + "severity": "ERROR", + "store_failures": null, + "where": null, + "limit": null, + "fail_calc": "count(*)", + "warn_if": "!= 0", + "error_if": "!= 0" + }, + "database": "postgres", + "schema": "public_dbt_test__audit", + "fqn": ["wrkplay_dbt", "marts", "not_null_wins_losses_seasonid"], + "unique_id": "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813", + "package_name": "wrkplay_dbt", + "root_path": "/Users/bruno.campos/Documents/Documents - MACQ199NQ496F/saltplay/wrkplay_dbt", + "path": "not_null_wins_losses_seasonid.sql", + "original_file_path": "models/marts/schema.yml", + "name": "not_null_wins_losses_seasonid", + "alias": "not_null_wins_losses_seasonid", + "checksum": { "name": "none", "checksum": "" }, + "tags": [], + "refs": [["wins_losses"]], + "sources": [], + "description": "", + "columns": {}, + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "compiled_path": "target/compiled/wrkplay_dbt/models/marts/schema.yml/not_null_wins_losses_seasonid.sql", + "build_path": "target/run/wrkplay_dbt/models/marts/schema.yml/not_null_wins_losses_seasonid.sql", + "deferred": false, + "unrendered_config": {}, + "created_at": 1657550602.957788, + "compiled_sql": "\n \n \n\n\n\nselect seasonid\nfrom \"postgres\".\"public\".\"wins_losses\"\nwhere seasonid is null\n\n\n", + "extra_ctes_injected": true, + "extra_ctes": [], + "relation_name": null, + "column_name": "seasonid", + "file_key_name": "models.wins_losses" + }, + "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77": { + "raw_sql": "{{ test_positive_test(**_dbt_generic_test_kwargs) }}", + "test_metadata": { + "name": "positive_test", + "kwargs": { "column_name": "total_wins", "model": "{{ get_where_subquery(ref('wins_losses')) }}" }, + "namespace": null + }, + "compiled": true, + "resource_type": "test", + "depends_on": { + "macros": [ + "macro.wrkplay_dbt.test_positive_test", + "macro.dbt.get_where_subquery", + "macro.dbt.should_store_failures", + "macro.dbt.statement" + ], + "nodes": ["model.wrkplay_dbt.wins_losses"] + }, + "config": { + "enabled": true, + "alias": null, + "schema": "dbt_test__audit", + "database": null, + "tags": [], + "meta": {}, + "materialized": "test", + "severity": "ERROR", + "store_failures": null, + "where": null, + "limit": null, + "fail_calc": "count(*)", + "warn_if": "!= 0", + "error_if": "!= 0" + }, + "database": "postgres", + "schema": "public_dbt_test__audit", + "fqn": ["wrkplay_dbt", "marts", "positive_test_wins_losses_total_wins"], + "unique_id": "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77", + "package_name": "wrkplay_dbt", + "root_path": "/Users/bruno.campos/Documents/Documents - MACQ199NQ496F/saltplay/wrkplay_dbt", + "path": "positive_test_wins_losses_total_wins.sql", + "original_file_path": "models/marts/schema.yml", + "name": "positive_test_wins_losses_total_wins", + "alias": "positive_test_wins_losses_total_wins", + "checksum": { "name": "none", "checksum": "" }, + "tags": [], + "refs": [["wins_losses"]], + "sources": [], + "description": "", + "columns": {}, + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "compiled_path": "target/compiled/wrkplay_dbt/models/marts/schema.yml/positive_test_wins_losses_total_wins.sql", + "build_path": "target/run/wrkplay_dbt/models/marts/schema.yml/positive_test_wins_losses_total_wins.sql", + "deferred": false, + "unrendered_config": {}, + "created_at": 1657550602.958744, + "compiled_sql": "\n\nwith validation as (\n\n select\n total_wins as positive\n\n from \"postgres\".\"public\".\"wins_losses\"\n\n),\n\nvalidation_errors as (\n\n select\n positive \n\n from validation\n -- if this is true, then positive is actually negative!\n where positive < 0\n\n)\n\nselect *\nfrom validation_errors\n\n", + "extra_ctes_injected": true, + "extra_ctes": [], + "relation_name": null, + "column_name": "total_wins", + "file_key_name": "models.wins_losses" + }, + "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe": { + "raw_sql": "{{ test_positive_test(**_dbt_generic_test_kwargs) }}", + "test_metadata": { + "name": "positive_test", + "kwargs": { "column_name": "total_losses", "model": "{{ get_where_subquery(ref('wins_losses')) }}" }, + "namespace": null + }, + "compiled": true, + "resource_type": "test", + "depends_on": { + "macros": [ + "macro.wrkplay_dbt.test_positive_test", + "macro.dbt.get_where_subquery", + "macro.dbt.should_store_failures", + "macro.dbt.statement" + ], + "nodes": ["model.wrkplay_dbt.wins_losses"] + }, + "config": { + "enabled": true, + "alias": null, + "schema": "dbt_test__audit", + "database": null, + "tags": [], + "meta": {}, + "materialized": "test", + "severity": "ERROR", + "store_failures": null, + "where": null, + "limit": null, + "fail_calc": "count(*)", + "warn_if": "!= 0", + "error_if": "!= 0" + }, + "database": "postgres", + "schema": "public_dbt_test__audit", + "fqn": ["wrkplay_dbt", "marts", "positive_test_wins_losses_total_losses"], + "unique_id": "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe", + "package_name": "wrkplay_dbt", + "root_path": "/Users/bruno.campos/Documents/Documents - MACQ199NQ496F/saltplay/wrkplay_dbt", + "path": "positive_test_wins_losses_total_losses.sql", + "original_file_path": "models/marts/schema.yml", + "name": "positive_test_wins_losses_total_losses", + "alias": "positive_test_wins_losses_total_losses", + "checksum": { "name": "none", "checksum": "" }, + "tags": [], + "refs": [["wins_losses"]], + "sources": [], + "description": "", + "columns": {}, + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "compiled_path": "target/compiled/wrkplay_dbt/models/marts/schema.yml/positive_test_wins_losses_total_losses.sql", + "build_path": "target/run/wrkplay_dbt/models/marts/schema.yml/positive_test_wins_losses_total_losses.sql", + "deferred": false, + "unrendered_config": {}, + "created_at": 1657550602.962833, + "compiled_sql": "\n\nwith validation as (\n\n select\n total_losses as positive\n\n from \"postgres\".\"public\".\"wins_losses\"\n\n),\n\nvalidation_errors as (\n\n select\n positive \n\n from validation\n -- if this is true, then positive is actually negative!\n where positive < 0\n\n)\n\nselect *\nfrom validation_errors\n\n", + "extra_ctes_injected": true, + "extra_ctes": [], + "relation_name": null, + "column_name": "total_losses", + "file_key_name": "models.wins_losses" + }, + "test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427": { + "raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", + "test_metadata": { + "name": "not_null", + "kwargs": { "column_name": "player_id", "model": "{{ get_where_subquery(ref('number_played_against')) }}" }, + "namespace": null + }, + "compiled": true, + "resource_type": "test", + "depends_on": { + "macros": [ + "macro.dbt.test_not_null", + "macro.dbt.get_where_subquery", + "macro.dbt.should_store_failures", + "macro.dbt.statement" + ], + "nodes": ["model.wrkplay_dbt.number_played_against"] + }, + "config": { + "enabled": true, + "alias": null, + "schema": "dbt_test__audit", + "database": null, + "tags": [], + "meta": {}, + "materialized": "test", + "severity": "ERROR", + "store_failures": null, + "where": null, + "limit": null, + "fail_calc": "count(*)", + "warn_if": "!= 0", + "error_if": "!= 0" + }, + "database": "postgres", + "schema": "public_dbt_test__audit", + "fqn": ["wrkplay_dbt", "marts", "not_null_number_played_against_player_id"], + "unique_id": "test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427", + "package_name": "wrkplay_dbt", + "root_path": "/Users/bruno.campos/Documents/Documents - MACQ199NQ496F/saltplay/wrkplay_dbt", + "path": "not_null_number_played_against_player_id.sql", + "original_file_path": "models/marts/schema.yml", + "name": "not_null_number_played_against_player_id", + "alias": "not_null_number_played_against_player_id", + "checksum": { "name": "none", "checksum": "" }, + "tags": [], + "refs": [["number_played_against"]], + "sources": [], + "description": "", + "columns": {}, + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "compiled_path": "target/compiled/wrkplay_dbt/models/marts/schema.yml/not_null_number_played_against_player_id.sql", + "build_path": "target/run/wrkplay_dbt/models/marts/schema.yml/not_null_number_played_against_player_id.sql", + "deferred": false, + "unrendered_config": {}, + "created_at": 1657550602.964611, + "compiled_sql": "\n \n \n\n\n\nselect player_id\nfrom \"postgres\".\"public\".\"number_played_against\"\nwhere player_id is null\n\n\n", + "extra_ctes_injected": true, + "extra_ctes": [], + "relation_name": null, + "column_name": "player_id", + "file_key_name": "models.number_played_against" + }, + "test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073": { + "raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", + "test_metadata": { + "name": "not_null", + "kwargs": { "column_name": "season_id", "model": "{{ get_where_subquery(ref('number_played_against')) }}" }, + "namespace": null + }, + "compiled": true, + "resource_type": "test", + "depends_on": { + "macros": [ + "macro.dbt.test_not_null", + "macro.dbt.get_where_subquery", + "macro.dbt.should_store_failures", + "macro.dbt.statement" + ], + "nodes": ["model.wrkplay_dbt.number_played_against"] + }, + "config": { + "enabled": true, + "alias": null, + "schema": "dbt_test__audit", + "database": null, + "tags": [], + "meta": {}, + "materialized": "test", + "severity": "ERROR", + "store_failures": null, + "where": null, + "limit": null, + "fail_calc": "count(*)", + "warn_if": "!= 0", + "error_if": "!= 0" + }, + "database": "postgres", + "schema": "public_dbt_test__audit", + "fqn": ["wrkplay_dbt", "marts", "not_null_number_played_against_season_id"], + "unique_id": "test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073", + "package_name": "wrkplay_dbt", + "root_path": "/Users/bruno.campos/Documents/Documents - MACQ199NQ496F/saltplay/wrkplay_dbt", + "path": "not_null_number_played_against_season_id.sql", + "original_file_path": "models/marts/schema.yml", + "name": "not_null_number_played_against_season_id", + "alias": "not_null_number_played_against_season_id", + "checksum": { "name": "none", "checksum": "" }, + "tags": [], + "refs": [["number_played_against"]], + "sources": [], + "description": "", + "columns": {}, + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "compiled_path": "target/compiled/wrkplay_dbt/models/marts/schema.yml/not_null_number_played_against_season_id.sql", + "build_path": "target/run/wrkplay_dbt/models/marts/schema.yml/not_null_number_played_against_season_id.sql", + "deferred": false, + "unrendered_config": {}, + "created_at": 1657550602.9653802, + "compiled_sql": "\n \n \n\n\n\nselect season_id\nfrom \"postgres\".\"public\".\"number_played_against\"\nwhere season_id is null\n\n\n", + "extra_ctes_injected": true, + "extra_ctes": [], + "relation_name": null, + "column_name": "season_id", + "file_key_name": "models.number_played_against" + }, + "test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c": { + "raw_sql": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", + "test_metadata": { + "name": "not_null", + "kwargs": { + "column_name": "num_played_against", + "model": "{{ get_where_subquery(ref('number_played_against')) }}" + }, + "namespace": null + }, + "compiled": true, + "resource_type": "test", + "depends_on": { + "macros": [ + "macro.dbt.test_not_null", + "macro.dbt.get_where_subquery", + "macro.dbt.should_store_failures", + "macro.dbt.statement" + ], + "nodes": ["model.wrkplay_dbt.number_played_against"] + }, + "config": { + "enabled": true, + "alias": null, + "schema": "dbt_test__audit", + "database": null, + "tags": [], + "meta": {}, + "materialized": "test", + "severity": "ERROR", + "store_failures": null, + "where": null, + "limit": null, + "fail_calc": "count(*)", + "warn_if": "!= 0", + "error_if": "!= 0" + }, + "database": "postgres", + "schema": "public_dbt_test__audit", + "fqn": ["wrkplay_dbt", "marts", "not_null_number_played_against_num_played_against"], + "unique_id": "test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c", + "package_name": "wrkplay_dbt", + "root_path": "/Users/bruno.campos/Documents/Documents - MACQ199NQ496F/saltplay/wrkplay_dbt", + "path": "not_null_number_played_against_num_played_against.sql", + "original_file_path": "models/marts/schema.yml", + "name": "not_null_number_played_against_num_played_against", + "alias": "not_null_number_played_against_num_played_against", + "checksum": { "name": "none", "checksum": "" }, + "tags": [], + "refs": [["number_played_against"]], + "sources": [], + "description": "", + "columns": {}, + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "compiled_path": "target/compiled/wrkplay_dbt/models/marts/schema.yml/not_null_number_played_against_num_played_against.sql", + "build_path": "target/run/wrkplay_dbt/models/marts/schema.yml/not_null_number_played_against_num_played_against.sql", + "deferred": false, + "unrendered_config": {}, + "created_at": 1657550602.9662569, + "compiled_sql": "\n \n \n\n\n\nselect num_played_against\nfrom \"postgres\".\"public\".\"number_played_against\"\nwhere num_played_against is null\n\n\n", + "extra_ctes_injected": true, + "extra_ctes": [], + "relation_name": null, + "column_name": "num_played_against", + "file_key_name": "models.number_played_against" + }, + "test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20": { + "raw_sql": "{{ test_positive_test(**_dbt_generic_test_kwargs) }}", + "test_metadata": { + "name": "positive_test", + "kwargs": { + "column_name": "num_played_against", + "model": "{{ get_where_subquery(ref('number_played_against')) }}" + }, + "namespace": null + }, + "compiled": true, + "resource_type": "test", + "depends_on": { + "macros": [ + "macro.wrkplay_dbt.test_positive_test", + "macro.dbt.get_where_subquery", + "macro.dbt.should_store_failures", + "macro.dbt.statement" + ], + "nodes": ["model.wrkplay_dbt.number_played_against"] + }, + "config": { + "enabled": true, + "alias": null, + "schema": "dbt_test__audit", + "database": null, + "tags": [], + "meta": {}, + "materialized": "test", + "severity": "ERROR", + "store_failures": null, + "where": null, + "limit": null, + "fail_calc": "count(*)", + "warn_if": "!= 0", + "error_if": "!= 0" + }, + "database": "postgres", + "schema": "public_dbt_test__audit", + "fqn": ["wrkplay_dbt", "marts", "positive_test_number_played_against_num_played_against"], + "unique_id": "test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20", + "package_name": "wrkplay_dbt", + "root_path": "/Users/bruno.campos/Documents/Documents - MACQ199NQ496F/saltplay/wrkplay_dbt", + "path": "positive_test_number_played_against_num_played_against.sql", + "original_file_path": "models/marts/schema.yml", + "name": "positive_test_number_played_against_num_played_against", + "alias": "positive_test_number_played_against_num_played_against", + "checksum": { "name": "none", "checksum": "" }, + "tags": [], + "refs": [["number_played_against"]], + "sources": [], + "description": "", + "columns": {}, + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "compiled_path": "target/compiled/wrkplay_dbt/models/marts/schema.yml/positive_test_number_played_against_num_played_against.sql", + "build_path": "target/run/wrkplay_dbt/models/marts/schema.yml/positive_test_number_played_against_num_played_against.sql", + "deferred": false, + "unrendered_config": {}, + "created_at": 1657550602.967049, + "compiled_sql": "\n\nwith validation as (\n\n select\n num_played_against as positive\n\n from \"postgres\".\"public\".\"number_played_against\"\n\n),\n\nvalidation_errors as (\n\n select\n positive \n\n from validation\n -- if this is true, then positive is actually negative!\n where positive < 0\n\n)\n\nselect *\nfrom validation_errors\n\n", + "extra_ctes_injected": true, + "extra_ctes": [], + "relation_name": null, + "column_name": "num_played_against", + "file_key_name": "models.number_played_against" + } + }, + "sources": {}, + "macros": { + "macro.wrkplay_dbt.test_positive_test": { + "unique_id": "macro.wrkplay_dbt.test_positive_test", + "package_name": "wrkplay_dbt", + "root_path": "/Users/bruno.campos/Documents/Documents - MACQ199NQ496F/saltplay/wrkplay_dbt", + "path": "macros/positive_test.sql", + "original_file_path": "macros/positive_test.sql", + "name": "test_positive_test", + "macro_sql": "{% test positive_test(model, column_name) %}\n\nwith validation as (\n\n select\n {{ column_name }} as positive\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n positive \n\n from validation\n -- if this is true, then positive is actually negative!\n where positive < 0\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.038833 + }, + "macro.dbt_postgres.postgres__get_catalog": { + "unique_id": "macro.dbt_postgres.postgres__get_catalog", + "package_name": "dbt_postgres", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/postgres", + "path": "macros/catalog.sql", + "original_file_path": "macros/catalog.sql", + "name": "postgres__get_catalog", + "macro_sql": "{% macro postgres__get_catalog(information_schema, schemas) -%}\n\n {%- call statement('catalog', fetch_result=True) -%}\n {#\n If the user has multiple databases set and the first one is wrong, this will fail.\n But we won't fail in the case where there are multiple quoting-difference-only dbs, which is better.\n #}\n {% set database = information_schema.database %}\n {{ adapter.verify_database(database) }}\n\n select\n '{{ database }}' as table_database,\n sch.nspname as table_schema,\n tbl.relname as table_name,\n case tbl.relkind\n when 'v' then 'VIEW'\n else 'BASE TABLE'\n end as table_type,\n tbl_desc.description as table_comment,\n col.attname as column_name,\n col.attnum as column_index,\n pg_catalog.format_type(col.atttypid, col.atttypmod) as column_type,\n col_desc.description as column_comment,\n pg_get_userbyid(tbl.relowner) as table_owner\n\n from pg_catalog.pg_namespace sch\n join pg_catalog.pg_class tbl on tbl.relnamespace = sch.oid\n join pg_catalog.pg_attribute col on col.attrelid = tbl.oid\n left outer join pg_catalog.pg_description tbl_desc on (tbl_desc.objoid = tbl.oid and tbl_desc.objsubid = 0)\n left outer join pg_catalog.pg_description col_desc on (col_desc.objoid = tbl.oid and col_desc.objsubid = col.attnum)\n\n where (\n {%- for schema in schemas -%}\n upper(sch.nspname) = upper('{{ schema }}'){%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n and not pg_is_other_temp_schema(sch.oid) -- not a temporary schema belonging to another session\n and tbl.relpersistence in ('p', 'u') -- [p]ermanent table or [u]nlogged table. Exclude [t]emporary tables\n and tbl.relkind in ('r', 'v', 'f', 'p') -- o[r]dinary table, [v]iew, [f]oreign table, [p]artitioned table. Other values are [i]ndex, [S]equence, [c]omposite type, [t]OAST table, [m]aterialized view\n and col.attnum > 0 -- negative numbers are used for system columns such as oid\n and not col.attisdropped -- column as not been dropped\n\n order by\n sch.nspname,\n tbl.relname,\n col.attnum\n\n {%- endcall -%}\n\n {{ return(load_result('catalog').table) }}\n\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.statement"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.040407 + }, + "macro.dbt_postgres.postgres_get_relations": { + "unique_id": "macro.dbt_postgres.postgres_get_relations", + "package_name": "dbt_postgres", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/postgres", + "path": "macros/relations.sql", + "original_file_path": "macros/relations.sql", + "name": "postgres_get_relations", + "macro_sql": "{% macro postgres_get_relations () -%}\n\n {#\n -- in pg_depend, objid is the dependent, refobjid is the referenced object\n -- > a pg_depend entry indicates that the referenced object cannot be\n -- > dropped without also dropping the dependent object.\n #}\n\n {%- call statement('relations', fetch_result=True) -%}\n with relation as (\n select\n pg_rewrite.ev_class as class,\n pg_rewrite.oid as id\n from pg_rewrite\n ),\n class as (\n select\n oid as id,\n relname as name,\n relnamespace as schema,\n relkind as kind\n from pg_class\n ),\n dependency as (\n select distinct\n pg_depend.objid as id,\n pg_depend.refobjid as ref\n from pg_depend\n ),\n schema as (\n select\n pg_namespace.oid as id,\n pg_namespace.nspname as name\n from pg_namespace\n where nspname != 'information_schema' and nspname not like 'pg\\_%'\n ),\n referenced as (\n select\n relation.id AS id,\n referenced_class.name ,\n referenced_class.schema ,\n referenced_class.kind\n from relation\n join class as referenced_class on relation.class=referenced_class.id\n where referenced_class.kind in ('r', 'v')\n ),\n relationships as (\n select\n referenced.name as referenced_name,\n referenced.schema as referenced_schema_id,\n dependent_class.name as dependent_name,\n dependent_class.schema as dependent_schema_id,\n referenced.kind as kind\n from referenced\n join dependency on referenced.id=dependency.id\n join class as dependent_class on dependency.ref=dependent_class.id\n where\n (referenced.name != dependent_class.name or\n referenced.schema != dependent_class.schema)\n )\n\n select\n referenced_schema.name as referenced_schema,\n relationships.referenced_name as referenced_name,\n dependent_schema.name as dependent_schema,\n relationships.dependent_name as dependent_name\n from relationships\n join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id\n join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id\n group by referenced_schema, referenced_name, dependent_schema, dependent_name\n order by referenced_schema, referenced_name, dependent_schema, dependent_name;\n\n {%- endcall -%}\n\n {{ return(load_result('relations').table) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.statement"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.0411232 + }, + "macro.dbt_postgres.postgres__create_table_as": { + "unique_id": "macro.dbt_postgres.postgres__create_table_as", + "package_name": "dbt_postgres", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/postgres", + "path": "macros/adapters.sql", + "original_file_path": "macros/adapters.sql", + "name": "postgres__create_table_as", + "macro_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n as (\n {{ sql }}\n );\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.046924 + }, + "macro.dbt_postgres.postgres__get_create_index_sql": { + "unique_id": "macro.dbt_postgres.postgres__get_create_index_sql", + "package_name": "dbt_postgres", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/postgres", + "path": "macros/adapters.sql", + "original_file_path": "macros/adapters.sql", + "name": "postgres__get_create_index_sql", + "macro_sql": "{% macro postgres__get_create_index_sql(relation, index_dict) -%}\n {%- set index_config = adapter.parse_index(index_dict) -%}\n {%- set comma_separated_columns = \", \".join(index_config.columns) -%}\n {%- set index_name = index_config.render(relation) -%}\n\n create {% if index_config.unique -%}\n unique\n {%- endif %} index if not exists\n \"{{ index_name }}\"\n on {{ relation }} {% if index_config.type -%}\n using {{ index_config.type }}\n {%- endif %}\n ({{ comma_separated_columns }});\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.0474749 + }, + "macro.dbt_postgres.postgres__create_schema": { + "unique_id": "macro.dbt_postgres.postgres__create_schema", + "package_name": "dbt_postgres", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/postgres", + "path": "macros/adapters.sql", + "original_file_path": "macros/adapters.sql", + "name": "postgres__create_schema", + "macro_sql": "{% macro postgres__create_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier().include(database=False) }}\n {%- endcall -%}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.statement"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.04782 + }, + "macro.dbt_postgres.postgres__drop_schema": { + "unique_id": "macro.dbt_postgres.postgres__drop_schema", + "package_name": "dbt_postgres", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/postgres", + "path": "macros/adapters.sql", + "original_file_path": "macros/adapters.sql", + "name": "postgres__drop_schema", + "macro_sql": "{% macro postgres__drop_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier().include(database=False) }} cascade\n {%- endcall -%}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.statement"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.04816 + }, + "macro.dbt_postgres.postgres__get_columns_in_relation": { + "unique_id": "macro.dbt_postgres.postgres__get_columns_in_relation", + "package_name": "dbt_postgres", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/postgres", + "path": "macros/adapters.sql", + "original_file_path": "macros/adapters.sql", + "name": "postgres__get_columns_in_relation", + "macro_sql": "{% macro postgres__get_columns_in_relation(relation) -%}\n {% call statement('get_columns_in_relation', fetch_result=True) %}\n select\n column_name,\n data_type,\n character_maximum_length,\n numeric_precision,\n numeric_scale\n\n from {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\n {% endif %}\n order by ordinal_position\n\n {% endcall %}\n {% set table = load_result('get_columns_in_relation').table %}\n {{ return(sql_convert_columns_in_relation(table)) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.statement", "macro.dbt.sql_convert_columns_in_relation"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.048665 + }, + "macro.dbt_postgres.postgres__list_relations_without_caching": { + "unique_id": "macro.dbt_postgres.postgres__list_relations_without_caching", + "package_name": "dbt_postgres", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/postgres", + "path": "macros/adapters.sql", + "original_file_path": "macros/adapters.sql", + "name": "postgres__list_relations_without_caching", + "macro_sql": "{% macro postgres__list_relations_without_caching(schema_relation) %}\n {% call statement('list_relations_without_caching', fetch_result=True) -%}\n select\n '{{ schema_relation.database }}' as database,\n tablename as name,\n schemaname as schema,\n 'table' as type\n from pg_tables\n where schemaname ilike '{{ schema_relation.schema }}'\n union all\n select\n '{{ schema_relation.database }}' as database,\n viewname as name,\n schemaname as schema,\n 'view' as type\n from pg_views\n where schemaname ilike '{{ schema_relation.schema }}'\n {% endcall %}\n {{ return(load_result('list_relations_without_caching').table) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.statement"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.049053 + }, + "macro.dbt_postgres.postgres__information_schema_name": { + "unique_id": "macro.dbt_postgres.postgres__information_schema_name", + "package_name": "dbt_postgres", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/postgres", + "path": "macros/adapters.sql", + "original_file_path": "macros/adapters.sql", + "name": "postgres__information_schema_name", + "macro_sql": "{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.049237 + }, + "macro.dbt_postgres.postgres__list_schemas": { + "unique_id": "macro.dbt_postgres.postgres__list_schemas", + "package_name": "dbt_postgres", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/postgres", + "path": "macros/adapters.sql", + "original_file_path": "macros/adapters.sql", + "name": "postgres__list_schemas", + "macro_sql": "{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.statement"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.0496051 + }, + "macro.dbt_postgres.postgres__check_schema_exists": { + "unique_id": "macro.dbt_postgres.postgres__check_schema_exists", + "package_name": "dbt_postgres", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/postgres", + "path": "macros/adapters.sql", + "original_file_path": "macros/adapters.sql", + "name": "postgres__check_schema_exists", + "macro_sql": "{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.statement"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.050027 + }, + "macro.dbt_postgres.postgres__current_timestamp": { + "unique_id": "macro.dbt_postgres.postgres__current_timestamp", + "package_name": "dbt_postgres", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/postgres", + "path": "macros/adapters.sql", + "original_file_path": "macros/adapters.sql", + "name": "postgres__current_timestamp", + "macro_sql": "{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.050108 + }, + "macro.dbt_postgres.postgres__snapshot_string_as_time": { + "unique_id": "macro.dbt_postgres.postgres__snapshot_string_as_time", + "package_name": "dbt_postgres", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/postgres", + "path": "macros/adapters.sql", + "original_file_path": "macros/adapters.sql", + "name": "postgres__snapshot_string_as_time", + "macro_sql": "{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.0503 + }, + "macro.dbt_postgres.postgres__snapshot_get_time": { + "unique_id": "macro.dbt_postgres.postgres__snapshot_get_time", + "package_name": "dbt_postgres", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/postgres", + "path": "macros/adapters.sql", + "original_file_path": "macros/adapters.sql", + "name": "postgres__snapshot_get_time", + "macro_sql": "{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.current_timestamp"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.050407 + }, + "macro.dbt_postgres.postgres__make_temp_relation": { + "unique_id": "macro.dbt_postgres.postgres__make_temp_relation", + "package_name": "dbt_postgres", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/postgres", + "path": "macros/adapters.sql", + "original_file_path": "macros/adapters.sql", + "name": "postgres__make_temp_relation", + "macro_sql": "{% macro postgres__make_temp_relation(base_relation, suffix) %}\n {% set dt = modules.datetime.datetime.now() %}\n {% set dtstring = dt.strftime(\"%H%M%S%f\") %}\n {% set suffix_length = suffix|length + dtstring|length %}\n {% set relation_max_name_length = 63 %}\n {% if suffix_length > relation_max_name_length %}\n {% do exceptions.raise_compiler_error('Temp relation suffix is too long (' ~ suffix|length ~ ' characters). Maximum length is ' ~ (relation_max_name_length - dtstring|length) ~ ' characters.') %}\n {% endif %}\n {% set tmp_identifier = base_relation.identifier[:relation_max_name_length - suffix_length] ~ suffix ~ dtstring %}\n {% do return(base_relation.incorporate(\n path={\n \"identifier\": tmp_identifier,\n \"schema\": none,\n \"database\": none\n })) -%}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.052812 + }, + "macro.dbt_postgres.postgres_escape_comment": { + "unique_id": "macro.dbt_postgres.postgres_escape_comment", + "package_name": "dbt_postgres", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/postgres", + "path": "macros/adapters.sql", + "original_file_path": "macros/adapters.sql", + "name": "postgres_escape_comment", + "macro_sql": "{% macro postgres_escape_comment(comment) -%}\n {% if comment is not string %}\n {% do exceptions.raise_compiler_error('cannot escape a non-string: ' ~ comment) %}\n {% endif %}\n {%- set magic = '$dbt_comment_literal_block$' -%}\n {%- if magic in comment -%}\n {%- do exceptions.raise_compiler_error('The string ' ~ magic ~ ' is not allowed in comments.') -%}\n {%- endif -%}\n {{ magic }}{{ comment }}{{ magic }}\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.053313 + }, + "macro.dbt_postgres.postgres__alter_relation_comment": { + "unique_id": "macro.dbt_postgres.postgres__alter_relation_comment", + "package_name": "dbt_postgres", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/postgres", + "path": "macros/adapters.sql", + "original_file_path": "macros/adapters.sql", + "name": "postgres__alter_relation_comment", + "macro_sql": "{% macro postgres__alter_relation_comment(relation, comment) %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n comment on {{ relation.type }} {{ relation }} is {{ escaped_comment }};\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt_postgres.postgres_escape_comment"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.0535622 + }, + "macro.dbt_postgres.postgres__alter_column_comment": { + "unique_id": "macro.dbt_postgres.postgres__alter_column_comment", + "package_name": "dbt_postgres", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/postgres", + "path": "macros/adapters.sql", + "original_file_path": "macros/adapters.sql", + "name": "postgres__alter_column_comment", + "macro_sql": "{% macro postgres__alter_column_comment(relation, column_dict) %}\n {% set existing_columns = adapter.get_columns_in_relation(relation) | map(attribute=\"name\") | list %}\n {% for column_name in column_dict if (column_name in existing_columns) %}\n {% set comment = column_dict[column_name]['description'] %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n comment on column {{ relation }}.{{ adapter.quote(column_name) if column_dict[column_name]['quote'] else column_name }} is {{ escaped_comment }};\n {% endfor %}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt_postgres.postgres_escape_comment"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.054215 + }, + "macro.dbt_postgres.postgres__snapshot_merge_sql": { + "unique_id": "macro.dbt_postgres.postgres__snapshot_merge_sql", + "package_name": "dbt_postgres", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/postgres", + "path": "macros/materializations/snapshot_merge.sql", + "original_file_path": "macros/materializations/snapshot_merge.sql", + "name": "postgres__snapshot_merge_sql", + "macro_sql": "{% macro postgres__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n update {{ target }}\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_scd_id::text = {{ target }}.dbt_scd_id::text\n and DBT_INTERNAL_SOURCE.dbt_change_type::text in ('update'::text, 'delete'::text)\n and {{ target }}.dbt_valid_to is null;\n\n insert into {{ target }} ({{ insert_cols_csv }})\n select {% for column in insert_cols -%}\n DBT_INTERNAL_SOURCE.{{ column }} {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_change_type::text = 'insert'::text;\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.055192 + }, + "macro.dbt.run_hooks": { + "unique_id": "macro.dbt.run_hooks", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/hooks.sql", + "original_file_path": "macros/materializations/hooks.sql", + "name": "run_hooks", + "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.statement"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.056347 + }, + "macro.dbt.make_hook_config": { + "unique_id": "macro.dbt.make_hook_config", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/hooks.sql", + "original_file_path": "macros/materializations/hooks.sql", + "name": "make_hook_config", + "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.056544 + }, + "macro.dbt.before_begin": { + "unique_id": "macro.dbt.before_begin", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/hooks.sql", + "original_file_path": "macros/materializations/hooks.sql", + "name": "before_begin", + "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.make_hook_config"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.0566819 + }, + "macro.dbt.in_transaction": { + "unique_id": "macro.dbt.in_transaction", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/hooks.sql", + "original_file_path": "macros/materializations/hooks.sql", + "name": "in_transaction", + "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.make_hook_config"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.056819 + }, + "macro.dbt.after_commit": { + "unique_id": "macro.dbt.after_commit", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/hooks.sql", + "original_file_path": "macros/materializations/hooks.sql", + "name": "after_commit", + "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.make_hook_config"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.0569549 + }, + "macro.dbt.set_sql_header": { + "unique_id": "macro.dbt.set_sql_header", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/configs.sql", + "original_file_path": "macros/materializations/configs.sql", + "name": "set_sql_header", + "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.057374 + }, + "macro.dbt.should_full_refresh": { + "unique_id": "macro.dbt.should_full_refresh", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/configs.sql", + "original_file_path": "macros/materializations/configs.sql", + "name": "should_full_refresh", + "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.057674 + }, + "macro.dbt.should_store_failures": { + "unique_id": "macro.dbt.should_store_failures", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/configs.sql", + "original_file_path": "macros/materializations/configs.sql", + "name": "should_store_failures", + "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.057973 + }, + "macro.dbt.snapshot_merge_sql": { + "unique_id": "macro.dbt.snapshot_merge_sql", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/snapshots/snapshot_merge.sql", + "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", + "name": "snapshot_merge_sql", + "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt_postgres.postgres__snapshot_merge_sql"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.058452 + }, + "macro.dbt.default__snapshot_merge_sql": { + "unique_id": "macro.dbt.default__snapshot_merge_sql", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/snapshots/snapshot_merge.sql", + "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", + "name": "default__snapshot_merge_sql", + "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.dbt_scd_id = DBT_INTERNAL_DEST.dbt_scd_id\n\n when matched\n and DBT_INTERNAL_DEST.dbt_valid_to is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.058723 + }, + "macro.dbt.strategy_dispatch": { + "unique_id": "macro.dbt.strategy_dispatch", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/snapshots/strategies.sql", + "original_file_path": "macros/materializations/snapshots/strategies.sql", + "name": "strategy_dispatch", + "macro_sql": "{% macro strategy_dispatch(name) -%}\n{% set original_name = name %}\n {% if '.' in name %}\n {% set package_name, name = name.split(\".\", 1) %}\n {% else %}\n {% set package_name = none %}\n {% endif %}\n\n {% if package_name is none %}\n {% set package_context = context %}\n {% elif package_name in context %}\n {% set package_context = context[package_name] %}\n {% else %}\n {% set error_msg %}\n Could not find package '{{package_name}}', called with '{{original_name}}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n\n {%- set search_name = 'snapshot_' ~ name ~ '_strategy' -%}\n\n {% if search_name not in package_context %}\n {% set error_msg %}\n The specified strategy macro '{{name}}' was not found in package '{{ package_name }}'\n {% endset %}\n {{ exceptions.raise_compiler_error(error_msg | trim) }}\n {% endif %}\n {{ return(package_context[search_name]) }}\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.062345 + }, + "macro.dbt.snapshot_hash_arguments": { + "unique_id": "macro.dbt.snapshot_hash_arguments", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/snapshots/strategies.sql", + "original_file_path": "macros/materializations/snapshots/strategies.sql", + "name": "snapshot_hash_arguments", + "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__snapshot_hash_arguments"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.062526 + }, + "macro.dbt.default__snapshot_hash_arguments": { + "unique_id": "macro.dbt.default__snapshot_hash_arguments", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/snapshots/strategies.sql", + "original_file_path": "macros/materializations/snapshots/strategies.sql", + "name": "default__snapshot_hash_arguments", + "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.062751 + }, + "macro.dbt.snapshot_get_time": { + "unique_id": "macro.dbt.snapshot_get_time", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/snapshots/strategies.sql", + "original_file_path": "macros/materializations/snapshots/strategies.sql", + "name": "snapshot_get_time", + "macro_sql": "{% macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt_postgres.postgres__snapshot_get_time"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.062897 + }, + "macro.dbt.default__snapshot_get_time": { + "unique_id": "macro.dbt.default__snapshot_get_time", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/snapshots/strategies.sql", + "original_file_path": "macros/materializations/snapshots/strategies.sql", + "name": "default__snapshot_get_time", + "macro_sql": "{% macro default__snapshot_get_time() -%}\n {{ current_timestamp() }}\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.current_timestamp"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.062997 + }, + "macro.dbt.snapshot_timestamp_strategy": { + "unique_id": "macro.dbt.snapshot_timestamp_strategy", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/snapshots/strategies.sql", + "original_file_path": "macros/materializations/snapshots/strategies.sql", + "name": "snapshot_timestamp_strategy", + "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set primary_key = config['unique_key'] %}\n {% set updated_at = config['updated_at'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.dbt_valid_from < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.snapshot_hash_arguments"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.06384 + }, + "macro.dbt.snapshot_string_as_time": { + "unique_id": "macro.dbt.snapshot_string_as_time", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/snapshots/strategies.sql", + "original_file_path": "macros/materializations/snapshots/strategies.sql", + "name": "snapshot_string_as_time", + "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt_postgres.postgres__snapshot_string_as_time"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.0640152 + }, + "macro.dbt.default__snapshot_string_as_time": { + "unique_id": "macro.dbt.default__snapshot_string_as_time", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/snapshots/strategies.sql", + "original_file_path": "macros/materializations/snapshots/strategies.sql", + "name": "default__snapshot_string_as_time", + "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.064192 + }, + "macro.dbt.snapshot_check_all_get_existing_columns": { + "unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/snapshots/strategies.sql", + "original_file_path": "macros/materializations/snapshots/strategies.sql", + "name": "snapshot_check_all_get_existing_columns", + "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists) -%}\n {%- set query_columns = get_columns_in_query(node['compiled_sql']) -%}\n {%- if not target_exists -%}\n {# no table yet -> return whatever the query does #}\n {{ return([false, query_columns]) }}\n {%- endif -%}\n {# handle any schema changes #}\n {%- set target_table = node.get('alias', node.get('name')) -%}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=target_table) -%}\n {%- set existing_cols = get_columns_in_query('select * from ' ~ target_relation) -%}\n {%- set ns = namespace() -%} {# handle for-loop scoping with a namespace #}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(col) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return([ns.column_added, intersection]) }}\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.get_columns_in_query"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.0652318 + }, + "macro.dbt.snapshot_check_strategy": { + "unique_id": "macro.dbt.snapshot_check_strategy", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/snapshots/strategies.sql", + "original_file_path": "macros/materializations/snapshots/strategies.sql", + "name": "snapshot_check_strategy", + "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set check_cols_config = config['check_cols'] %}\n {% set primary_key = config['unique_key'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n {% set updated_at = config.get('updated_at', snapshot_get_time()) %}\n\n {% set column_added = false %}\n\n {% if check_cols_config == 'all' %}\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists) %}\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {% set check_cols = check_cols_config %}\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { + "macros": [ + "macro.dbt.snapshot_get_time", + "macro.dbt.snapshot_check_all_get_existing_columns", + "macro.dbt.get_true_sql", + "macro.dbt.snapshot_hash_arguments" + ] + }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.066852 + }, + "macro.dbt.create_columns": { + "unique_id": "macro.dbt.create_columns", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/snapshots/helpers.sql", + "original_file_path": "macros/materializations/snapshots/helpers.sql", + "name": "create_columns", + "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__create_columns"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.0706382 + }, + "macro.dbt.default__create_columns": { + "unique_id": "macro.dbt.default__create_columns", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/snapshots/helpers.sql", + "original_file_path": "macros/materializations/snapshots/helpers.sql", + "name": "default__create_columns", + "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.statement"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.070922 + }, + "macro.dbt.post_snapshot": { + "unique_id": "macro.dbt.post_snapshot", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/snapshots/helpers.sql", + "original_file_path": "macros/materializations/snapshots/helpers.sql", + "name": "post_snapshot", + "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__post_snapshot"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.071094 + }, + "macro.dbt.default__post_snapshot": { + "unique_id": "macro.dbt.default__post_snapshot", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/snapshots/helpers.sql", + "original_file_path": "macros/materializations/snapshots/helpers.sql", + "name": "default__post_snapshot", + "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.0711849 + }, + "macro.dbt.get_true_sql": { + "unique_id": "macro.dbt.get_true_sql", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/snapshots/helpers.sql", + "original_file_path": "macros/materializations/snapshots/helpers.sql", + "name": "get_true_sql", + "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__get_true_sql"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.071332 + }, + "macro.dbt.default__get_true_sql": { + "unique_id": "macro.dbt.default__get_true_sql", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/snapshots/helpers.sql", + "original_file_path": "macros/materializations/snapshots/helpers.sql", + "name": "default__get_true_sql", + "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.071444 + }, + "macro.dbt.snapshot_staging_table": { + "unique_id": "macro.dbt.snapshot_staging_table", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/snapshots/helpers.sql", + "original_file_path": "macros/materializations/snapshots/helpers.sql", + "name": "snapshot_staging_table", + "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__snapshot_staging_table"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.07165 + }, + "macro.dbt.default__snapshot_staging_table": { + "unique_id": "macro.dbt.default__snapshot_staging_table", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/snapshots/helpers.sql", + "original_file_path": "macros/materializations/snapshots/helpers.sql", + "name": "default__snapshot_staging_table", + "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *,\n {{ strategy.unique_key }} as dbt_unique_key\n\n from {{ target_relation }}\n where dbt_valid_to is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to,\n {{ strategy.scd_id }} as dbt_scd_id\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n {{ strategy.updated_at }} as dbt_valid_to\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.dbt_scd_id\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as dbt_valid_from,\n {{ snapshot_get_time() }} as dbt_updated_at,\n {{ snapshot_get_time() }} as dbt_valid_to,\n snapshotted_data.dbt_scd_id\n\n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.snapshot_get_time"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.072525 + }, + "macro.dbt.build_snapshot_table": { + "unique_id": "macro.dbt.build_snapshot_table", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/snapshots/helpers.sql", + "original_file_path": "macros/materializations/snapshots/helpers.sql", + "name": "build_snapshot_table", + "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__build_snapshot_table"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.072712 + }, + "macro.dbt.default__build_snapshot_table": { + "unique_id": "macro.dbt.default__build_snapshot_table", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/snapshots/helpers.sql", + "original_file_path": "macros/materializations/snapshots/helpers.sql", + "name": "default__build_snapshot_table", + "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.072974 + }, + "macro.dbt.build_snapshot_staging_table": { + "unique_id": "macro.dbt.build_snapshot_staging_table", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/snapshots/helpers.sql", + "original_file_path": "macros/materializations/snapshots/helpers.sql", + "name": "build_snapshot_staging_table", + "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, tmp_relation, select) }}\n {% endcall %}\n\n {% do return(tmp_relation) %}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { + "macros": [ + "macro.dbt.make_temp_relation", + "macro.dbt.snapshot_staging_table", + "macro.dbt.statement", + "macro.dbt.create_table_as" + ] + }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.073411 + }, + "macro.dbt.materialization_snapshot_default": { + "unique_id": "macro.dbt.materialization_snapshot_default", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/snapshots/snapshot.sql", + "original_file_path": "macros/materializations/snapshots/snapshot.sql", + "name": "materialization_snapshot_default", + "macro_sql": "{% materialization snapshot, default %}\n {%- set config = model['config'] -%}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", config, target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_sql']) %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {{ adapter.valid_snapshot_target(target_relation) }}\n\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", + "resource_type": "macro", + "tags": [], + "depends_on": { + "macros": [ + "macro.dbt.get_or_create_relation", + "macro.dbt.run_hooks", + "macro.dbt.strategy_dispatch", + "macro.dbt.build_snapshot_table", + "macro.dbt.create_table_as", + "macro.dbt.build_snapshot_staging_table", + "macro.dbt.create_columns", + "macro.dbt.snapshot_merge_sql", + "macro.dbt.statement", + "macro.dbt.persist_docs", + "macro.dbt.create_indexes", + "macro.dbt.post_snapshot" + ] + }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.078885 + }, + "macro.dbt.materialization_test_default": { + "unique_id": "macro.dbt.materialization_test_default", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/tests/test.sql", + "original_file_path": "macros/materializations/tests/test.sql", + "name": "materialization_test_default", + "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type='table') -%} %}\n\n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n {% call statement(auto_begin=True) %}\n {{ create_table_as(False, target_relation, sql) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n\n {{ adapter.commit() }}\n\n {% else %}\n\n {% set main_sql = sql %}\n\n {% endif %}\n\n {% set limit = config.get('limit') %}\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", + "resource_type": "macro", + "tags": [], + "depends_on": { + "macros": [ + "macro.dbt.should_store_failures", + "macro.dbt.statement", + "macro.dbt.create_table_as", + "macro.dbt.get_test_sql" + ] + }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.080957 + }, + "macro.dbt.get_test_sql": { + "unique_id": "macro.dbt.get_test_sql", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/tests/helpers.sql", + "original_file_path": "macros/materializations/tests/helpers.sql", + "name": "get_test_sql", + "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__get_test_sql"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.0814662 + }, + "macro.dbt.default__get_test_sql": { + "unique_id": "macro.dbt.default__get_test_sql", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/tests/helpers.sql", + "original_file_path": "macros/materializations/tests/helpers.sql", + "name": "default__get_test_sql", + "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.081781 + }, + "macro.dbt.get_where_subquery": { + "unique_id": "macro.dbt.get_where_subquery", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/tests/where_subquery.sql", + "original_file_path": "macros/materializations/tests/where_subquery.sql", + "name": "get_where_subquery", + "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__get_where_subquery"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.0822148 + }, + "macro.dbt.default__get_where_subquery": { + "unique_id": "macro.dbt.default__get_where_subquery", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/tests/where_subquery.sql", + "original_file_path": "macros/materializations/tests/where_subquery.sql", + "name": "default__get_where_subquery", + "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.0825942 + }, + "macro.dbt.get_quoted_csv": { + "unique_id": "macro.dbt.get_quoted_csv", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/models/incremental/column_helpers.sql", + "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", + "name": "get_quoted_csv", + "macro_sql": "{% macro get_quoted_csv(column_names) %}\n\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.0834382 + }, + "macro.dbt.diff_columns": { + "unique_id": "macro.dbt.diff_columns", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/models/incremental/column_helpers.sql", + "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", + "name": "diff_columns", + "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n\n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.0839858 + }, + "macro.dbt.diff_column_data_types": { + "unique_id": "macro.dbt.diff_column_data_types", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/models/incremental/column_helpers.sql", + "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", + "name": "diff_column_data_types", + "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.data_type != tc.data_type %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.0846112 + }, + "macro.dbt.get_merge_sql": { + "unique_id": "macro.dbt.get_merge_sql", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/models/incremental/merge.sql", + "original_file_path": "macros/materializations/models/incremental/merge.sql", + "name": "get_merge_sql", + "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, predicates=none) -%}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, predicates) }}\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__get_merge_sql"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.089531 + }, + "macro.dbt.default__get_merge_sql": { + "unique_id": "macro.dbt.default__get_merge_sql", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/models/incremental/merge.sql", + "original_file_path": "macros/materializations/models/incremental/merge.sql", + "name": "default__get_merge_sql", + "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, predicates) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set update_columns = config.get('merge_update_columns', default = dest_columns | map(attribute=\"quoted\") | list) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set unique_key_match %}\n DBT_INTERNAL_SOURCE.{{ unique_key }} = DBT_INTERNAL_DEST.{{ unique_key }}\n {% endset %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{ predicates | join(' and ') }}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.get_quoted_csv"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.09109 + }, + "macro.dbt.get_delete_insert_merge_sql": { + "unique_id": "macro.dbt.get_delete_insert_merge_sql", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/models/incremental/merge.sql", + "original_file_path": "macros/materializations/models/incremental/merge.sql", + "name": "get_delete_insert_merge_sql", + "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns) }}\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__get_delete_insert_merge_sql"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.091419 + }, + "macro.dbt.default__get_delete_insert_merge_sql": { + "unique_id": "macro.dbt.default__get_delete_insert_merge_sql", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/models/incremental/merge.sql", + "original_file_path": "macros/materializations/models/incremental/merge.sql", + "name": "default__get_delete_insert_merge_sql", + "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not string %}\n delete from {{target }}\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = {{ target }}.{{ key }}\n {{ \"and \" if not loop.last }}\n {% endfor %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n );\n\n {% endif %}\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.get_quoted_csv"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.0921972 + }, + "macro.dbt.get_insert_overwrite_merge_sql": { + "unique_id": "macro.dbt.get_insert_overwrite_merge_sql", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/models/incremental/merge.sql", + "original_file_path": "macros/materializations/models/incremental/merge.sql", + "name": "get_insert_overwrite_merge_sql", + "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.092475 + }, + "macro.dbt.default__get_insert_overwrite_merge_sql": { + "unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/models/incremental/merge.sql", + "original_file_path": "macros/materializations/models/incremental/merge.sql", + "name": "default__get_insert_overwrite_merge_sql", + "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.get_quoted_csv"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.093127 + }, + "macro.dbt.is_incremental": { + "unique_id": "macro.dbt.is_incremental", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/models/incremental/is_incremental.sql", + "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", + "name": "is_incremental", + "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.should_full_refresh"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.0938828 + }, + "macro.dbt.materialization_incremental_default": { + "unique_id": "macro.dbt.materialization_incremental_default", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/models/incremental/incremental.sql", + "original_file_path": "macros/materializations/models/incremental/incremental.sql", + "name": "materialization_incremental_default", + "macro_sql": "{% materialization incremental, default -%}\n\n {% set unique_key = config.get('unique_key') %}\n\n {% set target_relation = this.incorporate(type='table') %}\n {% set existing_relation = load_relation(this) %}\n {% set tmp_relation = make_temp_relation(target_relation) %}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {% set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') %}\n\n {% set tmp_identifier = model['name'] + '__dbt_tmp' %}\n {% set backup_identifier = model['name'] + \"__dbt_backup\" %}\n\n -- the intermediate_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {% set preexisting_intermediate_relation = adapter.get_relation(identifier=tmp_identifier,\n schema=schema,\n database=database) %}\n {% set preexisting_backup_relation = adapter.get_relation(identifier=backup_identifier,\n schema=schema,\n database=database) %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {# -- first check whether we want to full refresh for source view or config reasons #}\n {% set trigger_full_refresh = (full_refresh_mode or existing_relation.is_view) %}\n\n {% if existing_relation is none %}\n {% set build_sql = create_table_as(False, target_relation, sql) %}\n{% elif trigger_full_refresh %}\n {#-- Make sure the backup doesn't exist so we don't encounter issues with the rename below #}\n {% set tmp_identifier = model['name'] + '__dbt_tmp' %}\n {% set backup_identifier = model['name'] + '__dbt_backup' %}\n {% set intermediate_relation = existing_relation.incorporate(path={\"identifier\": tmp_identifier}) %}\n {% set backup_relation = existing_relation.incorporate(path={\"identifier\": backup_identifier}) %}\n\n {% set build_sql = create_table_as(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% do to_drop.append(backup_relation) %}\n {% else %}\n {% do run_query(create_table_as(True, tmp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=tmp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, tmp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n {% set build_sql = get_delete_insert_merge_sql(target_relation, tmp_relation, unique_key, dest_columns) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% endif %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", + "resource_type": "macro", + "tags": [], + "depends_on": { + "macros": [ + "macro.dbt.load_relation", + "macro.dbt.make_temp_relation", + "macro.dbt.should_full_refresh", + "macro.dbt.incremental_validate_on_schema_change", + "macro.dbt.drop_relation_if_exists", + "macro.dbt.run_hooks", + "macro.dbt.create_table_as", + "macro.dbt.run_query", + "macro.dbt.process_schema_changes", + "macro.dbt.get_delete_insert_merge_sql", + "macro.dbt.statement", + "macro.dbt.persist_docs", + "macro.dbt.create_indexes" + ] + }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.0988889 + }, + "macro.dbt.incremental_validate_on_schema_change": { + "unique_id": "macro.dbt.incremental_validate_on_schema_change", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/models/incremental/on_schema_change.sql", + "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", + "name": "incremental_validate_on_schema_change", + "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n\n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n\n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n\n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n\n {% endif %}\n\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.1034749 + }, + "macro.dbt.check_for_schema_changes": { + "unique_id": "macro.dbt.check_for_schema_changes", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/models/incremental/on_schema_change.sql", + "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", + "name": "check_for_schema_changes", + "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.104725 + }, + "macro.dbt.sync_column_schemas": { + "unique_id": "macro.dbt.sync_column_schemas", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/models/incremental/on_schema_change.sql", + "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", + "name": "sync_column_schemas", + "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.1059341 + }, + "macro.dbt.process_schema_changes": { + "unique_id": "macro.dbt.process_schema_changes", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/models/incremental/on_schema_change.sql", + "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", + "name": "process_schema_changes", + "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.106658 + }, + "macro.dbt.materialization_table_default": { + "unique_id": "macro.dbt.materialization_table_default", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/models/table/table.sql", + "original_file_path": "macros/materializations/models/table/table.sql", + "name": "materialization_table_default", + "macro_sql": "{% materialization table, default %}\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier,\n schema=schema,\n database=database,\n type='table') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema,\n database=database,\n type='table') -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = adapter.get_relation(identifier=tmp_identifier,\n schema=schema,\n database=database) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema,\n database=database,\n type=backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = adapter.get_relation(identifier=backup_identifier,\n schema=schema,\n database=database) -%}\n\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if old_relation is not none %}\n {{ adapter.rename_relation(old_relation, backup_relation) }}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", + "resource_type": "macro", + "tags": [], + "depends_on": { + "macros": [ + "macro.dbt.drop_relation_if_exists", + "macro.dbt.run_hooks", + "macro.dbt.statement", + "macro.dbt.get_create_table_as_sql", + "macro.dbt.create_indexes", + "macro.dbt.persist_docs" + ] + }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.110413 + }, + "macro.dbt.get_create_table_as_sql": { + "unique_id": "macro.dbt.get_create_table_as_sql", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/models/table/create_table_as.sql", + "original_file_path": "macros/materializations/models/table/create_table_as.sql", + "name": "get_create_table_as_sql", + "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__get_create_table_as_sql"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.110922 + }, + "macro.dbt.default__get_create_table_as_sql": { + "unique_id": "macro.dbt.default__get_create_table_as_sql", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/models/table/create_table_as.sql", + "original_file_path": "macros/materializations/models/table/create_table_as.sql", + "name": "default__get_create_table_as_sql", + "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.create_table_as"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.111116 + }, + "macro.dbt.create_table_as": { + "unique_id": "macro.dbt.create_table_as", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/models/table/create_table_as.sql", + "original_file_path": "macros/materializations/models/table/create_table_as.sql", + "name": "create_table_as", + "macro_sql": "{% macro create_table_as(temporary, relation, sql) -%}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt_postgres.postgres__create_table_as"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.111321 + }, + "macro.dbt.default__create_table_as": { + "unique_id": "macro.dbt.default__create_table_as", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/models/table/create_table_as.sql", + "original_file_path": "macros/materializations/models/table/create_table_as.sql", + "name": "default__create_table_as", + "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n as (\n {{ sql }}\n );\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.111748 + }, + "macro.dbt.materialization_view_default": { + "unique_id": "macro.dbt.materialization_view_default", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/models/view/view.sql", + "original_file_path": "macros/materializations/models/view/view.sql", + "name": "materialization_view_default", + "macro_sql": "{%- materialization view, default -%}\n\n {%- set identifier = model['alias'] -%}\n {%- set tmp_identifier = model['name'] + '__dbt_tmp' -%}\n {%- set backup_identifier = model['name'] + '__dbt_backup' -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set target_relation = api.Relation.create(identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {%- set intermediate_relation = api.Relation.create(identifier=tmp_identifier,\n schema=schema, database=database, type='view') -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = adapter.get_relation(identifier=tmp_identifier,\n schema=schema,\n database=database) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"old_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the old_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the old_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if old_relation is none else old_relation.type -%}\n {%- set backup_relation = api.Relation.create(identifier=backup_identifier,\n schema=schema, database=database,\n type=backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = adapter.get_relation(identifier=backup_identifier,\n schema=schema,\n database=database) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ create_view_as(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if old_relation is not none %}\n {{ adapter.rename_relation(old_relation, backup_relation) }}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", + "resource_type": "macro", + "tags": [], + "depends_on": { + "macros": [ + "macro.dbt.run_hooks", + "macro.dbt.drop_relation_if_exists", + "macro.dbt.statement", + "macro.dbt.create_view_as", + "macro.dbt.persist_docs" + ] + }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.115326 + }, + "macro.dbt.handle_existing_table": { + "unique_id": "macro.dbt.handle_existing_table", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/models/view/helpers.sql", + "original_file_path": "macros/materializations/models/view/helpers.sql", + "name": "handle_existing_table", + "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__handle_existing_table"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.115701 + }, + "macro.dbt.default__handle_existing_table": { + "unique_id": "macro.dbt.default__handle_existing_table", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/models/view/helpers.sql", + "original_file_path": "macros/materializations/models/view/helpers.sql", + "name": "default__handle_existing_table", + "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.115925 + }, + "macro.dbt.create_or_replace_view": { + "unique_id": "macro.dbt.create_or_replace_view", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/models/view/create_or_replace_view.sql", + "original_file_path": "macros/materializations/models/view/create_or_replace_view.sql", + "name": "create_or_replace_view", + "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { + "macros": [ + "macro.dbt.run_hooks", + "macro.dbt.handle_existing_table", + "macro.dbt.should_full_refresh", + "macro.dbt.statement", + "macro.dbt.get_create_view_as_sql" + ] + }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.117174 + }, + "macro.dbt.get_create_view_as_sql": { + "unique_id": "macro.dbt.get_create_view_as_sql", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/models/view/create_view_as.sql", + "original_file_path": "macros/materializations/models/view/create_view_as.sql", + "name": "get_create_view_as_sql", + "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__get_create_view_as_sql"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.117585 + }, + "macro.dbt.default__get_create_view_as_sql": { + "unique_id": "macro.dbt.default__get_create_view_as_sql", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/models/view/create_view_as.sql", + "original_file_path": "macros/materializations/models/view/create_view_as.sql", + "name": "default__get_create_view_as_sql", + "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.create_view_as"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.11775 + }, + "macro.dbt.create_view_as": { + "unique_id": "macro.dbt.create_view_as", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/models/view/create_view_as.sql", + "original_file_path": "macros/materializations/models/view/create_view_as.sql", + "name": "create_view_as", + "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__create_view_as"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.11793 + }, + "macro.dbt.default__create_view_as": { + "unique_id": "macro.dbt.default__create_view_as", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/models/view/create_view_as.sql", + "original_file_path": "macros/materializations/models/view/create_view_as.sql", + "name": "default__create_view_as", + "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }} as (\n {{ sql }}\n );\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.118187 + }, + "macro.dbt.materialization_seed_default": { + "unique_id": "macro.dbt.materialization_seed_default", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/seeds/seed.sql", + "original_file_path": "macros/materializations/seeds/seed.sql", + "name": "materialization_seed_default", + "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set agate_table = load_agate_table() -%}\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation)) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ create_table_sql }};\n -- dbt seed --\n {{ sql }}\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", + "resource_type": "macro", + "tags": [], + "depends_on": { + "macros": [ + "macro.dbt.should_full_refresh", + "macro.dbt.run_hooks", + "macro.dbt.reset_csv_table", + "macro.dbt.create_csv_table", + "macro.dbt.load_csv_rows", + "macro.dbt.noop_statement", + "macro.dbt.persist_docs", + "macro.dbt.create_indexes" + ] + }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.1210392 + }, + "macro.dbt.create_csv_table": { + "unique_id": "macro.dbt.create_csv_table", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/seeds/helpers.sql", + "original_file_path": "macros/materializations/seeds/helpers.sql", + "name": "create_csv_table", + "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__create_csv_table"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.124993 + }, + "macro.dbt.default__create_csv_table": { + "unique_id": "macro.dbt.default__create_csv_table", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/seeds/helpers.sql", + "original_file_path": "macros/materializations/seeds/helpers.sql", + "name": "default__create_csv_table", + "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.statement"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.1259031 + }, + "macro.dbt.reset_csv_table": { + "unique_id": "macro.dbt.reset_csv_table", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/seeds/helpers.sql", + "original_file_path": "macros/materializations/seeds/helpers.sql", + "name": "reset_csv_table", + "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__reset_csv_table"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.1261399 + }, + "macro.dbt.default__reset_csv_table": { + "unique_id": "macro.dbt.default__reset_csv_table", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/seeds/helpers.sql", + "original_file_path": "macros/materializations/seeds/helpers.sql", + "name": "default__reset_csv_table", + "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.create_csv_table"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.126622 + }, + "macro.dbt.get_binding_char": { + "unique_id": "macro.dbt.get_binding_char", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/seeds/helpers.sql", + "original_file_path": "macros/materializations/seeds/helpers.sql", + "name": "get_binding_char", + "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__get_binding_char"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.126768 + }, + "macro.dbt.default__get_binding_char": { + "unique_id": "macro.dbt.default__get_binding_char", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/seeds/helpers.sql", + "original_file_path": "macros/materializations/seeds/helpers.sql", + "name": "default__get_binding_char", + "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.126884 + }, + "macro.dbt.get_batch_size": { + "unique_id": "macro.dbt.get_batch_size", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/seeds/helpers.sql", + "original_file_path": "macros/materializations/seeds/helpers.sql", + "name": "get_batch_size", + "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__get_batch_size"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.127043 + }, + "macro.dbt.default__get_batch_size": { + "unique_id": "macro.dbt.default__get_batch_size", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/seeds/helpers.sql", + "original_file_path": "macros/materializations/seeds/helpers.sql", + "name": "default__get_batch_size", + "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.127157 + }, + "macro.dbt.get_seed_column_quoted_csv": { + "unique_id": "macro.dbt.get_seed_column_quoted_csv", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/seeds/helpers.sql", + "original_file_path": "macros/materializations/seeds/helpers.sql", + "name": "get_seed_column_quoted_csv", + "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.127632 + }, + "macro.dbt.load_csv_rows": { + "unique_id": "macro.dbt.load_csv_rows", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/seeds/helpers.sql", + "original_file_path": "macros/materializations/seeds/helpers.sql", + "name": "load_csv_rows", + "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__load_csv_rows"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.127879 + }, + "macro.dbt.default__load_csv_rows": { + "unique_id": "macro.dbt.default__load_csv_rows", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/materializations/seeds/helpers.sql", + "original_file_path": "macros/materializations/seeds/helpers.sql", + "name": "default__load_csv_rows", + "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { + "macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"] + }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.1291142 + }, + "macro.dbt.generate_alias_name": { + "unique_id": "macro.dbt.generate_alias_name", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/get_custom_name/get_custom_alias.sql", + "original_file_path": "macros/get_custom_name/get_custom_alias.sql", + "name": "generate_alias_name", + "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__generate_alias_name"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.129571 + }, + "macro.dbt.default__generate_alias_name": { + "unique_id": "macro.dbt.default__generate_alias_name", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/get_custom_name/get_custom_alias.sql", + "original_file_path": "macros/get_custom_name/get_custom_alias.sql", + "name": "default__generate_alias_name", + "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name is none -%}\n\n {{ node.name }}\n\n {%- else -%}\n\n {{ custom_alias_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.129796 + }, + "macro.dbt.generate_schema_name": { + "unique_id": "macro.dbt.generate_schema_name", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/get_custom_name/get_custom_schema.sql", + "original_file_path": "macros/get_custom_name/get_custom_schema.sql", + "name": "generate_schema_name", + "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__generate_schema_name"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.130365 + }, + "macro.dbt.default__generate_schema_name": { + "unique_id": "macro.dbt.default__generate_schema_name", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/get_custom_name/get_custom_schema.sql", + "original_file_path": "macros/get_custom_name/get_custom_schema.sql", + "name": "default__generate_schema_name", + "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.130634 + }, + "macro.dbt.generate_schema_name_for_env": { + "unique_id": "macro.dbt.generate_schema_name_for_env", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/get_custom_name/get_custom_schema.sql", + "original_file_path": "macros/get_custom_name/get_custom_schema.sql", + "name": "generate_schema_name_for_env", + "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.130921 + }, + "macro.dbt.generate_database_name": { + "unique_id": "macro.dbt.generate_database_name", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/get_custom_name/get_custom_database.sql", + "original_file_path": "macros/get_custom_name/get_custom_database.sql", + "name": "generate_database_name", + "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__generate_database_name"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.131371 + }, + "macro.dbt.default__generate_database_name": { + "unique_id": "macro.dbt.default__generate_database_name", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/get_custom_name/get_custom_database.sql", + "original_file_path": "macros/get_custom_name/get_custom_database.sql", + "name": "default__generate_database_name", + "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.1316211 + }, + "macro.dbt.default__test_relationships": { + "unique_id": "macro.dbt.default__test_relationships", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/generic_test_sql/relationships.sql", + "original_file_path": "macros/generic_test_sql/relationships.sql", + "name": "default__test_relationships", + "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.132024 + }, + "macro.dbt.default__test_not_null": { + "unique_id": "macro.dbt.default__test_not_null", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/generic_test_sql/not_null.sql", + "original_file_path": "macros/generic_test_sql/not_null.sql", + "name": "default__test_not_null", + "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else column_name %}\n\nselect {{ column_list }}\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.should_store_failures"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.1323829 + }, + "macro.dbt.default__test_unique": { + "unique_id": "macro.dbt.default__test_unique", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/generic_test_sql/unique.sql", + "original_file_path": "macros/generic_test_sql/unique.sql", + "name": "default__test_unique", + "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.1326878 + }, + "macro.dbt.default__test_accepted_values": { + "unique_id": "macro.dbt.default__test_accepted_values", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/generic_test_sql/accepted_values.sql", + "original_file_path": "macros/generic_test_sql/accepted_values.sql", + "name": "default__test_accepted_values", + "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.133302 + }, + "macro.dbt.statement": { + "unique_id": "macro.dbt.statement", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/etc/statement.sql", + "original_file_path": "macros/etc/statement.sql", + "name": "statement", + "macro_sql": "{% macro statement(name=None, fetch_result=False, auto_begin=True) -%}\n {%- if execute: -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- set res, table = adapter.execute(sql, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.134453 + }, + "macro.dbt.noop_statement": { + "unique_id": "macro.dbt.noop_statement", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/etc/statement.sql", + "original_file_path": "macros/etc/statement.sql", + "name": "noop_statement", + "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.135041 + }, + "macro.dbt.run_query": { + "unique_id": "macro.dbt.run_query", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/etc/statement.sql", + "original_file_path": "macros/etc/statement.sql", + "name": "run_query", + "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.statement"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.135335 + }, + "macro.dbt.convert_datetime": { + "unique_id": "macro.dbt.convert_datetime", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/etc/datetime.sql", + "original_file_path": "macros/etc/datetime.sql", + "name": "convert_datetime", + "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.137089 + }, + "macro.dbt.dates_in_range": { + "unique_id": "macro.dbt.dates_in_range", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/etc/datetime.sql", + "original_file_path": "macros/etc/datetime.sql", + "name": "dates_in_range", + "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partiton start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.convert_datetime"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.1383622 + }, + "macro.dbt.partition_range": { + "unique_id": "macro.dbt.partition_range", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/etc/datetime.sql", + "original_file_path": "macros/etc/datetime.sql", + "name": "partition_range", + "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.dates_in_range"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.13912 + }, + "macro.dbt.py_current_timestring": { + "unique_id": "macro.dbt.py_current_timestring", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/etc/datetime.sql", + "original_file_path": "macros/etc/datetime.sql", + "name": "py_current_timestring", + "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.1393569 + }, + "macro.dbt.create_schema": { + "unique_id": "macro.dbt.create_schema", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/schema.sql", + "original_file_path": "macros/adapters/schema.sql", + "name": "create_schema", + "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt_postgres.postgres__create_schema"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.139787 + }, + "macro.dbt.default__create_schema": { + "unique_id": "macro.dbt.default__create_schema", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/schema.sql", + "original_file_path": "macros/adapters/schema.sql", + "name": "default__create_schema", + "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.statement"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.139968 + }, + "macro.dbt.drop_schema": { + "unique_id": "macro.dbt.drop_schema", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/schema.sql", + "original_file_path": "macros/adapters/schema.sql", + "name": "drop_schema", + "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt_postgres.postgres__drop_schema"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.1401322 + }, + "macro.dbt.default__drop_schema": { + "unique_id": "macro.dbt.default__drop_schema", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/schema.sql", + "original_file_path": "macros/adapters/schema.sql", + "name": "default__drop_schema", + "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.statement"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.1403148 + }, + "macro.dbt.get_create_index_sql": { + "unique_id": "macro.dbt.get_create_index_sql", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/indexes.sql", + "original_file_path": "macros/adapters/indexes.sql", + "name": "get_create_index_sql", + "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt_postgres.postgres__get_create_index_sql"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.140817 + }, + "macro.dbt.default__get_create_index_sql": { + "unique_id": "macro.dbt.default__get_create_index_sql", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/indexes.sql", + "original_file_path": "macros/adapters/indexes.sql", + "name": "default__get_create_index_sql", + "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.140953 + }, + "macro.dbt.create_indexes": { + "unique_id": "macro.dbt.create_indexes", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/indexes.sql", + "original_file_path": "macros/adapters/indexes.sql", + "name": "create_indexes", + "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__create_indexes"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.141109 + }, + "macro.dbt.default__create_indexes": { + "unique_id": "macro.dbt.default__create_indexes", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/indexes.sql", + "original_file_path": "macros/adapters/indexes.sql", + "name": "default__create_indexes", + "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.141502 + }, + "macro.dbt.make_temp_relation": { + "unique_id": "macro.dbt.make_temp_relation", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/relation.sql", + "original_file_path": "macros/adapters/relation.sql", + "name": "make_temp_relation", + "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix))}}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt_postgres.postgres__make_temp_relation"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.1430998 + }, + "macro.dbt.default__make_temp_relation": { + "unique_id": "macro.dbt.default__make_temp_relation", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/relation.sql", + "original_file_path": "macros/adapters/relation.sql", + "name": "default__make_temp_relation", + "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {% set tmp_identifier = base_relation.identifier ~ suffix %}\n {% set tmp_relation = base_relation.incorporate(\n path={\"identifier\": tmp_identifier}) -%}\n\n {% do return(tmp_relation) %}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.143407 + }, + "macro.dbt.drop_relation": { + "unique_id": "macro.dbt.drop_relation", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/relation.sql", + "original_file_path": "macros/adapters/relation.sql", + "name": "drop_relation", + "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__drop_relation"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.143591 + }, + "macro.dbt.default__drop_relation": { + "unique_id": "macro.dbt.default__drop_relation", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/relation.sql", + "original_file_path": "macros/adapters/relation.sql", + "name": "default__drop_relation", + "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n {%- endcall %}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.statement"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.1438022 + }, + "macro.dbt.truncate_relation": { + "unique_id": "macro.dbt.truncate_relation", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/relation.sql", + "original_file_path": "macros/adapters/relation.sql", + "name": "truncate_relation", + "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__truncate_relation"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.143991 + }, + "macro.dbt.default__truncate_relation": { + "unique_id": "macro.dbt.default__truncate_relation", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/relation.sql", + "original_file_path": "macros/adapters/relation.sql", + "name": "default__truncate_relation", + "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.statement"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.144151 + }, + "macro.dbt.rename_relation": { + "unique_id": "macro.dbt.rename_relation", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/relation.sql", + "original_file_path": "macros/adapters/relation.sql", + "name": "rename_relation", + "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__rename_relation"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.144352 + }, + "macro.dbt.default__rename_relation": { + "unique_id": "macro.dbt.default__rename_relation", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/relation.sql", + "original_file_path": "macros/adapters/relation.sql", + "name": "default__rename_relation", + "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.statement"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.14464 + }, + "macro.dbt.get_or_create_relation": { + "unique_id": "macro.dbt.get_or_create_relation", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/relation.sql", + "original_file_path": "macros/adapters/relation.sql", + "name": "get_or_create_relation", + "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__get_or_create_relation"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.144894 + }, + "macro.dbt.default__get_or_create_relation": { + "unique_id": "macro.dbt.default__get_or_create_relation", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/relation.sql", + "original_file_path": "macros/adapters/relation.sql", + "name": "default__get_or_create_relation", + "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.145519 + }, + "macro.dbt.load_relation": { + "unique_id": "macro.dbt.load_relation", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/relation.sql", + "original_file_path": "macros/adapters/relation.sql", + "name": "load_relation", + "macro_sql": "{% macro load_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.145749 + }, + "macro.dbt.drop_relation_if_exists": { + "unique_id": "macro.dbt.drop_relation_if_exists", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/relation.sql", + "original_file_path": "macros/adapters/relation.sql", + "name": "drop_relation_if_exists", + "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.14594 + }, + "macro.dbt.current_timestamp": { + "unique_id": "macro.dbt.current_timestamp", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/freshness.sql", + "original_file_path": "macros/adapters/freshness.sql", + "name": "current_timestamp", + "macro_sql": "{% macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt_postgres.postgres__current_timestamp"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.146453 + }, + "macro.dbt.default__current_timestamp": { + "unique_id": "macro.dbt.default__current_timestamp", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/freshness.sql", + "original_file_path": "macros/adapters/freshness.sql", + "name": "default__current_timestamp", + "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter '+adapter.type()) }}\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.1465979 + }, + "macro.dbt.collect_freshness": { + "unique_id": "macro.dbt.collect_freshness", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/freshness.sql", + "original_file_path": "macros/adapters/freshness.sql", + "name": "collect_freshness", + "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__collect_freshness"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.146828 + }, + "macro.dbt.default__collect_freshness": { + "unique_id": "macro.dbt.default__collect_freshness", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/freshness.sql", + "original_file_path": "macros/adapters/freshness.sql", + "name": "default__collect_freshness", + "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness').table) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.147252 + }, + "macro.dbt.alter_column_comment": { + "unique_id": "macro.dbt.alter_column_comment", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/persist_docs.sql", + "original_file_path": "macros/adapters/persist_docs.sql", + "name": "alter_column_comment", + "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt_postgres.postgres__alter_column_comment"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.147948 + }, + "macro.dbt.default__alter_column_comment": { + "unique_id": "macro.dbt.default__alter_column_comment", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/persist_docs.sql", + "original_file_path": "macros/adapters/persist_docs.sql", + "name": "default__alter_column_comment", + "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.148117 + }, + "macro.dbt.alter_relation_comment": { + "unique_id": "macro.dbt.alter_relation_comment", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/persist_docs.sql", + "original_file_path": "macros/adapters/persist_docs.sql", + "name": "alter_relation_comment", + "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt_postgres.postgres__alter_relation_comment"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.148324 + }, + "macro.dbt.default__alter_relation_comment": { + "unique_id": "macro.dbt.default__alter_relation_comment", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/persist_docs.sql", + "original_file_path": "macros/adapters/persist_docs.sql", + "name": "default__alter_relation_comment", + "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.148489 + }, + "macro.dbt.persist_docs": { + "unique_id": "macro.dbt.persist_docs", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/persist_docs.sql", + "original_file_path": "macros/adapters/persist_docs.sql", + "name": "persist_docs", + "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__persist_docs"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.1487591 + }, + "macro.dbt.default__persist_docs": { + "unique_id": "macro.dbt.default__persist_docs", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/persist_docs.sql", + "original_file_path": "macros/adapters/persist_docs.sql", + "name": "default__persist_docs", + "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% do run_query(alter_column_comment(relation, model.columns)) %}\n {% endif %}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { + "macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.alter_column_comment"] + }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.149259 + }, + "macro.dbt.get_catalog": { + "unique_id": "macro.dbt.get_catalog", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/metadata.sql", + "original_file_path": "macros/adapters/metadata.sql", + "name": "get_catalog", + "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt_postgres.postgres__get_catalog"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.150683 + }, + "macro.dbt.default__get_catalog": { + "unique_id": "macro.dbt.default__get_catalog", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/metadata.sql", + "original_file_path": "macros/adapters/metadata.sql", + "name": "default__get_catalog", + "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.150937 + }, + "macro.dbt.information_schema_name": { + "unique_id": "macro.dbt.information_schema_name", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/metadata.sql", + "original_file_path": "macros/adapters/metadata.sql", + "name": "information_schema_name", + "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt_postgres.postgres__information_schema_name"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.151123 + }, + "macro.dbt.default__information_schema_name": { + "unique_id": "macro.dbt.default__information_schema_name", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/metadata.sql", + "original_file_path": "macros/adapters/metadata.sql", + "name": "default__information_schema_name", + "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.151273 + }, + "macro.dbt.list_schemas": { + "unique_id": "macro.dbt.list_schemas", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/metadata.sql", + "original_file_path": "macros/adapters/metadata.sql", + "name": "list_schemas", + "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt_postgres.postgres__list_schemas"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.1514502 + }, + "macro.dbt.default__list_schemas": { + "unique_id": "macro.dbt.default__list_schemas", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/metadata.sql", + "original_file_path": "macros/adapters/metadata.sql", + "name": "default__list_schemas", + "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.151692 + }, + "macro.dbt.check_schema_exists": { + "unique_id": "macro.dbt.check_schema_exists", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/metadata.sql", + "original_file_path": "macros/adapters/metadata.sql", + "name": "check_schema_exists", + "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt_postgres.postgres__check_schema_exists"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.1518972 + }, + "macro.dbt.default__check_schema_exists": { + "unique_id": "macro.dbt.default__check_schema_exists", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/metadata.sql", + "original_file_path": "macros/adapters/metadata.sql", + "name": "default__check_schema_exists", + "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.run_query"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.152268 + }, + "macro.dbt.list_relations_without_caching": { + "unique_id": "macro.dbt.list_relations_without_caching", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/metadata.sql", + "original_file_path": "macros/adapters/metadata.sql", + "name": "list_relations_without_caching", + "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt_postgres.postgres__list_relations_without_caching"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.152452 + }, + "macro.dbt.default__list_relations_without_caching": { + "unique_id": "macro.dbt.default__list_relations_without_caching", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/metadata.sql", + "original_file_path": "macros/adapters/metadata.sql", + "name": "default__list_relations_without_caching", + "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.1526132 + }, + "macro.dbt.get_columns_in_relation": { + "unique_id": "macro.dbt.get_columns_in_relation", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/columns.sql", + "original_file_path": "macros/adapters/columns.sql", + "name": "get_columns_in_relation", + "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt_postgres.postgres__get_columns_in_relation"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.154285 + }, + "macro.dbt.default__get_columns_in_relation": { + "unique_id": "macro.dbt.default__get_columns_in_relation", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/columns.sql", + "original_file_path": "macros/adapters/columns.sql", + "name": "default__get_columns_in_relation", + "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.154449 + }, + "macro.dbt.sql_convert_columns_in_relation": { + "unique_id": "macro.dbt.sql_convert_columns_in_relation", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/columns.sql", + "original_file_path": "macros/adapters/columns.sql", + "name": "sql_convert_columns_in_relation", + "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.154761 + }, + "macro.dbt.get_columns_in_query": { + "unique_id": "macro.dbt.get_columns_in_query", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/columns.sql", + "original_file_path": "macros/adapters/columns.sql", + "name": "get_columns_in_query", + "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__get_columns_in_query"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.154944 + }, + "macro.dbt.default__get_columns_in_query": { + "unique_id": "macro.dbt.default__get_columns_in_query", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/columns.sql", + "original_file_path": "macros/adapters/columns.sql", + "name": "default__get_columns_in_query", + "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n {% endcall %}\n\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.statement"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.155283 + }, + "macro.dbt.alter_column_type": { + "unique_id": "macro.dbt.alter_column_type", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/columns.sql", + "original_file_path": "macros/adapters/columns.sql", + "name": "alter_column_type", + "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__alter_column_type"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.155523 + }, + "macro.dbt.default__alter_column_type": { + "unique_id": "macro.dbt.default__alter_column_type", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/columns.sql", + "original_file_path": "macros/adapters/columns.sql", + "name": "default__alter_column_type", + "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.statement"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.1561291 + }, + "macro.dbt.alter_relation_add_remove_columns": { + "unique_id": "macro.dbt.alter_relation_add_remove_columns", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/columns.sql", + "original_file_path": "macros/adapters/columns.sql", + "name": "alter_relation_add_remove_columns", + "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__alter_relation_add_remove_columns"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.1563962 + }, + "macro.dbt.default__alter_relation_add_remove_columns": { + "unique_id": "macro.dbt.default__alter_relation_add_remove_columns", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "macros/adapters/columns.sql", + "original_file_path": "macros/adapters/columns.sql", + "name": "default__alter_relation_add_remove_columns", + "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation }}\n\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.run_query"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.157181 + }, + "macro.dbt.test_unique": { + "unique_id": "macro.dbt.test_unique", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "tests/generic/builtin.sql", + "original_file_path": "tests/generic/builtin.sql", + "name": "test_unique", + "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__test_unique"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.157755 + }, + "macro.dbt.test_not_null": { + "unique_id": "macro.dbt.test_not_null", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "tests/generic/builtin.sql", + "original_file_path": "tests/generic/builtin.sql", + "name": "test_not_null", + "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__test_not_null"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.157992 + }, + "macro.dbt.test_accepted_values": { + "unique_id": "macro.dbt.test_accepted_values", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "tests/generic/builtin.sql", + "original_file_path": "tests/generic/builtin.sql", + "name": "test_accepted_values", + "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__test_accepted_values"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.1582808 + }, + "macro.dbt.test_relationships": { + "unique_id": "macro.dbt.test_relationships", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "tests/generic/builtin.sql", + "original_file_path": "tests/generic/builtin.sql", + "name": "test_relationships", + "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": ["macro.dbt.default__test_relationships"] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657300370.158561 + }, + "macro.wrkplay_dbt.test_not_empty_table_test": { + "unique_id": "macro.wrkplay_dbt.test_not_empty_table_test", + "package_name": "wrkplay_dbt", + "root_path": "/Users/bruno.campos/Documents/Documents - MACQ199NQ496F/saltplay/wrkplay_dbt", + "path": "macros/column_not_empty_test.sql", + "original_file_path": "macros/column_not_empty_test.sql", + "name": "test_not_empty_table_test", + "macro_sql": "{% test not_empty_table_test(model, column_name) %}\n\nwith validation as (\n\n select\n {{ column_name }} as not_empty_table\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n not_empty_table \n\n from validation\n -- if this is true, then table is empty!\n where count(not_empty_table) = 0\n\n)\n\nselect *\nfrom validation_errors\n\n{% endtest %}", + "resource_type": "macro", + "tags": [], + "depends_on": { "macros": [] }, + "description": "", + "meta": {}, + "docs": { "show": true }, + "patch_path": null, + "arguments": [], + "created_at": 1657550602.932756 + } + }, + "docs": { + "dbt.__overview__": { + "unique_id": "dbt.__overview__", + "package_name": "dbt", + "root_path": "/opt/homebrew/Cellar/dbt-postgres/1.1.1/libexec/lib/python3.9/site-packages/dbt/include/global_project", + "path": "overview.md", + "original_file_path": "docs/overview.md", + "name": "__overview__", + "block_contents": "### Welcome!\n\nWelcome to the auto-generated documentation for your dbt project!\n\n### Navigation\n\nYou can use the `Project` and `Database` navigation tabs on the left side of the window to explore the models\nin your project.\n\n#### Project Tab\nThe `Project` tab mirrors the directory structure of your dbt project. In this tab, you can see all of the\nmodels defined in your dbt project, as well as models imported from dbt packages.\n\n#### Database Tab\nThe `Database` tab also exposes your models, but in a format that looks more like a database explorer. This view\nshows relations (tables and views) grouped into database schemas. Note that ephemeral models are _not_ shown\nin this interface, as they do not exist in the database.\n\n### Graph Exploration\nYou can click the blue icon on the bottom-right corner of the page to view the lineage graph of your models.\n\nOn model pages, you'll see the immediate parents and children of the model you're exploring. By clicking the `Expand`\nbutton at the top-right of this lineage pane, you'll be able to see all of the models that are used to build,\nor are built from, the model you're exploring.\n\nOnce expanded, you'll be able to use the `--select` and `--exclude` model selection syntax to filter the\nmodels in the graph. For more information on model selection, check out the [dbt docs](https://docs.getdbt.com/docs/model-selection-syntax).\n\nNote that you can also right-click on models to interactively filter and explore the graph.\n\n---\n\n### More information\n\n- [What is dbt](https://docs.getdbt.com/docs/introduction)?\n- Read the [dbt viewpoint](https://docs.getdbt.com/docs/viewpoint)\n- [Installation](https://docs.getdbt.com/docs/installation)\n- Join the [dbt Community](https://www.getdbt.com/community/) for questions and discussion" + } + }, + "exposures": {}, + "metrics": {}, + "selectors": {}, + "disabled": {}, + "parent_map": { + "model.wrkplay_dbt.number_played_against": [], + "model.wrkplay_dbt.wins_losses": [], + "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15": ["model.wrkplay_dbt.wins_losses"], + "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1": ["model.wrkplay_dbt.wins_losses"], + "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813": ["model.wrkplay_dbt.wins_losses"], + "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77": ["model.wrkplay_dbt.wins_losses"], + "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe": ["model.wrkplay_dbt.wins_losses"], + "test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427": ["model.wrkplay_dbt.number_played_against"], + "test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073": ["model.wrkplay_dbt.number_played_against"], + "test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c": [ + "model.wrkplay_dbt.number_played_against" + ], + "test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20": [ + "model.wrkplay_dbt.number_played_against" + ] + }, + "child_map": { + "model.wrkplay_dbt.number_played_against": [ + "test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c", + "test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427", + "test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073", + "test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20" + ], + "model.wrkplay_dbt.wins_losses": [ + "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1", + "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15", + "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813", + "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe", + "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77" + ], + "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15": [], + "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1": [], + "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813": [], + "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77": [], + "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe": [], + "test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427": [], + "test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073": [], + "test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c": [], + "test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20": [] + } +} diff --git a/wrkplay_dbt/target/partial_parse.msgpack b/wrkplay_dbt/target/partial_parse.msgpack new file mode 100644 index 0000000000000000000000000000000000000000..da4d0cf3ec02520f6d2805cc36450a83422af410 GIT binary patch literal 216010 zcmeFa3y@srbsi{CvK?Y=*-4daosFGb4h3}&IOqWg@F|UAkOU>#Bq#x(6%`COd%Ew; zwAj-1_)y?%18Jy=UN(teVqjjY$*d-B-*$L>D0_xfgS zZu!t$a`a>}CnMF{t+~C|FC=&&P3Zx@_dof4Z?ik7-gDo{Q}-Re`xG@_zIkq*8)9*} zjm+)6_r!w_?7hCa_xkJKd*7*dC5=u;nqcLao1R~9mxMn%wYj4*>3U<(T$457`9gv> zcNLe*ud-U!*<39w_4?~&ZnT-JchZ%?T+*TGe&oUXjwf>u(D-x7dh+0L8XL1NCF`|z zEAdTEGQ{SRjM}W%1Po}glw_viL&xvKtE2bdpW8;?ZKGd53aIij@zCs`U%$&fRBP|o zHK2pl_uH#$SbpEHO)p<&+rskaF`fs0<4{eZ0)rD6LQ^gzjhl<_Znp2x&#%1r8SGck zpT2Pjd(}c7XhX8;#P49m1y?#Dv?tSmOj-5E>(D?1|Fo?MKohKfA=-tU( z@3XH8DE(YN&3c>tW?CPd-$e0>Kpxs^l;IqwMXLG&FtI0n2?8+u6q@S)} zm20njdb8VpbTh3#lAeF%^Sy3eW~?{Y8r{|OlkL@Rub+NKag$e`+301118cqBBTqcN z(NE1^c7adR+f|Hgmj20&&E-zJ`D-hWc0aC%d1}4UA7n2?S<^FSN$u9e-0aznM)Q%z zYFh6$)`R6f)9>{L^^L}0ZFv9ULm9xcxZL0D_G-<>I+nV4Pp`STo^}W7ujD}Tz|p(k zbLfscj=$%~9k<@Qm^C^BVql933{TRKFY_iAqnoIKu|D4eRkgc~PJN}_No5spWo*b6 z$8>#?HWCMq;70u2)4-SJBiZKqPw@bs%+?w=-*T&aI{e|ox82^n{cy9 z|A0N&6Q2?!&z|@UBu}&7-Ward-Ql}Vt+gRY2#;ejMZT>QEmp*=HO{6v(ef$5+U zIO*{b-j)9yOnmn#2(SC@A;Fb4nvh5&@A`|I_~=Qe-F+l&C4(MIIKl(7!geY-VbCHcgafI| z6uD0k)SZiq0c8jus-0i&JlE{4Z-9PU-0781FK@Ox=I^Il=}Ow~r>$>&VYAx@drk3o zUD)Y|G`o4_)6ISgZVB~g@HCI;j9Pp5% zMoFXFN~9sHK7wrg=PD>Ssggd_TUlv0(|N5Mv4%qZ>Ovu+pg0M6@}UQ+ok5LM39}4Q zdj`D$xQNV0G7-v(Y2|2xr6P~)9=VpZq;|{p6Rf4*MsDU+r2QlytxRRb3cn8=xGM!S zOYV8_ID{holfBSVo20PO0(d06avS1?M}O>{)w_?Lq;8O@r0CEFvnE7K@(%oB-9vt! zqW1^U@Yww)k0lV{$By44AaF2Yoq)z=jm_vj_NUQ$_~&|UPByN3;F;aNed;!fPJtGO z-vvcZc5byuQHabluNI&q{;|qu+Z*lD|D0@bq(0$a08YY@hDVVcbkfZ33o4aU2N`$) zUeK`IA_NgX%0Wm0h{uty-H@f_cFj|oT~0VWFzXnI$>G&}(jg_fO!1utIT^9GgPm`m z6gy=mB0md$K$o><0}T1OZS>@MjGB%wSc;!oVK*zteW~kbvAS~n^Z*eA^}pj7D(`22 zqB77G$I(9FC{T5P{~S0#eC@=s2vc54DsP9lNc#h$k0h|})*z;m6diu{@VXs7 z#_LSw0W_4xQ-*gtSl@xnAglxOiRef~bVL~G_GL$LP|LJSS@FDc-`@S;(ff~`y!#j% zBxJEThQ5%T8`J_8FQ3FU0IOU`bbqUeb5Hw2Iyp8F_OLoA_pm>thyBH~U?p>69T{9; z*=QbFgGs~-8%JVxL2Tdq(Eax(4?cA2*olO-DB6#_JU3t;Aq4MS&Ypswkmd`vj#V5z zeh-O$yD!tqZOp!Q>oyJC?`!_T3H^nip>J%=VDBXyZO6YhuE7_?zo*t);t>3L;PuG0 zXLpz0wD|t?6X)A2^Y|UP{npkkcch1Iz2!Fi|E-F)!y!6WG% zN1C@Cx#NyoZfP7oczf$e>-NTxmF1OYx_tAY#=+aid;H#a)cCOmYmGqy@5_K9OcaM< zZyW7ti|!KZ0{j{8@_UV4fS(kqmQ|P^ftM}sg{1Ze#1WKp0lt&`M8a{V@$vM~b`8N1n)9D&3j{7j_A)9^@dH`(Xb)F8`&;KPG-Z@A!h;AJmMtG!40U^bDyri$)e*5z6 zx7~Jg>(DLVe#2j}0psD~g$oIdRPUPJ)&2V^)LdUpyNF0N>-_SObB+Eg?8b{1pX1*Y zv?9;?hncNCZTo&w+WpjLOq7ZuAD-SNdNy3ZjEGRz&ynq1&o-A4v+AF(A`VflsFhdd zX}V`ez`B51#mJHh{mhzS3xSHW6QY+QiS&(QOFv(afj z&90B?{`pS<{M~wc<;feCl7mmfP2TIfUuEIC7bO_N-%>5PBz*Tx`w8R7<0bTV@b0yd z-^01ldn=LVF9p)v$1oV<$AC*@`5|qGJ{1eqeZq>@4~}G7 zuWT^@^T9&Q|msjV=oQ9u$dHL8VUM`Dq@&REpa0nMTe zMUUrCcTC2gtmpUKU`o~NQY|=kmw_}ic-Gn-q^3Tnz!6``)#e( zZMSK@b;R0(!5CXG3ZDxGh*^fp(eSG9u#XMjBDSG6n%Oi8mil#XKo-r^YgQy1z9m-V z@GSu(16$H#o??63M%~wl`&B2|=T?~DWDpc)I9c1*H&gua@6$|Cag6b7@vf=aqWBMM zx88d5k;Ccj>2mrSF~-2_d5txW$(EX zN5di~Z2kIXlE3<9%_IZvF`iA{Q(%)$vzIuJgb>_mGZj(5xq?O`z3s@&fd={NM-*-y z5mAWl;R?kTCO+eG)rJ{{)k%>{@xhs3=xf9Y7be~BmU!XB&@|j|;`USU!}#f?9TKJZ z`a#VZeJC^!P{P4*PuV#WR%Bi46?=X;@5$i zIF3Xea&3n}x2G>rB{fzgJ3mZ+_Zl)wVFz3uSfTW&sdOXKE)n%lmL zp`QpKUS+;J!(h-gvmfcBk`P%I7rJ$8h^qMX6~O)1h*{scHCSwkV{Z}ehHY=L_io|c z|MrI2@owu6`JgEn^zAo1Gg&kmrGyj}OccO=ZSeZbQVD4>!0r;HEp5xmwa=57s|Vve z!-I2$vpw|-`#57g30hP+(-Z~Cq&^a*jn60hF7CwvYLqlPi^@t!ltxjT1a;4z zm!+MwIp9C(C!ENtGjh+VshvZ5tn_>9)Q;yui@kg27xwP;gV#AV8%Jcy=CH#hYCPYa zmxB6j?G>E1LFFAPzSG}K7wGH_irbi^4tm^Z4mNQp=X}ylSFx?L=?&bM^T>U}x1;>V z-ub&JWgl-NUsz z7Lj+89xxTGGU~S2?lwD{t(543x5VY9o;So|HdI0;kycC~FW9jHs3;owbN>`yl&2tM z;Aw-V)pi$$c2IK+1YydAEhLiSjzb;?h-^R)`wk>Hh0sZ;ltD_BwW<}f-pWFZnK0bej_xI@Fq2Cw%*=c0Jn&l2iivDB2zjQ=dO5jZo zrK9NcM!I9~{r2+a07TW}Aq;qcMO@XAMzr1OjDFHX+kR{${c+KY!9{DLy$kGm%UA%F z$~1!tOHgldN{rthoag0EKA-(OJfHnhi_WLt+WE|$VM0TU8ae<+sq)|So0ue>e-wHn zHY9&#%tfh%{M+0>6|pLT+>q)#b}J8w)=hU%`aF#Y1ppo$6ea6z)bJHaDpPe<5z}}{ z9NLad?LlI+2>)2XlrS7=B%nhZ^(u)cA}4fx!!Uhb5FiiUeSl|dK(j(I#eSoI-mYmm z?SK=b_9T_uYhW;p0dAOOkR4_bRCR{F98kkltt8$`z^GO>AS)`H6`tYr#+ejSrwgJs zr)9C|)0=0ykm;*b(~l|*){|Jjf!d#C$n zTBzHI{qPVA$?3CaP+k-NT{(k8c&Li$UTmB}Axq@VLISz9JjmOH%Cwn6>%yl$-9E$2 zBsqQZOp23>*eJ$ooZ-3Wt-VN_mNUy09dj}=3a)r`^T2-CA-wx7Mzr>r( z7TumowAE-k)>mJ2N@xHZrLgWjP*hlhwn^3NrB=NpONoV^)Z<-9z}6uppu&M@6M0Db z18{C7c!l4h{H)J>|_F+}Nkl)bA z=A|e#m_Q_HVE~pBcpWIVcEP+ly+bGL{9u`*OTDmu4UfF&)kzOepLoirC zJ+=+eMW_7;?1PQfAFuBd)4*VcBBXJ9v-nKq)KMr7O1fJU!Oo8)C|skZCu7J zz)29%utmn9GMLmnD*8cevGM#zv6KYg4RI4Umw!%QDV)l`lRkbv|3;o6$13dV7gQ^! zc;CnYoWGtO9aPVs%L)m6nI->Df2Z)H+csveG>CoFJP+k~#f@U2k^kgwJ@nD2B8K@M z0ydDE9nTKHDBkM_{S+bCPZjAY05k|BnqLk}{PgDIx{p_Q<3EB$@{Ev>_N+0Am{IPL z@9DQDOLMd3U-&NJWWF6k1#^W@7)Z=ugMR#&KV&(cY4Vkw`Jo*qs;_Hypp9!kxPpLr zsF*_mZhrVeKZ}X0{odvVGBg#${sIdMCbo&+3c-!RVQqk!jQBRI%Rr%;z!-2J zr=raPF@1NQG4Kz5eYh~n7^q9Jaw$hwZ{+NOsk-hUlR(U?Y|;2PaV<&ohJ;u%HVD4r z41zp-lufYbBSo7a-@NMF6@=;{|KQ1fv}3)|WJQwecGLP8mS6zW6&*F07uAY=3~d_q z=Nsh9UV)14oY}TJMy#);4YG{G0sIRLK^0uQnF6nl?**rg{w2mYwKpDMK@;-uprzZC z^XRxIAWt@oJ7{JX?^@Xhwh_#h6>=T1=Y!%_7DO~Dyad)PAP3Z=9eFtaHbjHiqqHSr z3oek@Mm*@lZ}{Eep^=0|=Aj`jcJESfFtoO(@4t&k?3j%`c~yx_H_ZY;ACZo+hI=#^<56I9W%43HNu?iBjI{`ZFaN7A>U zZP8Lf!k(hzE~4m{JVghv(WHEPgp`BEIm{<%LTGC#+Xpc%z5|&o4d0bWu_dY%*5rSNb#v%*JVss*e>b8rBLZw2e4Qi6OH9``q=}sXC zwIoFj^i&bU_6dP9B%07;y#U+s1o8cE9v&GfDOgwGs8$9I!^K`g;@HvFKGNh6@Lq2` z)?P;vd?)R$4%T!V#PzwxEiON7wke<;dkK2!q~akn4tk}(LFVK$sSwW;WCR_vA+-$(Thw{9(voGq~sa9lZp38o#I=hH{07Guqot_@hq1ynDILBc7OQB&y7*V ziqep!UC6set70WX>?WqARI!rXdTurRa)eox^m2x;wWrY)a^7+YQ9LZO0o|4v_Cbdd zqrSL=o#8ir>lc-1k7Q@nnGA(v<)Sh3zr$60)#8UHOwCsv*v5Wgeop9-5m7l%XH7Jbpsi-Sp<+v;&E9jR_2jR;dCOlktb*E zb~UdDM!xX1;lYvE&X9=sr2=Mb^JH3bePIxU4rvdB$9}`D0=$3w;^$7;v3L=ZdZM^+2D8pB&ak)8{7c zO7G$_nl_l#ps~IYQs4)*Fw|y$3ksW?iWvo=w|(7a`i$y=*K($z$5(H~y0dsug=wsW7*LGScogS614O z8P_N~NBPk702~iTXg51)M#^eRr0@S=(P|?am{z)o>_W%Z00+4GE7Yetx9?s19@uws z-^yHm4w=~mc+g9JKP~~E>ew0g*4Xr>!D58%&pXj4i2vJY4Azz| zxKLWWkvyIA+nBpE3Ab$h=%e~07fj3-^ro!O3Hw+_oar^eQZFK0Mus3h4n7t$N&xOP zDe3Xy#=WCcym0WpvB88u$NWPsJu<~B?6`{DY?#=gj7NOV z00W_^-Z`9(_ETiU_hcHMU1@%!{15Np;ziQ21lI6M;D>#_EiGzh8Px3y!^0yrrACLc zBOFsUTM6lKD%=I6S2kxl??S$bTWhUd@9C|G}D%wYlf3?_Xjis+*c3&i^G zA~aWr1!6n(IDYxM{iR4ALN`EhsyJa1{sT0pM0xU2ndBefxeZB{WD>bi=aa|5Za1o~ zO3l(7d5>WkJdUHrTrow$H&hqJtc)56k9X@K@j`WfXnpoIM?2K2v;s`TX^D&u0=a=s zt3l43uBehXl`~3n-41b6`Wy2KIzk}R_PSS#0YQkxmg zDA>AzqDfH3mwmnQjmPd9<4kb=732x7BF8R&#AviLq1bx|@eISKGi(8BKpO=Te^N@8 zEQZT2Iomf)cRur{oDbmy1Xaah-uMF%4pZ!b!;_ajM&1>@ z#KLC3+yH}!HmhJn*;#lnZ`7LO$+rh2dVk3D@+yUcc38!d$ZHwBfyD) zIsOBn={|g9NqrFhL^!Hsz)e*;$&2DyIfe*6pfw2SlgBoR$qd5;)QwfaMJZH)tp$FO z^KiJ*S}eAF`tJ`xiC>`v88o&Y{sjHxMxIZU z<^e^AFuvG|Q^>i}oYdbmn9hDu`S`#MFrwYnLFb>(gU6Hm(3dI5H>v_> zn$lKR2ikl#1dT$RRfjlXlP#l;l<(g8nDgKNABvGQR>*rTibjApC2g(_ zta(<0Md6HRHoC!^_4*aP3tq z`g7Pk6ifiKQCfw4Ihc!rT2{A~T%uUZrDUbkSj}qpK6L;6^%KYLJ#p;hyWG;02MBZd zRFlX+ydN||mn~^qGt0E>5>*YyzDFY#!J6>cQt13_gdz(ir{bJVu92 z<2W6*$zgT)GK$w>6G>Aj!|YsJi`yqpJ$T|+{obSZ-Tx5Kds6HU2ir0D{lf2kUE#M) zaF54iMz-8Bm@NtT5wE0;bYv5TVYW07%lqf;RCNbPkNCr1^>|-^_aw0wn65SyiE`OU zwQH_HB`6F@5@*%-{j-5QkUi3{{1aP9z6EXy1 zaWINWO6(9aDQH0RsL-L5yFn1L3kMWPH#N1%soYGwUq0j~uKz-N6&zIoFaQGS%_iRH zBaJr3n8>YD^4`Q0sHpk$aaium+oE8|=&hA3)ko>vN^l{BjYp0QWm06sTqQ$A8sXQq z5o;Im+>Y~ZX6od({<1pBfy7CK!B=s6nPKArryA98$FL_kt2|oR$}ZbDqX3Tbe6Qce z!EuBVSCFD#r$ljcUV4f_m@R#w06xWx-uSW?vUw<1DILk>aucq*HF2WSQo{eS1{G|g zN(~9EUG><7)y#c_oZ*Bj#gqmm-D}wfGHny_>uO95-D-c~-j^s@$c=MV%Yt;Ar8hLfkfr_rb@qg>Y!*Zi~L91uoJr$D9lC z>ypT)JEu)U0YDgu!7h0&S=#91T1NAUy}m_h&-@Ts&vY=9DO%F3-AB`XB~)xTOd&!3 zNOsv`TKlD$=L9m&wcbEEHPqy6QPwq21y+k&Lh;)p&3;cSket~$o~!@wtVwF%2#QlBal__X-CeO7aOnx!Ut`wm z=}RTB^elUL0az%wT++6RFW?f;MjJul2lJMYjIeE!#~-1o6;<7E?ipD-KmCSvmHj<- z)(}OfSnf4kT~CMh!UAPXh96a7?YAA)j>CiieUoIpbxW1Z9Li(?S`wco>~zP`iQ_kW zsE?U7k!*~cDoL-UhLYWQmZVXmpUgw2uXt@9tAXSq?jPK6`S{~W**I9GqvDT$m_%1g;x5s`v`B79n`bf zZ42{D(-u3J6^s4O4-MZk%AsWU8Zy_3x?ID=_4KPn25BLxQ1YP>{M0trxLK%%fS22q z?~11shMyI({keVG6Y0p0PUCaYA!ka2*rq(5Bl=uJxApXEBjDrl?ed%chC{d!9je`4 z3s(=@7K4;-*hK=OMGyJG5&8vlrlBsS-Hhq)?P;Xg;>zUuBk6e;ygH4`lG?cNm>w3+ zG>L1jRd3L71XxeV3P5{4KtT@+?b}`U7s58ILqBNYx>Y(_Ko`A8XG!@jX$3ZJE@=|u z7t6kJaliA%u?1?xF;aKs%9>=oy}CAFonx(WHbv4inSFkRq_D7Sjx-ba^W10_n%D_v`A}`+J2IvN^uU)|*l5BGw$JPAZv~;)pfee?6cgO_KZ_|x* zuHEV2{^tb6&oi9Aw==Hc^c=hwNZ8=Qp*3*@lNNR|O_R03U?aP8ad8!Xj?Lv77Q9IN z=`@xz{sRRV(#1BGlxB-JAHL-v&$fS&ZnPCej@`EX-nqJgAuw=5-&`*D*Vt_v9LCpS z=d?JP8R~DRjVa8gCi$(3#%YvC<95-@5LdXY07XNr3Ky!;)zcfE8Wt4Fz$4)BPbUia ziV}04VvxqGhjAZa&Z8ij_#eJN#GC>any6pAaMe(@gEnek>U9Yr`h_y1{hGI*g%E1}6jkI<76w!bE)v}YuQjh9iwpDl{0ux+$7+Q=wz z*xzgKj>~Rei`rT-y;nh8&KT@8}%g;<6)^3l;+m3DI*&zo&0*e$i!3{F+BPjcaqbB3g@bv@6iAbe@Ir z7Y38L2CP}$2<6_~N^>6b9-!iEbju8C3B%059W$&?^L(IB*cwJ9<<2ewbeb)Tg>cyt z`{9P-h{S5#;%-cEdb-silj6L+s!McRH-$|UF{>99o`R^YR16&)zHelZZ~h5|$>_MF zo5mbuH$ynHCajoYAG?a|OFW`2BL>?LpLD$;Pvvi%PjeO8mh=LPb8Av9{gf3`UVXn9 zM-+I>t+_aGmqw!f#`5LKXKo=x@5@XEy@Ji0u%e8(kpbF+VpV9bEM56cR84 zY|Re%rgvM$n82)bs)cVwZ2;kAkgyz&4y8=Y1_;|n{<%5lNCHq$_iHUgeaMMy`i5Q$G?C$ za4_^f<-q4a@)et;;zc2&Q+^5JO%56kQb=Nh0#>nkC~9STJh%>BSFF=5N1m2xaB;oB zE5|A2_4tA9n&4LBB7nHdj!P0$i%m*S_dBqNcda-i=2iDWT?<>ROob?3Y&VH}bYY7Q#(>0~eery58h9OBEWX*LQzw$fy_yTTh5d)e#Y$W47_I04tCk~kbJx<&2DI+7?B3}{kn^%3$h;af{E#!H!zQkJ zAp|RnZP?2!g}|4rBgbZ0;}+R|O7St%(tAIxk*5aP=FxqPbI#!vPCqN0`?e7zM{ro(foCnYk}SCf+8Btbz-@?&cT>J_ZD^wS^xe_!(E zFBS83N5BGPFKcvlWB79cz!Y9z#OIc89ki$-IR(czR$XoDQEWEo>A7rii0v|2St&;v z9Tf(X&x*(X!tV~p&J|$Y_~utP{=FFgUJ4OUIz)^&EyGAkU4hs40Gyj}M{k39%`9m1 zH-EH5F%2-Lq|MchCeLa;ULnV6ha9>A?DTToPdD^D$%MPNTyNr%D*WK^R8KW44)nyA z#?2I9)40Z0H(I?A{ZtCSe$?Stw53Hf@EYgrubevZ&@q&r*q%(A8PoaL&ubCntZOTS zIbarG%=qS4H_p5mhoM56uR5fOH-*HKP>HRuO}<5!HfmLQ8?%ZUuGZlM(~%%K*wYH<^Sq_hw5WGO@s67+~z>E z`#h3cfOD-?pEC=>kb(_FKE!Uh-~597*LEd8I|b>fBE0HsL+Rf6Nv>=f($Hqj$E`3n z^`;6B{-IxoEk2)%#nXytO!_A!=V<^*vqe6$ajl1oma+wOlU?0xt#s*bY#M+6mbWpY zqf0T@`*#ng?C8^r!;Tb;Xs>YC!U5jRfr(K%UVjt)3NZ}%C>EyS$hw~?%;CSIJji`R zi!zcq6JV3X4zHT8qG9L5rV0-%$R~%OiQG8yDvSL>ac9VzV+*eq9XN7gYK~(9Q5yJN z7-{q*8|5%=TSHFQjv^z5KzQf_QV z&t$hWCDyX38btzogqui;-|Q$tVuW>R!yKU0#78rHzi4eRBHS^L&PDx+fNv$D3H{9%<@ zxV+g$9bfyM>qXDOn6_89RrRG9_`E5luDXad)aDaiVjx@)Y^506j&+YZ256k^IshsW zn>x0DSs~=7-aVXj%Fy_qwAa;*q~CB>eC#87Y`wha{YAq+)+LX(c^>V>mevFTDluaAPKCbN$_G8@$+q_T)7*=Q*kjPjZX>l-e7550`9!5O6Lp{dd88gV$y=r25i z(VJA>a)1$&tj7+QOL3``?9+P1ZB1{Y7WUVfTq@Q^>W!>Q7p?#TYB%t*qXa^8z|xL; zu?=stT9tyhU`|ICm>w7#ZK;QQj3n99cJQ({;VK-< zjVxV~?YYBz%oCWy*kgUtz?|z-uS-t&d94ElmT`V~slu=|`!`U7%}R;vxwt{CotY0| zT^;!Dxg!*&@=E<&zlT&TKA@Z%1y$kfjLiJKnarP_R)C1Ly>hgQLM3wfXzWfsb^qCP z{oLhOykU_X#>-z9ZVCxvAGqvX_k-j+S-8to{ zz)!)l0=~FYww5w%9lac2O*`jpV3#n_kP%!^=9cW=)>p(|LJ37)Z1GU8kp28z<(#@5`*0%>2| zZ}3{}J09j1fYZtj9KbFG2`-zRV69q4%w$kn>O;rxd(T71>OXqyeUq-VgQ`v;I{>#f z^lCnCo}?B~Gb{M|5&SS*D~=xKDIN27axFlS*+E$asV0TUm~VF#Vgw0@M>l&Ul?vY# zN8>f;H>U`xb{WO%#20R{z%^tx0z8WjYEQmf{>P2z96Sc)g8-<0;6@VT#^m^W_DL(& z0>}voccYC~q@d-n?0_uDalVj?%68ByK-RF0cy36-+mO(L{4P0TL&i|nAsztGbixUQUT^i9S%jQPzqUk-4sq2^=?=vGWMIQ7Py|1H zEG-OeK9nrVZ!FN==*YvkJJ3ahW49J3Z~zzAh|7sqfK%2Sd=(0|z`|>HQRYEo3jsr) zvIu3<_7}{m4IAsUE|*t%p<+2*R=G1dokO!TD5gex6hP(7DlC7ht9t*gw#(yIgtE(> z7Of*PRy(y??U>j|xk*2%7q0Xqp>jYJX;^Io-yTjN6i`wL=o;yZ6Bv{&J6JO#XT;BZ z_dvrS_i5`WZ3&`GR~nn0LFkB3p2$(1c8n83)*Ep`&=#{r`rk6=!-QSg=>U8Pd6UGLw3IF!O&=0ia z|18XGm$YR6fKH$H6A;(6&;jcYw(JU8Rm}X4RG)zla(oQf<|*d z9wi&|CbXcdTL|EMZ-Sb@gbB%tt zj>*E2&C^_4xm2dm*glrl03eoZf0i#$|`NOV`yoqOrK|m zPPW+Y!hJxF#ztpRViNT+I{x-XWI^!R5Tu&0{(>W{u#E|ra6XGv6JtC@Yr;?YJRm3^ zzQG$4yrIaA*&4-J!%O`L-CX3x`aG;SaiN-AfofRAIz(gXu|--TMN0UVYa1;=_>@j= zREe~e_;RLn&@1$tZ^5dV840}idz7h)3wT#-Y&;-PL?{3*vM`kSI28DeDkUSdmvKH3-I1O~5lWyes?nOD zI!h#?H{%qvgPEUZLFh2aU_`$t3UuHAmuDqmgya$_UQgpDelc=)7m+cgpU7m1$xh)4 z_mqQz=m=K%qfu#2Nyn4DDnSbYDzLU( zBWpVMDtYakSC{t5KRwUjzErdyDgwFhb`IG;{GB@7rqGbjn@XNezyZcLzs3wkF@qQ5 zFjj0~&&xm`afij*Zl6IAW{#o^EP%D3dzg=6j&QoD>!Llya6%d_9S6UXtZ#O+B$y9W8 zm>T~g?vn9-i;#44r2P7!7goa*g z_Yu82LkM!Z$r#_aV`^Or_`XE^>s%(t zmS6tP-*RXkcstye-V(lBR40xv{tQnGqP{{fs7F+-0u&6g|)VTZCrW=%2L znz!Mr_BGL9UR_-hA(k`wNc_n;Mr#LQjXHiTzzCawMh(Ewc=VjIxH&5(i@?F>f@R)l zK}8NH_AfA<=ONZS1`s{>@lw{xS@jM8&LFqbZc{F%2w#yl47Hx`C8EL}#kV*FK$jLN z;cUb?X%}?EE|h82E7#7nWiX)ZxFu)rTL7mB?Zjk@t+G)08MRViQ6+>0`*Yk3)o?dM~Q?5pd<`&AlanD0MuRt zI3W~jngs0y<6IBau|RW=B+l!@RdBE$$*G8to!Kbt-!2FY2oHxY>|D?a*ViJ%aI*kv zL`-66%h@g>DsJfblI4XC=WN+==}<%uPds{Hrx43H#90AtVgvfJ50nJM3vKIibMw$x zy!1%p1n-A8EL=rxTJnwEhN%{rWt_sx;jZSlI4y&_m&Y`88K_(Eq+Kd??#@cF`MpPU zWQIhPR42hf0^Dp}rm#=g=bDP+Rh+MlfUVbahQ9+G^=T(1-(q52$BJ-Za9ouynP7Uw zeg?|C9GDGjwvPbXtSDgkPli*@94h)#cD_avo+gHG33T}qWc1W=`Hf$3rpSw(5=${e#6KT-g zUa2i!=Y>WLPUIHmUj%F532Dv?$sB3{b z!Kz9jb3uPr3S>hYDgw|%!%3G=SYQjH0pwF zq|HJ5Y>J#e6zf7ZA5{L02Fd}zVT-H92-SsVs22|LHz}RT_*nU+OT6<(+fAp4kD9#l zHenSOly&5gdSoA0DGtEN1XR2V*;(|{o@wPDTqeeOw8KT%QMB*cQ64pwe?;=OX^nH6 zmXM;w16N9#bAo5hgsA+wd!X6+6G!H{*xp1lX07#I@cM;!+qighI>cwQe z{zi{3iK>RD!kMd>`8Y?BDo9x>MfXmx;m^f0n=nkk^wFg)(Y#oZ(&&F~OxNAy|0}Aj z)91t>)d&F*#fH!Uz6*ykC8p3(!Bp@#-rM=qi;Wz`Y zSb-RoK>ay<+Ow2Gr2H%tLcA%d)az9E3XrJ?(>9=5ZZsd+9MgAB`byI|>W+!Iidjmc zBkivv)rNM(T9O&jaa9Drxhw)pn??s`>Raa_KPdAR5{42_ZE=9NaV?7 z3@xSCgZ}vhLCj4=j|ndmf*D5xX>HBTejiEvNe^kT%+G4cDQbiZ)v41O0{4h0%3w17 zUB}*e-*K|fv6L)@1jT%q1BKffkgr_3&A=Xdro-+4j&27fg3*8JB|>%o)1EuD(rqjM z75rT?f);z)?mzo^T@eUJZOl+K6b$Z6vHt@8ZVv=A+>${44G<)VkCZ1+J1b92u*SQ5ww<0!IGRs96)hSW?iv#%)=G$edv!JK*R}pd zOkV#M&W~~2H?eq0#Y<@t#e`u?7Mh9b37+M&WXp8rj)|#CUc!dw=`ci!yTrgzB0KOC zk%s?3GUaE6(=tY8Dw{xs`WNP{O1ob`wUwtD;o@_3WjIo6#a1t8(e>4*t}0}@YM zPCLDG))sIILCAq75k16EEF>lnKSp%P`i=BbLzHpO!sn=Ig=3>JSX;U<=UL|*@|go( zilB!Fr|3R8g2G;>pTvyeCzg2(pS55ak08-)BUja+i7;(5TsNhPeCHZOVgpnT4>krn z&=8=_zshaXvuka~VQBOuM#2ZStNCI%MCY*C!V2YBoP(+iU=64u-1XfmLlaG3qTgmVzDj-1aKt%^Q%#b7e;O9J9~l{~*sZ(f9%-n?BBLCR#7 zpSkKjb5uzId7ys(7knLIF}!6AU6+TQgr0nSU&elmyuu$njB*AKlucoC7E|>iMh;X$ z1&K(gQ#YBx;cRjC3=>dM^@KJdVOr$T*2kOQEx zU(eNu#MhOVM8Eh}Y-1#Zk1XM|+!wi{2SEkxe|j!FLGY>@{Xpr^>0c<#noZtyymABMos5 zJYia(8hpz&CTHc4J9YEazz%%!Q}^C6PPxB2g;OpsS<5_g+Z|KfbNeR3dF7zn^LyZ# zydCf%S4&`o3n{;!a;K4T!4k&-Zn?8h^qOE;iZTf#uIpsiv9nUPu8bRa7E9@a0&rAmch71sCj8&?m+L?umnbU#A{I;1IxfPlb zjnS4HG2Dec{AuBl_xJO`XZaKq!k|*_YJKWx|Jaqp9x+JKDfb8f!#NDL`Oz&p%6dbL@*{?=@(@J3{38r^(a|u|`FiG#1>VQ!q|98F zL}AvFdshCP)c%duon(`Qkh9TeYJQU8WDZ2p0Z~=5L%K!)sRua4V9O66;O7BiaMc4G zhZ9#o#5G4U?vw|KbRb;swum4c6~VqEX%7H7*62jMMk|roGQgH(^v6mn^=QK)&Jt#& z?SJuq(uNmlZUQzV-LpWfk8XNRppO&iUu4xd1hAInp9d-l9z_~PG}RozLf$Zy8qu9G z>vI@v1b3r_Tb_FMqNhfm4lYN!L5+{lXm~9i1VmnU;VhPjvM<6JtbwE{`W07!dPZq? zb+DGaBRQxm+ffJdw@^_%=On9Be^f|AYPuD!MHgUU4t)@txf+cvUPm8@=lDo;TLrsD zWTn{@F%YvN_A;AqGXlUd9%caSR!5^2*jC90%eV6%irsIoA|1(_)*Y}MDm3@|afYX%QI1@pDDGfDSJ6@B zEh%5)u39i3isdPfO9ie>2m2e}Avc2qnHiI`zasvs34yt$NDh-T&&q2BJdB^vu0%sf zBoiRyBwIo6bLO>K;*^>I?ss@246;$pNjrapieEpZF4~i=@3T{ z-RmA(WGpiQ7wK5|;=C?_PE7Cz{Ln&37^!sHny??<#QiwYZ7e@iH|0oMg)6fX{=fAJ zt!TtOn1KQ?zWFsJV4M>0VjRv&4|tPL!i~3$r~*b>Tix9mv-W{i1DI=+32x(uGwgyG zr&D_`Aku7{TI``RhX##(0IDc(7EwRI47cr=l^eZqX zO15S1qu;A#ptKP#=dSD{e#ifF3KATFy(WVWV)n*M2g-fhk{9u zxWO$@hQ_exIn`{L5+;z(*KBu?6AXW9mg4wbql3Ja^O-lt?1CiakkTw3&hPPI7(krD zf@GJpjV66!)({Wc3(KLmoWGV_ztoQ0rr6MV=z&Sr9&AbmTW;aVSdtPth zhvyK+>0`}wgVO7=TEBsOK|;Al$jHFl1H1Rvl5p7?C~M)__1#Ae7>~YI&A#^q0F4L*NzdLrT4U($>&%QV>Tbx!K;C7P^hY zEH2+VnhG6uE#zjE_m-v=pZ+auT;D{7&f24H#rW1QYzr4_%q2T4%@(<^&BIOK(^lZk z!cofqS9r&klY$Gmu(@2V@`>G>@Pt4JifEe5cz}eMGX0WdZQBHm3^D@%$v`nMArnRf zJ809U>N~XARmu6lYs)ak=2DlDr=pnIAc#X@`eP>85{y_t9qVpc+;7PIWSSa%Hj$agOhREiR20OtT{w+ZxMtil&CL0W7cfa8+|Y@MX*8V9Iht6|MkqJzw zQ%iz+Ao#B%3ImPUt=SiO0<@= ztqvd*aRR#!nzf?Q@Lr>sd2$cS<>$6Y9G%iYamKhZKVnp{3KOy2k}v7faKHE87*CB9 z3W}^}Rv7&k-#5*yA!<*t+-o>)yhTDVk~M9UeoH^H!uBT|wvWS%5eVwg-rU2N!>jV1 zEYPi>Ad;I>JX|V2w=gS2{=tuw&k>+)d9!OsT13*%<#0ry}J%7#N zaarr}2yK$rpeWco1}3dV2h&aUf(@pBNp7mTnLv=l*o98Nxs&M1{qk93sQSig8tf0Y zR;?C9hsCMBruWuYDF@b#fRZf6hmm`3Y<~D_q~feBUNT%z=XN{V&#aDv{Onu*_3*8Z ztP$r4>>93YU_&+`iA~sP$B>!uu5xWX@QB7V^r;45jRglJ%b}@A>U;io!h~Gogcjrj zV5Ez%heKjZ-W>8iT4Vssa!A z^gjyNZV}c7jkw5_6^04Q1of5?oj;Eo&4ckSm*>-O;qa>RJ&igr+RuG3;#a+&;lu=~raj_2($% z6x@oa+K2<76sVG6bBvU#fdyll3O3YtPP=>OctR@Z<-edIe5wqI_TBtYW?k5J7pYft zZ5Y-}hvB8v4zh@BCKbxtArTA-V<-XCTXC6RCMH3A0%19q;$%Y=lmx-gWoPeAkvL2@ z7xg$lk9I)uBD;O(wxI^dJPY5WS;tq(!*}5?#ZKAGY!gYHB@1vdS+Bw4WrR?dJ4e;XiBnpo(YMJ1V;Q1MH^XPTQi@U64h-^9SwyHImU== zb6IXo!|mxv4kM5=ym?xx{ALy(L@H6Q2=$-g=^ITMgtPn@|ucJ^V#g%qKNYeNbh}i3m ztQysErU*e|Tg=FagV}%=tMWP4MqhuTXypuJm5gv@fzOhS=hW&jRH|b?r zt z`J7juntaXxe<$yD4U@k)`dccL{)3{+Ir{l0#BC}DFn14R2j8>o4BNTn0|7bU=NwFk zW`n9hlktfIL9lYj;L0~;-QRe7L-NrQs;bQeZjF7xd}RhXZH#bc4&X=LqmKa^bqMu< z`sqfe(M;I|9O5`ETzhUJ-h9X4_B(i`W4LsD4`obyn?o`We=$C#$N0-{f({{IPU3Ct z1s>!%rgKov%dK%ol8)2iF*NxHKP%h7SMq407z0W`B*f8_`=FL-*-+WE%BUU z5%kZ)MW1=ddC|&^WHx=ZGnDp*Q&cE*%lUS`X0}yWVF17f#tshldvQd`mru^9cru?u zr~Se~bPk>ns<=GB-pOx6auoI)7qTYL2K!zc>_h7&e146cY^GGpcM4_W@pgefcwd60Q9k}|Aep( z9v}U=#(qlygt)>Ph;bGktsELrC@=&TLFXD**uO5D+FnkoQHePvHHT%RO~4Q(oONSy zf?iKoxO2;5A!;*>)2j7}JHDSGsD&OgC$z{=`D6-!vr@(W+us^LSE+c4FKx$&r(35G zPX@GQVrh#*i8zXb$%~`mUw6_d-ju4{axT3g6BF?Aw!38_)k=H-Z%5=t+IEuQyjND7 zz8PP`tT6T?A0AFVX^6U$_q&F}?5`toU>tsV%*R#8{Fp=LF?~w0I?M+&l$mS2UH$%2 zsmEqkc>2-XN~Z|0vb5DT91L;rvqn`n2%%8!fm6^ItjSENNSUrN;7933yi^i7zqsuf$MT zkrqt@S#%Vj-nof&Pdq#-u`Z))SPZ;F93PQbr#tN!M3?nOd@QuuY?1!AOlh64D+~BS zGMxs7$L7o5b%xP7jJ!}=pG&vZR66bAp7<)j*V5-ACik>X7w%f_(W7nJUc5Nyvotx z1$KAgqq4h;X)1K}1mDucr+5i)$&a1VtfDYyfD#s_;z`0U0Wp6Bx$U!Z_laXiPaUfe z*o!QH^MES%9Y1;O#HsK)&3^A(R&Q|r5#0xzRMosSdYRZVoPJ|8t$c1K2U7j$aknx?$*rb58i;?IOarEm;)kM& zp}_lc#Kkmb%dh#JMBV@>COs(MvvV|#XI)!$L56a4$^?dAp4hSIHl>c6wllm ze{`?&4L=GF!)vhwJeuW?@J{9@0S7hbn2o#&IPkWelenkbMpE;(m)pXuaPPnTZ*(pA z*y#c+oT$guiH~0?{a_w3FTb(sFtfCInQSM~C&q&*6-?RledwnUoaV%j)Sj%Ik*mU0 zMd1v1OC?^t0!;$=(M_al*V%58wq+wpLt6)OfiK(k%Cksw68A;}6QYr`a}*tAv5u%F z^5LPx!%i0?om2L&jzJW!DzpV&$0k#E_##yQ#v_P?gdN7;O%n~fL8Mb!0Bxlv!15n*hc@1yOo_LOJi*;4x*0KHE>Sl$lf8n|4 zVfWl@0p3p1;p)U-fBroOKaa|n_dM-zx$N6cjnqbtVqkCoTXzr1r@ZIE3SMI1V5~N! zKS&1;y*FZ+3&Rhl$t%2e?Mi%lp8)xOyyGP|`v5jvlN@?BfvJfJ8^MyE-ZJ^LcQ2iX5iE46*+5 zjl2t45lK5k!L8<+WTNOV;01=!PgsYMk*9QgT#6b_`Q^gvRf&xW8H9`BU z6VH6&MhHEHa6jS@F62QDjfx!T&_Vp$F)ZlD_YU9UU6Qm<<(#Us8>B@c!w_R8>T-1= z%~#7|=<(+A9)HPnd3$RJDAyCNVrNUm`r!(Gs_FfSY(t3IBcB^X1UDNSXCe6s^-7$h zN(SHr0U4ksw<1+7i!CgYoM|y9ns>=5f0%f_$OaQvY%9(9KJ1Lp5^FV!emr?UDwb4< zZL49N+z)!~80x#}uaw2j0(vWJbahhLb3t6*6V>p;ju{6nEExs%^av+b(Ald2S0wtR z&ha?`63jm#@j{_(mD9a|FrD%2Qau$ z`4ELdVgu9^tTZ#}N#iAnB7q>z&P7RzX(jaNE|{- zdBBy*T0a67!pNa~SU?ZX0P>CGFPbYKkU}`h$XUDzKuUegE7}OwPSGg+Z@Tf+SZ*E= z2|fvZ`QVe_Q(C=&uCslVPD57ljc^l$L69Z;2Qt%^5sh6%KowO?ain}n%9aGPO^57PPn-61fMQUPQK@UI=YFoq0L4YNs$zRrPMyU z$cHhCs?s2%h%Q5H;f4lWb(rwQh4_}%l{$b6m+m~xP9KyD0A;!@xxqeO>N}WB?;qg? zot0?1drjpit)^XE&IuPb-zLWa>Od@wZn|SclH5z2EfRS)H<35H&RfyHd4pwX+0*pr z+?+2)0Ow`W@bf?+>!2+FxN27DLB2!Z?ca+hCsOxWo_1Qm}JNci5+LprK}d6Wb*tC1mAlu2No}8#rLgly8w|=!N!mG73e} z)APL!*!+(_sMV4flc>Ycsi)ms3_u-{9M$P+rj@Uc0*oe=+a0Nl>T%^L#gGvzGq8{= zs4w2Ca6zI7PD{;bs6P>%DAGJe0uzzc&ee<>*JuCk9uK?U(o5siRXwXk;$gyD?csa*6YZSX%y$RJN z_s%cu-Mi61cwi8lmnSeY4tkOK5SapH%Z2mQu_ce~%$!u&_iNoM#0H$cs&}!{kp5yJcg8l` ze8-TUWLZT>&#ttL>L%(aYF8X$p4Nt!i*hJ{R)orgw9wDQr|H~Wr;P(}uq^g-4F^+U zRO*SWG}@g_oc2KIlAWiT>d562Pct)2$D^2XN|Dar{;pf@x zwh<2v(0NST9fQkq9xH;&vZpdko}in!SYv=vSp4rxuvlg<#bL!>i~JnoK)MUpl{=7{ zz0K~Rx__S7dKYQ{E}d#+d#6KH92zCIwRg4O+uTT&&lg3}UaBUH>$%))???{q41Rp^ z&!WCpW*LoUGu;^A(6A&-1b94guN{NYK17>SjB?v7L+xq$Gmd-DYYdtm*)L!Boh8_w zTUi9{7fdpX$<9;>6|5=Y`Y-eGL~UVZLJ=e3| ze3@)99W)nRQcwvEm$qekea3aywD~4So9=a${H{yKIptyn^R7W|P>D6Ee11w-c=ur%F6Xi%BOPia6ly6jK%(B4}7-`VBs9pdUfp8%V)6Y43xlENpYhWr}&rx}A zzdax!gF~f*HcIAGY7?Ov#l4fc3m4}qwn~|)g<+&&yHz=3Yn3rMTu9DgsFbp}Ty~m4 zT~Jl9F47pWdDv-u@1id(VRk8*U_Y-c={CaI|rN8s9RWevujVU0{(pI~VMn4;ZK@sYn7aXC6Z8Wu_ zL`v3JwX{ox-V7NB72WK!G~>T4QW8!OzQ^g5-hw(xsC2e8iqY~E8lo@wie68QfIRs$ z&Kds2kXlGAkj#Ij=-mhXJ{?AGV}AbrK~4EtV9|WQscDMfT&^( zb{{=G<2LU}Y54n&lH6O71stx&%Un&HIoHfrQ=BvG-HJw3ECBj=?!UCsfX3xAz6l#g z6+=YEugPKL(-tCctI>()YlhQvRAtSReXpU(rrqvYj1?{zqtZ&jr^fp~qsgg&jWtPjMY#by98Y`y}h zzMicrrRfyXx)C)$i{fA{a-!RSjAyy>5>BTd7kmLp%I-|zLSZmD3yz1AkO&1(*%?hovB zgAm1R7(Z)NB5R{Mp929~F@|m|L*5ZK$8Y|5rL)k!vU(fdmqvFr#QxG&yAAh08v;RL z{u}?)VSd=A3a*68ZS+vEAGqdznK(Lt3Vd9e+xNbG>-$>Z$vD;!Jn;-za8r)~Bn_t^ z{U&I@dWF5%J9tBWV74V>SU(O~IHu+tt(?%fun}2x+0tSo=((xjoMr-!4YV5PL2fXP zFhbS#NTAa>IL?FE&S&!5Mp$-vv)#tCKbHf8V%pdJ3O=WN%Uq*s zALf>SMmXSw_EJR{HBQ8XE)`1p4orSTQN?k5rOaBk(P!~A; z@Q|I>(Ujs%9B&piNj^JHyA|34g)Pl8J@~K}PcK|J22Rg^pQ$D9><#YZdvJ^2 zPWh$sj5**JUQbd|bHND=EBlt1w~!{hZQfF?V=q;T;_!+NIb6@{<3E^G2q#PHjboQr2iD;F(C|NG_E%dx_HaGHSogEXq5Zj zweNv_C-<$)i4@$144YYk$sgUJs&AN5jgsLXpix<)oq|3h(z8W#EC`nZHP_PhMu}ZL zqBWb=&jo-`$kTPm6SQ#GS2^EjtQug@#i!cZM6+$Pp5cBLp|#fXpuT~N8&+Y%*6bhk zdNBR0xY55q7R^rz<_ZvLeDmFjQogQ602_r{Uv;?Ul0AZ^MI?g@J?C1i1U*!xAbD;s zrDn&wyQqXLD2szN3WJlT?k}~r6&HkA@qEw(w!yltsHgDH-u{9kf*Mz=jWDx#lii7T zpHV2a{xzoU?nI(5 zIgX^jqOj@99-HhPo2p?Ets;y|wO4G5o+_p#H!DrTu)r9zW}}tDmV13LuK)Xw6lU?^ zq<#t=6Mo)S`WO{}DZ|28+ns`iUt?NUS{d&KS_$^^e6Qa|%15Jvw5d)C8-K7isyXXr zIBAZ0BRRk*Jp8*34`U4-9+KHdP;IrFh<%uB6K6NZPL>yEEwa8~)a@&Cheqi*pvZMPTXs^qNmSbjKNCb>8it1$5>-MMkA~~;77?-?7I?X$EX8`&2z8- zdYk0El=^|CkKty?1@je(hWGDvU;!kp-&2x&dQ|x=yyDl+WsoCKj~~ zzWT8-ik(WFafv~*BBnS01TM9<7xJw)9)Tc8*Ef)4BsZJ~WHhqnP9Y#!q|zwuR!UUL zk?mQhe7*=4Pd&pY9q|;Kq1T3+vrglOn+^o z%?QZqGnY`>sI3pc&@SvEc8qd-;FnY=g`FODi2>G^HQK#s{#*bI zkJ!Vr9fQy0oZKM6*IZcO@7b*rn38@0GM|@i8R{wG7;s_Ci%Cokiy+^4S7EW^m&v z)(vHqMftRr{*{cteDuhh#f?W{$eO))&rxlFnWGx+UYz_w0VoO`Kj6@@(5i@uBV3k+ z-dBX_Ng)RQ(oW|n%seZ`ciUTaN$>Lc0u-C9%kD+Cua?6}VcjPj)|EFeqF<2_7QVd- z<=A)r5^u|5!R9zj^SWSfcl-}3V-ty2I7Jy}ZspB(FSg-+<^UiH#s0oSv0R%f*XXgh zKoyJ}JSWlYa-(@RH)7cB2WR5fF9&;{728|-zLMLNgV{o+H^K6DFB0l2mID}hY`nY& zmy?);W5@Awm^2Aq8e_N7r|1pM1zXp;=jB$g2CnhybywP}r~uTeD%@5^G_LgW=B@J? z6}f9}fr_^_I($-s&y>U26resSkQZQXKTPn`GYZ);12wm|2>Bp7VjM@R;$ z6jr?X?j-`$8;!xolR!{!G}e^P2{y>@1IH$32O+-QLZWdS)!T4(kPMee_;Y+6o=s0M z%l6szyz_Y09J$9AHY=`u?EfmMHyQ(Vh_#b1cK4#Mt|S_Rn8)MGd;VpSmB+vBL>SEh zDmpvHZcJg7mb)nKPBYlYZd^J>5RlALk#d$i5wTBF5|m*68@6l*RSs3}(L4<$8uXZJ zir|}Bb#NBKZlaq~!2${R&<-}*wG-xNP1vXP!rJBgeXvtCF$}=&#ys>JQG1dqVF|N` zCE^ii?AV0PSUAlG+EG$itxh(A&$(5{#>`R}-o2I`-Q-b12Hd#Ss zL2HPsk&GVg`R`6ZuJ?Ywa&b&NQ_33uLbItJ>i#uRox?JL0PjXM+|Ahb1r(PK!J?4t(+Sm?u4J6&uY<5^JV~!*1U}Jo>OzY)!M0Cg=X2=&`BTlmUuP z-0NyUR)6p+1~-MZzwJ~YCtYGa#-i_p`gd&Xt*hX#y<7ArU(q2r*_|cHC?g%;{AxhY z7vqppc=@cu%Xm|Tka>73Pef_@YkbfcTP=*fecpQ51>a)F4dP3i6?gr>TcTmO_@p6! zop;OjF~fMjs{w_5KrRjgh0Fic;c|}0=5cE>q@Ie^=BIc)GusdT^A|k|YQ-+V(~>q< z15Q4xfua!bTMhwr1BGpTp92g(j%$21;OGlcFnMIXyysI6Tcb@!qiu*tHYUM^cr|v* zRo9${R2R1^igbhd6)lw^(6_!2uj}$sP-lirB z&}~fH-HUg=ww3~oLcssv5HJSA@t7z~mb2Lq&&wq#ONh^LW@@Diw5t`#opL_H$T368 zCbom>RAL$j?3AWPb@s>TT0~GvR_iy~I5D5Q!vPa+*T|e%i1FzlAE!u>oa7zgt1{2reXHPu4a+hfCgzLaQ`q@q8 zb)efXj1Cl*_bO?#dvWer4GM)`1BYI^K@pWkFh1S!ig3I6k=#yCKPwjZg&&Xk2lPw< zTN~GS_o9_|A!y)u{JOknk3%rWzjV_grkPuYaD$w&?PB9J+yF)fw^1H-a)L9V`Ch&4YKtG6 zKxd2D@3X@E7fwiKDxaIj(W>SnhJVKLy+=3Qy;%Rn2w*(U4?pQpKGJT4Q8bBl9vRW| z+#&^7%YOzs=fRO&II^x;q2!l8H+-v`+pCR{83U#~X{X(breAj)Hv%h|pc`rS;31mgQt@YE5PNSJd=B%G>r{|U`mXYJ6vB@T*5sMss ziEe<5OrSJie|vnw9$qD2xVQXva)7gquec!4b#R=BnH5QW^IJpja;vdCwl4RqZm(Hr zHkxbs8+#`2wtLCyo1@|732XS2qpQ(fss`iiH<-ZNFnT~Q67nN&S3kKle4FFNG2g@J zbAeO8VzD#WW?7qtNb?~&`FcHss$0d?%5QVXB)Nxm%2-w3Q=_4DK5l%M)ljR82a*< zeJlL@A02*<=~G4NgO0DZBL<-P7O3c9FP_G5h;$_V-Z?6{&wZ?a53i6KW2Hi4gYN#Q zQYDbPSqN75qf?lnLnBE>jB`ty?%U(=?QX?KxiZPC zIt&xo8*p)|)1Kt+GLE(V;z_fmlIRUbC_GYY z9~mD2m3ttvJ99|0W<|r}&_Xt< zjR9_jUfvv}OBKrgfin-6m?O}$Z5mWD5_gt!R^;}7R@JG{Ad!<2jsglB)o`~G)fWmN z@q{$=7s(b{IYrkUpd^%#DqMm!d{fvYyuL8DXY|%s8#Bqa5iokFzOb%Yq2!zJ8-Jk4_zUf)#oQa2dmgGKcXNf%q(PPDj0T)k&n+f&5mLhG zkd*n38%g>oCn9Anx$Dj7+S@qKsXa*#<`0!mZOf_r!?olds^mXdOQmc-eE4o`bMxp8 z^E}LvT5>|NE~&9v14iTWUcM{Z-)JjgQ|yE8FA<`Il5eP!7kpDPC$fd1G{;Ft=o}G( z1u%m98U>!taJp>^SoTle)Wrf2V#sbZ= z#Ni(}jySfLVvO`11jFdczAo+rT|i+w{awuC$>sZqZyb~NY6bbJXOJG@J-0p{H5NWI z68}GcU8+)ort0fBqjfLasg|)8IGMTQaJGZ%uD)TS#%~Rb!<@lmYXEGC$aozZs(uIT_0$ee1N+y?^WEz~z&8}RCy!>gIUo<)sgVn4s z^@e-pB)Z&=NMhA$X4zVMBRoJgvgK~X(&riS0YDUve%az^&>)JTgB}7sRKIpg#0*BB z4lUJ`+mpx9`>ufV=kGM3Pq=WNy&LzOr@mW|VbE=*J z!hS|g_DsKriRhl^;r)vbWvF1exD0i+_y1RSZaeP3s@BZx+R4<>`(ew%Dh zKKlMAKH=y2$379|$%m#j%8zV*>dgC1J7ps`)zeNSTfP%-bAc?_UR;+vWMx7tGR}rh zX^FKz`<1#w+o6F2*lSUCO9I4&(e9&3kvcEcVIOG}x5nYvt4_Vj(&Sc&^;T5N705LY zc9{THMzwn2jYqe(mTSz+$;terzIds%Stri4%USHkwrx`E=^k1x|F=zR_DmO)!e`mu{Fr)Xf7g!M+WMpU8OHmg$ysgeoHsw-ywOdYV{-G!wr9*u{5;)5 z;_;{_P?YT9z*JaKXbv-((}0N&ZtWkHgil%D%<;keq?y)IOudD1#O|rx&yL;CLz8yR z$x}*iJ;fZ$O|aDDaKE7{nZ4W>AJhEg_N0a;ic@+5%EId}x-dh=||;j`;xWc z&<+mTt!_1&k~H`IBhIheoO58*v92e#KpOeC9ZuE%`H7sjr6W7IMUd`wxcJ_9Fu*ud{nHKRdQ>447b#O$KR`gi-HIJ~qecWS2I_d$dD1 zQ3u`2D>h;I^+c9A5`Z>53XDCeNQJT|2Bh%%&8@Y{dgyF4oq(@ht2wF3hfmb;-sFS! zB^rF}(6Kn!FP>&$)DY#b~XXy z!<6VW;=QFtz5nJ?W0rmIoVWOS)Cnp)MqiMh0xCALu}V#x|0hhfN!?j z&q!E=B>hh2(2KmyXM_xezy8T1d#9(z^<&ei{Ix@j58n{Yb7=pb+G*Ntv$5@FV>dvB zCC>B4mRVRTwOF>@U}LupmFAZv!65ySa$~?Xn#Cs&=u44<8H|EA34I+$+akx zUh&|*GgO}aeHL3T{{&^=xus8UFK4-R>y`@x;Lwbi-moTfjG<)9Q`X257IwVitgiX{ z6%KJ;!`tgSFHw~Y(_?+-l?M2TS9e~JI~7IGU%bZ=R)M*-4AxVg-50=Eaa#n`FWdY1 zFJ7ySIstJ?dmq2pj7HFrcW1N+yWctY?03K!8g`O?&&Fn_`-kRV-~VrK{`PQ zZLhJJh~K|h$@^uC-}Twy7p;`=V!fw=IO#uKJYED|;b)QZb>J646q~3F@+!-{ILzYI zS5c4zm6s<;P-LZ7#3rxOq)0NIs-VoXvfsOS9$a1G+weLnOj)r-ydN*vV`>lUZWoN> zoO`3`teo589pG}GceeygTf<-+NbWmN4Fcm^f4+a`ZEx#e$O7Z$|Cijyds?xv2gOAI zN==pPSd}@at^G3fk~GXbooiDDsq#{-V(rKL7U)E0iRXo0RTi1f^E9n|rTh000KMv- z=M@lIrp)#b*y(mXo7t#GZeeN_E*^4cT|%i>;m5(LB_t_Q2FYy@q1O%vCON$Y|(WCExj5{q{Z zgQ^XUu_u0gCiklQ*aiX0D-r+|nly}bQ6yCoCIXwH2)!(<{6fp`p2@R9WmS+U6@;en ztIGEjUn}nc0rl^1`_09pmw~Elp=|~2nW~+v-wR2wX}XQBWIiXU0ZvNW&?9Y+?nXj) zvfGEo+NO=|$Yrd=(8#q2=nmU{uH0!S!eeMjNA~F|wg`W7vZaQevN^S_da@W@;bSqf z-QN|j(6tzvp@AaX18*x8T(L_3lpMN95sOAzxq$j-hw5pOUx;7q!Lm$V95^Ei4y$8Z z7*Y&c#>;F@RwxMyHdgnxOFle#VR*CFn}ooKt-H{r3#DO z6nPkAMV6O9i{HI=Lbes$vhH<19|*))QtKhI}aI z!)kxmsU4^d<|H%I28-lBE}tL;_4Gs?)uP4DkDT$Uf_jI2DD^Aw#>-R{7Rs#3 zk5}Tsa}ETFU=uo>?ZG9?iBsnc!59+YJmnjlt183$G9sl<=-9Ar?QU!og^Y3wJJ zj*2YsNPmo?Od`Va1)d8FTD zcwH*lGY8TjWSm?iWdJWE5ogAYqYoWcRc^Al@J&^QCR9aQrBzf(Q&-RT@+db^#xEZB zFcT*pd@)p&AM#KU2jNKi_=a;iwmNg8u+%PyduF&g#0i`fd)cf*p1~lzl@X5YWO4uG z%m@Q^uH1e}_j`BZZZW7rA*Ss%0V9rHJc#$sP$wkMdVc!tw=+FFa2X5^bgEdceZRW3 z=(+^az1m2MV8a(uggfQNkwjQ{Tp6Z{!Wc<0PUAR>v{r^Y0aIjFX+J8WG6~8sO|fAW zI`q&Oidd&6p1*daOB`wObMffqK$YN-dMZE10TW7CgXQW>8wbNYLU1=+ z?nweHqrjwjDx+X$rb4naT4#Le`$1KDB`%sA1<{MkMCYqI{FO5QUAIc?+EH33 z*Q|q|#Hd`Nu{Wpg+$YyJ8ZX|tws3<7_0*Ydi&cY0<4!Yn>hZskYc5;riueHL)p+Zs= zWfDd{G@gWhWporo21?f+%6h2NIMfM$8T4|wa+4tQ@E+y53SsC)xau^&l54w`8iBD5 z_9wl#e#YSg#1>S&8q!4CT63QB`AnjwY%1WDMw$VzJ&3{mypiUzi8l@nqAF66uZu7& zL#!`~e+qa#p59FEgN!%|@fVgs7Q~2XMi)sLVYwwvIxF&MBpQ6p(JKTEmi8GJ+@?}z z2d9mHemTNXpykoh9GFu>?Lb1j-HDbCuBDc6+4yCMfJEnX^GRsxtrH?%oh>@L^ok18 zZei$=@w{taD#-S%Y~;;#E#7s0h0Q}+m6WK)nL#H=y&wuQ)Pb_}ktne&RjJ05oO_j* z#z9);S&&Dl4>=;LiIP-%VUkzPH##p9#zrUwTuZp<~kVSo{>O}}}N4V6v`U*}$$ zrim&vmcv9Dc(rL7Eye=8` zD#Zs!!@KY3IV<+m(P(#Xb{(J(t+8>C$3aw?Ok)(|wn<`K21%S6KS<)(OOwb1MV=vs z`U-i)3u90q#ciD76pplS($#>LE9H@UjstkdAsR{Wlq4B5TR&9M`8rf-%%M0EySR-8 zwzcbZx_wl%vP{>`%r$WlEm@elUVDCVg&nCScpFNLZt zL|~yG=9RA{dN4P!NfVfVmH9d}k&iax6@)`2MG(Z9$-)FQ%d2RdVzW{&bd5sW?6%Gb z@w?aJ7!5>Q6RiD%P@0jjMLbzyV09DWjcG!H<);IaZyc0E6qK+kbNooy0-^qj_z@xx zIqbBkiXsK6d##}J=2Mz;i zLf$$^yS$|rE!S3C1lPhOiD#e6kCE7ebUlncD-&)U#^6&{!Vx?|Au(x1NDoG#%Xlz^ zFe>uc^E1pGWm@=HJap-&QEKpA;*~KdL!Bl7bN2A1M|Vm7^pRuz|)y? z<3Jjx2~K6PJ{tVS#E4;~ij@iFchC4?T3}g5KfsJZz$>N-B8=iVu6#c;Q4v(*SpBn( z;|c+;B!RK_m|F66B2bqK=kUlUuMhN=_>nN$wptc_M$&Y8DGpq`#Kxh7BJU%QB6L1O zP#DlAQ-L*H>@&)WhWyur6TTB#Yl=+vUQ}g5+7ucXyPb5pL~^qs57MljGpAT zR0OP!yACe(KFUeRVwb$6k?Q|9oM7RWG;u|=(IJG`cZ&WxarT28S)O=N z(GB{?9Xmn)_}Um}b>SSE)E5bJ!HRGq0siM!UmxT!7WcUgi=RMG?y9^?ze&8Li~L%Xwas zWd`TlIOHedD?^}7^1Q-oVdA{d9?>wUDP*%Iq;3%tLx?oy3KAkqAH#PXmPYJe31-q_ ztVrvask(|8GYbq0A~(LG2l3FjRfY5tz%em$(51u(Du?yMYejOrO<7zO zcIe)69)=+v7p~MgkPs?T!r0{sfq*8l18fsDC&I$^n z72Xb_GrY{@zwKf z90WBtp~A&u(g1}oR|G1e5T=12lM74~8#do4A&?xc-}9*c5@QWaE8ND06f}}8#;W*3 zLXoApHQ@Zy3gwy8f&?z^Mu|ck2edv@bsWGb=4c|n*#R{+TnVd`O)N4oWWE;PdU ziz>nQN_03$FH&bjCs{)BmqearBVqKMlK|YGxuX>y(H20mM;c%_gZskvKRyRL@%l?b z);Q3;A)s>~-8jgVm{f8c<3##pgiML!JV*}C2OD(QCzp58cU$2M}a^b2Y-Nm#c8`x4cklX4c6@K@ibs!Uap zq)%?9Pl2X{9Bt1lNY$q()7V7)dyXBcwX-!R@2VgDHMugvX$Ij`aT&T@ov&@Nt!2(f z4=`I>W^AhN-w!>$c>oU)PGjmbaf@PJBB9VwhD*g|ixRp=cA4qeF0a?xBR{ zhA_OG5)SFeSjl@1fUKszUfXBrZXFuv@PZaCS{M$RIM;?qg{T26=+w}09R7Pf8o1AI z93B*k3V3l@DFj_OH;PL|OVisVIG#oyYnAp9xEf9d~HhO9#J*V^tx_WwhtUxI`Gboa;}`FPv7$S zVFSO|L6&2jaCX6NjAJc|_U|xkT^Snc97Ef*w<%D$LJ9Pb>{p-dS51&YZOhsXP=c+3 zaYO*(I8yk2PYNp&Y#c3MRg0^HfG`nxH2H{x4=NN26Xhk935Yii@kix^0VSH;7*B}_ zhLR?TLBt?etMv%4jx}|#aaBSg^M4Q<&y8|tm>(Qa_IcJrV0eaequw*j6D2*L?#(k> zB6gH1_6I#Otk1D=_z;y5fDR(6(_p5_$ZPb;!51qWl@3uXliUYUz=tGB;f2OfuEr;+ z6+4hmEt`?b%h#McacBA(BU%8_Z@e!1&gF6*$|f*9_r*_x$txZ?4DD*-`i@8 z1004@wcy988pmLkcdh&U#^Dq09G}SIN(&!BhSoapD04%Yg7y*um8q8*lnI9481n?N zX~@=wl&UByQHyzOoWbJjj;L%!sivfVjCIh*tx!0GKJNF9 zE3&OI!as+qyS^N+Q~wS_J-l78;9RMxq-gPeTlr}9>rFKfNU7(9qgs zHnDuL-_y`Q=l)({xZuv5WjB=?KeFVHx9>DTAI*LNhGLn+>n427nnCmPRfGR=oB+ak(aR-CZ5KIX&97L zepUJi4@Twr)tP9oy0-ckZPZVF&tc`(;@mh591XyJ+WCGQ^t7L^*{2;H%zoW-Md=Op z{RY}1_qmN&27zoF(X7GNY2LDNu*LmDs0E&Ng*l9*P~1R%mf}?)=*EXhA@t!cipU~L z(U&Q6Erk)tMnoSbl<*oZA$wr<$K7)+dKQsWFkbGJIjPJf>tNWdr$=XpntGGce2Q2? zwX3Afz$I6VeRdTxT)CIdGzhIX-~PXU_tRyz!&^|qKTIhQN)5<@!k`IJ`^G~=GNE|s zs4S!GWm6zL;maeWn|mg}I!)}K6tt-PXf+1v@*@6nXfGV`vzA0I`D@1k$<81Q7VeOx zG|&dl2|>2K&ETGwz)NEL>Q#9C;KDfuA@$u~d;H^n`VajL`W8USPzeMop{Of2yc8iP zlD4EUQGbPzaizWu+l&-~e237m*xs}i1oV>G4^Yn75o%`HY1 zCXae@0Dv?(>hR*Ci%pURl-z_BMuucsF1FaLs=f&nIo-eE0UwjESj`S+|)fXFP z_UxCMF30r0s%HoDn%+)sgTcigyJHZye=v_pME&DQ{+>Y64|Je2$ z9DBB>*HvU|zWqYWzrJ|i;ap!`JSL>>-v2ut(OYV0Ib8EfC!FCGhs% z*v5_~7d3|w7ycr@-h<7%vZji>BBUsfA1)q0_vi{?t!#Qp)H{?_OfzEE(sc2G(K9rZ zw?mI5@;EZ1%`o}gTReGg>i#eX3C=lITNc8kR1qIPOON0?aaa*K?|Ess_~_WZoX6Z9 zyr?ndD)OXQeDd6MtLHxaegktNQpH3!sla>ws62l5$LD2K2S2YZ!ajdk9N&4FAZ?0V z&^c`J-b+LzXZ}m1*#S8T1y;0=wdaS0rQiCiZ@=~*Z>g}9ktduRe4eX(USF09qm_etLZcG&S&B1_hpXu;TLRo*T(FCLlpJ$^hacv z1lwM^?fXyp(PL5gSP<;w^y7$vKYnfh=$Sd5Q;D_NFBk9PoQO!)`F3K;e4E6DbQ^(R zZzDqnQf`TI8`bk**PU;5t>AcSLQklas5~s&MP3<0C?>>FVc$-!r!8YejXf$FhVG2L2%@O-PnjhUhoS)URvzlg=Hqfj7m#&kOtq%9H z)FhUcw%@97mdOsSv`hT*D?$XeB=|*L%WMI>n9d_P)n~~!qd6IyprZjv zgd~;|1XUCia`p7-ClrIS=f^e_r^608-=YPM0`FJ(2MTDzLmRKMr|^QxjC zS3*$*(iLdq=7lDKxF{=1ad=*d*DEFKPk|xi@)CecscQkLMRP|K zUPK>DXp)!Xg(UTd+9miWbE20Ms)CctZomPLH#8olYr>Q?0_t>W&6s??Z<23F* Xd5vz7sDC6dif`yAFYtNs^iTc|tJI=d literal 0 HcmV?d00001 diff --git a/wrkplay_dbt/target/run/wrkplay_dbt/models/example/my_first_dbt_model.sql b/wrkplay_dbt/target/run/wrkplay_dbt/models/example/my_first_dbt_model.sql new file mode 100644 index 0000000..6d39c1c --- /dev/null +++ b/wrkplay_dbt/target/run/wrkplay_dbt/models/example/my_first_dbt_model.sql @@ -0,0 +1,29 @@ + + create view "postgres"."public"."my_first_dbt_model__dbt_tmp" as ( + /* + 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 + ); \ No newline at end of file diff --git a/wrkplay_dbt/target/run/wrkplay_dbt/models/example/my_second_dbt_model.sql b/wrkplay_dbt/target/run/wrkplay_dbt/models/example/my_second_dbt_model.sql new file mode 100644 index 0000000..c2d1b00 --- /dev/null +++ b/wrkplay_dbt/target/run/wrkplay_dbt/models/example/my_second_dbt_model.sql @@ -0,0 +1,8 @@ + + create view "postgres"."public"."my_second_dbt_model__dbt_tmp" as ( + -- Use the `ref` function to select from other models + +select * +from "postgres"."public"."my_first_dbt_model" +where id = 1 + ); \ No newline at end of file diff --git a/wrkplay_dbt/target/run/wrkplay_dbt/models/example/schema.yml/not_null_my_first_dbt_model_id.sql b/wrkplay_dbt/target/run/wrkplay_dbt/models/example/schema.yml/not_null_my_first_dbt_model_id.sql new file mode 100644 index 0000000..94a7aad --- /dev/null +++ b/wrkplay_dbt/target/run/wrkplay_dbt/models/example/schema.yml/not_null_my_first_dbt_model_id.sql @@ -0,0 +1,19 @@ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select id +from "postgres"."public"."my_first_dbt_model" +where id is null + + + + + ) dbt_internal_test \ No newline at end of file diff --git a/wrkplay_dbt/target/run/wrkplay_dbt/models/example/schema.yml/not_null_my_second_dbt_model_id.sql b/wrkplay_dbt/target/run/wrkplay_dbt/models/example/schema.yml/not_null_my_second_dbt_model_id.sql new file mode 100644 index 0000000..32f63ed --- /dev/null +++ b/wrkplay_dbt/target/run/wrkplay_dbt/models/example/schema.yml/not_null_my_second_dbt_model_id.sql @@ -0,0 +1,19 @@ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select id +from "postgres"."public"."my_second_dbt_model" +where id is null + + + + + ) dbt_internal_test \ No newline at end of file diff --git a/wrkplay_dbt/target/run/wrkplay_dbt/models/example/schema.yml/unique_my_first_dbt_model_id.sql b/wrkplay_dbt/target/run/wrkplay_dbt/models/example/schema.yml/unique_my_first_dbt_model_id.sql new file mode 100644 index 0000000..d2962a2 --- /dev/null +++ b/wrkplay_dbt/target/run/wrkplay_dbt/models/example/schema.yml/unique_my_first_dbt_model_id.sql @@ -0,0 +1,22 @@ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + +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 + + + + + ) dbt_internal_test \ No newline at end of file diff --git a/wrkplay_dbt/target/run/wrkplay_dbt/models/example/schema.yml/unique_my_second_dbt_model_id.sql b/wrkplay_dbt/target/run/wrkplay_dbt/models/example/schema.yml/unique_my_second_dbt_model_id.sql new file mode 100644 index 0000000..5a77777 --- /dev/null +++ b/wrkplay_dbt/target/run/wrkplay_dbt/models/example/schema.yml/unique_my_second_dbt_model_id.sql @@ -0,0 +1,22 @@ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + +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 + + + + + ) dbt_internal_test \ No newline at end of file diff --git a/wrkplay_dbt/target/run/wrkplay_dbt/models/marts/number_played_against.sql b/wrkplay_dbt/target/run/wrkplay_dbt/models/marts/number_played_against.sql new file mode 100644 index 0000000..9974b09 --- /dev/null +++ b/wrkplay_dbt/target/run/wrkplay_dbt/models/marts/number_played_against.sql @@ -0,0 +1,43 @@ + + create view "postgres"."public"."number_played_against__dbt_tmp" as ( + -- 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" + ); \ No newline at end of file diff --git a/wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/not_null_number_played_against_num_played_against.sql b/wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/not_null_number_played_against_num_played_against.sql new file mode 100644 index 0000000..aae99d6 --- /dev/null +++ b/wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/not_null_number_played_against_num_played_against.sql @@ -0,0 +1,19 @@ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select num_played_against +from "postgres"."public"."number_played_against" +where num_played_against is null + + + + + ) dbt_internal_test \ No newline at end of file diff --git a/wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/not_null_number_played_against_player_id.sql b/wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/not_null_number_played_against_player_id.sql new file mode 100644 index 0000000..88ea2d9 --- /dev/null +++ b/wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/not_null_number_played_against_player_id.sql @@ -0,0 +1,19 @@ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select player_id +from "postgres"."public"."number_played_against" +where player_id is null + + + + + ) dbt_internal_test \ No newline at end of file diff --git a/wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/not_null_number_played_against_season_id.sql b/wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/not_null_number_played_against_season_id.sql new file mode 100644 index 0000000..d897c88 --- /dev/null +++ b/wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/not_null_number_played_against_season_id.sql @@ -0,0 +1,19 @@ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select season_id +from "postgres"."public"."number_played_against" +where season_id is null + + + + + ) dbt_internal_test \ No newline at end of file diff --git a/wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/not_null_wins_losses_gameid.sql b/wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/not_null_wins_losses_gameid.sql new file mode 100644 index 0000000..0c53a8d --- /dev/null +++ b/wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/not_null_wins_losses_gameid.sql @@ -0,0 +1,19 @@ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select gameid +from "postgres"."public"."wins_losses" +where gameid is null + + + + + ) dbt_internal_test \ No newline at end of file diff --git a/wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/not_null_wins_losses_player_id.sql b/wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/not_null_wins_losses_player_id.sql new file mode 100644 index 0000000..07d8684 --- /dev/null +++ b/wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/not_null_wins_losses_player_id.sql @@ -0,0 +1,19 @@ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select player_id +from "postgres"."public"."wins_losses" +where player_id is null + + + + + ) dbt_internal_test \ No newline at end of file diff --git a/wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/not_null_wins_losses_seasonid.sql b/wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/not_null_wins_losses_seasonid.sql new file mode 100644 index 0000000..c9e8d01 --- /dev/null +++ b/wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/not_null_wins_losses_seasonid.sql @@ -0,0 +1,19 @@ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select seasonid +from "postgres"."public"."wins_losses" +where seasonid is null + + + + + ) dbt_internal_test \ No newline at end of file diff --git a/wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/positive_test_number_played_against_num_played_against.sql b/wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/positive_test_number_played_against_num_played_against.sql new file mode 100644 index 0000000..974e499 --- /dev/null +++ b/wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/positive_test_number_played_against_num_played_against.sql @@ -0,0 +1,33 @@ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + +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 + + + + ) dbt_internal_test \ No newline at end of file diff --git a/wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/positive_test_wins_losses_total_losses.sql b/wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/positive_test_wins_losses_total_losses.sql new file mode 100644 index 0000000..e138813 --- /dev/null +++ b/wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/positive_test_wins_losses_total_losses.sql @@ -0,0 +1,33 @@ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + +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 + + + + ) dbt_internal_test \ No newline at end of file diff --git a/wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/positive_test_wins_losses_total_wins.sql b/wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/positive_test_wins_losses_total_wins.sql new file mode 100644 index 0000000..c3fe194 --- /dev/null +++ b/wrkplay_dbt/target/run/wrkplay_dbt/models/marts/schema.yml/positive_test_wins_losses_total_wins.sql @@ -0,0 +1,33 @@ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + +with validation as ( + + select + total_wins 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 + + + + ) dbt_internal_test \ No newline at end of file diff --git a/wrkplay_dbt/target/run/wrkplay_dbt/models/marts/wins_losses.sql b/wrkplay_dbt/target/run/wrkplay_dbt/models/marts/wins_losses.sql new file mode 100644 index 0000000..4befcdd --- /dev/null +++ b/wrkplay_dbt/target/run/wrkplay_dbt/models/marts/wins_losses.sql @@ -0,0 +1,198 @@ + + create view "postgres"."public"."wins_losses__dbt_tmp" as ( + --number of wins and losses per player per game (per office) per season +WITH loss_table AS ( + SELECT + SUM(lt.left_losses) AS "total_losses" + , lt.left_player_id AS "loss_player_id" + , lt.gameid + , lt.seasonid + FROM + ( + SELECT + * + FROM + ( + --Begin DONE + WITH left_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore > m.rightscore THEN 0 + ELSE 1 + END) AS "left_loss" + , l."A" + , l."B" + , m."gameid" + , m."seasonid" + FROM + "_left" l + JOIN "Match" m ON + l."A" = m.id + GROUP BY + l."A" + , l."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.left_loss) AS "left_losses" + , a."B" AS "left_player_id" + , a."gameid" + , a."seasonid" + FROM + left_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + --End DONE + ) ll + UNION ALL + SELECT + * + FROM + ( + --Begin DONE + WITH right_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore < m.rightscore THEN 0 + ELSE 1 + END) AS "right_loss" + , r."A" + , r."B" + , m."gameid" + , m."seasonid" + FROM + "_right" r + JOIN "Match" m ON + r."A" = m.id + GROUP BY + r."A" + , r."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.right_loss) AS "right_losses" + , a."B" AS "right_player_id" + , a."gameid" + , a."seasonid" + FROM + right_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + --End DONE + ) rl + ) lt + -- WHERE lt.left_player_id = '' + GROUP BY + lt.left_player_id + , lt.gameid + , lt.seasonid +) +, +win_table AS ( + --number of wins for a player and gameid + SELECT + SUM(rt.right_wins) AS "total_wins" + , rt.right_player_id AS "win_player_id" + , rt.gameid + , rt."seasonid" + FROM + ( + SELECT + * + FROM + ( + WITH right_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore < m.rightscore THEN 1 + ELSE 0 + END) AS "right_won" + , r."A" + , r."B" + , m."gameid" + , m."seasonid" + FROM + "_right" r + JOIN "Match" m ON + r."A" = m.id + GROUP BY + r."A" + , r."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.right_won) AS "right_wins" + , a."B" AS "right_player_id" + , a."gameid" + , a."seasonid" + FROM + right_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + ) rw + UNION ALL + SELECT + * + FROM + ( + WITH left_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore > m.rightscore THEN 1 + ELSE 0 + END) AS "left_won" + , l."A" + , l."B" + , m."gameid" + , m."seasonid" + FROM + "_left" l + JOIN "Match" m ON + l."A" = m.id + GROUP BY + l."A" + , l."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.left_won) AS "left_wins" + , a."B" AS "left_player_id" + , a."gameid" + , a."seasonid" + FROM + left_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + ) lw + ) rt + -- WHERE rt.right_player_id = '' + GROUP BY + rt.right_player_id + , rt.gameid + , rt."seasonid" +) +SELECT + COALESCE(lt.loss_player_id, wt.win_player_id) AS "player_id" + , COALESCE(lt."gameid", wt."gameid") AS "gameid" + , COALESCE(lt.seasonid, wt.seasonid) AS "seasonid" + , wt."total_wins" + , lt."total_losses" +FROM + loss_table lt +FULL OUTER JOIN win_table wt ON + lt."loss_player_id" = wt."win_player_id" + AND lt."gameid" = wt."gameid" + AND lt."seasonid" = wt."seasonid" + ); \ No newline at end of file diff --git a/wrkplay_dbt/target/run/wrkplay_dbt/models/number_played_against.sql b/wrkplay_dbt/target/run/wrkplay_dbt/models/number_played_against.sql new file mode 100644 index 0000000..9974b09 --- /dev/null +++ b/wrkplay_dbt/target/run/wrkplay_dbt/models/number_played_against.sql @@ -0,0 +1,43 @@ + + create view "postgres"."public"."number_played_against__dbt_tmp" as ( + -- 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" + ); \ No newline at end of file diff --git a/wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/not_null_number_played_against_num_played_against.sql b/wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/not_null_number_played_against_num_played_against.sql new file mode 100644 index 0000000..aae99d6 --- /dev/null +++ b/wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/not_null_number_played_against_num_played_against.sql @@ -0,0 +1,19 @@ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select num_played_against +from "postgres"."public"."number_played_against" +where num_played_against is null + + + + + ) dbt_internal_test \ No newline at end of file diff --git a/wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/not_null_number_played_against_player_id.sql b/wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/not_null_number_played_against_player_id.sql new file mode 100644 index 0000000..88ea2d9 --- /dev/null +++ b/wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/not_null_number_played_against_player_id.sql @@ -0,0 +1,19 @@ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select player_id +from "postgres"."public"."number_played_against" +where player_id is null + + + + + ) dbt_internal_test \ No newline at end of file diff --git a/wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/not_null_number_played_against_season_id.sql b/wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/not_null_number_played_against_season_id.sql new file mode 100644 index 0000000..d897c88 --- /dev/null +++ b/wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/not_null_number_played_against_season_id.sql @@ -0,0 +1,19 @@ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select season_id +from "postgres"."public"."number_played_against" +where season_id is null + + + + + ) dbt_internal_test \ No newline at end of file diff --git a/wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/not_null_wins_losses_gameid.sql b/wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/not_null_wins_losses_gameid.sql new file mode 100644 index 0000000..0c53a8d --- /dev/null +++ b/wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/not_null_wins_losses_gameid.sql @@ -0,0 +1,19 @@ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select gameid +from "postgres"."public"."wins_losses" +where gameid is null + + + + + ) dbt_internal_test \ No newline at end of file diff --git a/wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/not_null_wins_losses_player_id.sql b/wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/not_null_wins_losses_player_id.sql new file mode 100644 index 0000000..07d8684 --- /dev/null +++ b/wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/not_null_wins_losses_player_id.sql @@ -0,0 +1,19 @@ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select player_id +from "postgres"."public"."wins_losses" +where player_id is null + + + + + ) dbt_internal_test \ No newline at end of file diff --git a/wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/not_null_wins_losses_seasonid.sql b/wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/not_null_wins_losses_seasonid.sql new file mode 100644 index 0000000..c9e8d01 --- /dev/null +++ b/wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/not_null_wins_losses_seasonid.sql @@ -0,0 +1,19 @@ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + + + +select seasonid +from "postgres"."public"."wins_losses" +where seasonid is null + + + + + ) dbt_internal_test \ No newline at end of file diff --git a/wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/positive_test_number_played_against_num_played_against.sql b/wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/positive_test_number_played_against_num_played_against.sql new file mode 100644 index 0000000..974e499 --- /dev/null +++ b/wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/positive_test_number_played_against_num_played_against.sql @@ -0,0 +1,33 @@ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + +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 + + + + ) dbt_internal_test \ No newline at end of file diff --git a/wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/positive_test_wins_losses_total_losses.sql b/wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/positive_test_wins_losses_total_losses.sql new file mode 100644 index 0000000..e138813 --- /dev/null +++ b/wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/positive_test_wins_losses_total_losses.sql @@ -0,0 +1,33 @@ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + +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 + + + + ) dbt_internal_test \ No newline at end of file diff --git a/wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/positive_test_wins_losses_total_wins.sql b/wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/positive_test_wins_losses_total_wins.sql new file mode 100644 index 0000000..c3fe194 --- /dev/null +++ b/wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/positive_test_wins_losses_total_wins.sql @@ -0,0 +1,33 @@ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + +with validation as ( + + select + total_wins 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 + + + + ) dbt_internal_test \ No newline at end of file diff --git a/wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/unique_wins_losses_seasonid.sql b/wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/unique_wins_losses_seasonid.sql new file mode 100644 index 0000000..161fb56 --- /dev/null +++ b/wrkplay_dbt/target/run/wrkplay_dbt/models/schema.yml/unique_wins_losses_seasonid.sql @@ -0,0 +1,22 @@ +select + count(*) as failures, + count(*) != 0 as should_warn, + count(*) != 0 as should_error + from ( + + + + +select + seasonid as unique_field, + count(*) as n_records + +from "postgres"."public"."wins_losses" +where seasonid is not null +group by seasonid +having count(*) > 1 + + + + + ) dbt_internal_test \ No newline at end of file diff --git a/wrkplay_dbt/target/run/wrkplay_dbt/models/wins_losses.sql b/wrkplay_dbt/target/run/wrkplay_dbt/models/wins_losses.sql new file mode 100644 index 0000000..4befcdd --- /dev/null +++ b/wrkplay_dbt/target/run/wrkplay_dbt/models/wins_losses.sql @@ -0,0 +1,198 @@ + + create view "postgres"."public"."wins_losses__dbt_tmp" as ( + --number of wins and losses per player per game (per office) per season +WITH loss_table AS ( + SELECT + SUM(lt.left_losses) AS "total_losses" + , lt.left_player_id AS "loss_player_id" + , lt.gameid + , lt.seasonid + FROM + ( + SELECT + * + FROM + ( + --Begin DONE + WITH left_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore > m.rightscore THEN 0 + ELSE 1 + END) AS "left_loss" + , l."A" + , l."B" + , m."gameid" + , m."seasonid" + FROM + "_left" l + JOIN "Match" m ON + l."A" = m.id + GROUP BY + l."A" + , l."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.left_loss) AS "left_losses" + , a."B" AS "left_player_id" + , a."gameid" + , a."seasonid" + FROM + left_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + --End DONE + ) ll + UNION ALL + SELECT + * + FROM + ( + --Begin DONE + WITH right_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore < m.rightscore THEN 0 + ELSE 1 + END) AS "right_loss" + , r."A" + , r."B" + , m."gameid" + , m."seasonid" + FROM + "_right" r + JOIN "Match" m ON + r."A" = m.id + GROUP BY + r."A" + , r."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.right_loss) AS "right_losses" + , a."B" AS "right_player_id" + , a."gameid" + , a."seasonid" + FROM + right_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + --End DONE + ) rl + ) lt + -- WHERE lt.left_player_id = '' + GROUP BY + lt.left_player_id + , lt.gameid + , lt.seasonid +) +, +win_table AS ( + --number of wins for a player and gameid + SELECT + SUM(rt.right_wins) AS "total_wins" + , rt.right_player_id AS "win_player_id" + , rt.gameid + , rt."seasonid" + FROM + ( + SELECT + * + FROM + ( + WITH right_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore < m.rightscore THEN 1 + ELSE 0 + END) AS "right_won" + , r."A" + , r."B" + , m."gameid" + , m."seasonid" + FROM + "_right" r + JOIN "Match" m ON + r."A" = m.id + GROUP BY + r."A" + , r."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.right_won) AS "right_wins" + , a."B" AS "right_player_id" + , a."gameid" + , a."seasonid" + FROM + right_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + ) rw + UNION ALL + SELECT + * + FROM + ( + WITH left_count AS ( + SELECT + AVG(CASE + WHEN m.leftscore > m.rightscore THEN 1 + ELSE 0 + END) AS "left_won" + , l."A" + , l."B" + , m."gameid" + , m."seasonid" + FROM + "_left" l + JOIN "Match" m ON + l."A" = m.id + GROUP BY + l."A" + , l."B" + , m."gameid" + , m."seasonid" + ) + SELECT + SUM(a.left_won) AS "left_wins" + , a."B" AS "left_player_id" + , a."gameid" + , a."seasonid" + FROM + left_count a + GROUP BY + a."B" + , a."gameid" + , a."seasonid" + ) lw + ) rt + -- WHERE rt.right_player_id = '' + GROUP BY + rt.right_player_id + , rt.gameid + , rt."seasonid" +) +SELECT + COALESCE(lt.loss_player_id, wt.win_player_id) AS "player_id" + , COALESCE(lt."gameid", wt."gameid") AS "gameid" + , COALESCE(lt.seasonid, wt.seasonid) AS "seasonid" + , wt."total_wins" + , lt."total_losses" +FROM + loss_table lt +FULL OUTER JOIN win_table wt ON + lt."loss_player_id" = wt."win_player_id" + AND lt."gameid" = wt."gameid" + AND lt."seasonid" = wt."seasonid" + ); \ No newline at end of file diff --git a/wrkplay_dbt/target/run_results.json b/wrkplay_dbt/target/run_results.json new file mode 100644 index 0000000..2968199 --- /dev/null +++ b/wrkplay_dbt/target/run_results.json @@ -0,0 +1,217 @@ +{ + "metadata": { + "dbt_schema_version": "https://schemas.getdbt.com/dbt/run-results/v4.json", + "dbt_version": "1.1.1", + "generated_at": "2022-07-11T14:43:35.470456Z", + "invocation_id": "2bd1cbb2-621f-40bb-84bd-067b02dacb3e", + "env": {} + }, + "results": [ + { + "status": "pass", + "timing": [ + { + "name": "compile", + "started_at": "2022-07-11T14:43:34.354795Z", + "completed_at": "2022-07-11T14:43:34.365149Z" + }, + { + "name": "execute", + "started_at": "2022-07-11T14:43:34.377171Z", + "completed_at": "2022-07-11T14:43:34.812568Z" + } + ], + "thread_id": "Thread-9", + "execution_time": 0.4982945919036865, + "adapter_response": {}, + "message": null, + "failures": 0, + "unique_id": "test.wrkplay_dbt.positive_test_wins_losses_total_wins.dc5787dd77" + }, + { + "status": "pass", + "timing": [ + { + "name": "compile", + "started_at": "2022-07-11T14:43:34.345273Z", + "completed_at": "2022-07-11T14:43:34.361590Z" + }, + { + "name": "execute", + "started_at": "2022-07-11T14:43:34.371647Z", + "completed_at": "2022-07-11T14:43:34.808474Z" + } + ], + "thread_id": "Thread-2", + "execution_time": 0.5226919651031494, + "adapter_response": {}, + "message": null, + "failures": 0, + "unique_id": "test.wrkplay_dbt.not_null_number_played_against_player_id.d65aae7427" + }, + { + "status": "pass", + "timing": [ + { + "name": "compile", + "started_at": "2022-07-11T14:43:34.354729Z", + "completed_at": "2022-07-11T14:43:34.365090Z" + }, + { + "name": "execute", + "started_at": "2022-07-11T14:43:34.376432Z", + "completed_at": "2022-07-11T14:43:34.902589Z" + } + ], + "thread_id": "Thread-8", + "execution_time": 0.5960471630096436, + "adapter_response": {}, + "message": null, + "failures": 0, + "unique_id": "test.wrkplay_dbt.positive_test_wins_losses_total_losses.66243e8ebe" + }, + { + "status": "pass", + "timing": [ + { + "name": "compile", + "started_at": "2022-07-11T14:43:34.345438Z", + "completed_at": "2022-07-11T14:43:34.364301Z" + }, + { + "name": "execute", + "started_at": "2022-07-11T14:43:34.372447Z", + "completed_at": "2022-07-11T14:43:34.907750Z" + } + ], + "thread_id": "Thread-3", + "execution_time": 0.5974090099334717, + "adapter_response": {}, + "message": null, + "failures": 0, + "unique_id": "test.wrkplay_dbt.not_null_number_played_against_season_id.53f4b10073" + }, + { + "status": "pass", + "timing": [ + { + "name": "compile", + "started_at": "2022-07-11T14:43:34.345605Z", + "completed_at": "2022-07-11T14:43:34.364450Z" + }, + { + "name": "execute", + "started_at": "2022-07-11T14:43:34.373120Z", + "completed_at": "2022-07-11T14:43:34.905138Z" + } + ], + "thread_id": "Thread-4", + "execution_time": 0.5972352027893066, + "adapter_response": {}, + "message": null, + "failures": 0, + "unique_id": "test.wrkplay_dbt.not_null_wins_losses_gameid.b3459a82c1" + }, + { + "status": "pass", + "timing": [ + { + "name": "compile", + "started_at": "2022-07-11T14:43:34.351615Z", + "completed_at": "2022-07-11T14:43:34.364570Z" + }, + { + "name": "execute", + "started_at": "2022-07-11T14:43:34.373978Z", + "completed_at": "2022-07-11T14:43:34.908291Z" + } + ], + "thread_id": "Thread-5", + "execution_time": 0.5972499847412109, + "adapter_response": {}, + "message": null, + "failures": 0, + "unique_id": "test.wrkplay_dbt.not_null_wins_losses_player_id.88b8772d15" + }, + { + "status": "pass", + "timing": [ + { + "name": "compile", + "started_at": "2022-07-11T14:43:34.353187Z", + "completed_at": "2022-07-11T14:43:34.364641Z" + }, + { + "name": "execute", + "started_at": "2022-07-11T14:43:34.374654Z", + "completed_at": "2022-07-11T14:43:34.906891Z" + } + ], + "thread_id": "Thread-6", + "execution_time": 0.5974671840667725, + "adapter_response": {}, + "message": null, + "failures": 0, + "unique_id": "test.wrkplay_dbt.not_null_wins_losses_seasonid.a40c396813" + }, + { + "status": "pass", + "timing": [ + { + "name": "compile", + "started_at": "2022-07-11T14:43:34.345149Z", + "completed_at": "2022-07-11T14:43:34.361492Z" + }, + { + "name": "execute", + "started_at": "2022-07-11T14:43:34.365324Z", + "completed_at": "2022-07-11T14:43:34.921129Z" + } + ], + "thread_id": "Thread-1", + "execution_time": 0.6014151573181152, + "adapter_response": {}, + "message": null, + "failures": 0, + "unique_id": "test.wrkplay_dbt.not_null_number_played_against_num_played_against.19f565a96c" + }, + { + "status": "pass", + "timing": [ + { + "name": "compile", + "started_at": "2022-07-11T14:43:34.353253Z", + "completed_at": "2022-07-11T14:43:34.364825Z" + }, + { + "name": "execute", + "started_at": "2022-07-11T14:43:34.375449Z", + "completed_at": "2022-07-11T14:43:34.940693Z" + } + ], + "thread_id": "Thread-7", + "execution_time": 0.6620962619781494, + "adapter_response": {}, + "message": null, + "failures": 0, + "unique_id": "test.wrkplay_dbt.positive_test_number_played_against_num_played_against.7335215a20" + } + ], + "elapsed_time": 2.1355838775634766, + "args": { + "write_json": true, + "use_colors": true, + "printer_width": 80, + "version_check": true, + "partial_parse": true, + "static_parser": true, + "profiles_dir": "/Users/bruno.campos/.dbt", + "send_anonymous_usage_stats": true, + "event_buffer_size": 100000, + "quiet": false, + "no_print": false, + "indirect_selection": "eager", + "which": "test", + "rpc_method": "test" + } +}