From 06523a7f58c22a37abd236634a3353324a57e6d9 Mon Sep 17 00:00:00 2001 From: Mike Alfare Date: Wed, 20 Mar 2024 14:26:29 -0400 Subject: [PATCH] remove tests inadvertently migrated during the core-adapter de-coupling --- tests/functional/dependencies/data/seed.sql | 586 --------------- tests/functional/dependencies/data/update.sql | 7 - .../duplicate_dependency/dbt_project.yml | 5 - .../early_hook_dependency/dbt_project.yml | 6 - .../late_hook_dependency/dbt_project.yml | 6 - .../local_dependency/dbt_project.yml | 23 - .../local_dependency/macros/dep_macro.sql | 3 - .../macros/generate_schema_name.sql | 15 - .../models/model_to_import.sql | 1 - .../local_dependency/models/schema.yml | 11 - .../local_dependency/seeds/seed.csv | 2 - .../models_local/dep_source_model.sql | 2 - .../models_local/my_configured_model.sql | 4 - .../dependencies/models_local/my_model.sql | 2 - .../dependencies/models_local/schema.yml | 7 - .../models_local/source_override_model.sql | 2 - .../dependencies/test_dependency_options.py | 106 --- .../dependencies/test_local_dependency.py | 356 ---------- .../dependencies/test_simple_dependency.py | 435 ------------ .../test_simple_dependency_with_configs.py | 106 --- tests/functional/metrics/fixtures.py | 666 ------------------ .../functional/metrics/test_metric_configs.py | 206 ------ .../metrics/test_metric_deferral.py | 83 --- .../metrics/test_metric_helper_functions.py | 53 -- tests/functional/metrics/test_metrics.py | 399 ----------- 25 files changed, 3092 deletions(-) delete mode 100644 tests/functional/dependencies/data/seed.sql delete mode 100644 tests/functional/dependencies/data/update.sql delete mode 100644 tests/functional/dependencies/duplicate_dependency/dbt_project.yml delete mode 100644 tests/functional/dependencies/early_hook_dependency/dbt_project.yml delete mode 100644 tests/functional/dependencies/late_hook_dependency/dbt_project.yml delete mode 100644 tests/functional/dependencies/local_dependency/dbt_project.yml delete mode 100644 tests/functional/dependencies/local_dependency/macros/dep_macro.sql delete mode 100644 tests/functional/dependencies/local_dependency/macros/generate_schema_name.sql delete mode 100644 tests/functional/dependencies/local_dependency/models/model_to_import.sql delete mode 100644 tests/functional/dependencies/local_dependency/models/schema.yml delete mode 100644 tests/functional/dependencies/local_dependency/seeds/seed.csv delete mode 100644 tests/functional/dependencies/models_local/dep_source_model.sql delete mode 100644 tests/functional/dependencies/models_local/my_configured_model.sql delete mode 100644 tests/functional/dependencies/models_local/my_model.sql delete mode 100644 tests/functional/dependencies/models_local/schema.yml delete mode 100644 tests/functional/dependencies/models_local/source_override_model.sql delete mode 100644 tests/functional/dependencies/test_dependency_options.py delete mode 100644 tests/functional/dependencies/test_local_dependency.py delete mode 100644 tests/functional/dependencies/test_simple_dependency.py delete mode 100644 tests/functional/dependencies/test_simple_dependency_with_configs.py delete mode 100644 tests/functional/metrics/fixtures.py delete mode 100644 tests/functional/metrics/test_metric_configs.py delete mode 100644 tests/functional/metrics/test_metric_deferral.py delete mode 100644 tests/functional/metrics/test_metric_helper_functions.py delete mode 100644 tests/functional/metrics/test_metrics.py diff --git a/tests/functional/dependencies/data/seed.sql b/tests/functional/dependencies/data/seed.sql deleted file mode 100644 index b74c3b35..00000000 --- a/tests/functional/dependencies/data/seed.sql +++ /dev/null @@ -1,586 +0,0 @@ -create table {schema}.seed ( - id INTEGER, - first_name VARCHAR(11), - email VARCHAR(31), - ip_address VARCHAR(15), - updated_at TIMESTAMP WITHOUT TIME ZONE -); - - -INSERT INTO {schema}.seed - ("id","first_name","email","ip_address","updated_at") -VALUES - (1,'Larry','lking0@miitbeian.gov.cn','69.135.206.194','2008-09-12 19:08:31'), - (2,'Larry','lperkins1@toplist.cz','64.210.133.162','1978-05-09 04:15:14'), - (3,'Anna','amontgomery2@miitbeian.gov.cn','168.104.64.114','2011-10-16 04:07:57'), - (4,'Sandra','sgeorge3@livejournal.com','229.235.252.98','1973-07-19 10:52:43'), - (5,'Fred','fwoods4@google.cn','78.229.170.124','2012-09-30 16:38:29'), - (6,'Stephen','shanson5@livejournal.com','182.227.157.105','1995-11-07 21:40:50'), - (7,'William','wmartinez6@upenn.edu','135.139.249.50','1982-09-05 03:11:59'), - (8,'Jessica','jlong7@hao123.com','203.62.178.210','1991-10-16 11:03:15'), - (9,'Douglas','dwhite8@tamu.edu','178.187.247.1','1979-10-01 09:49:48'), - (10,'Lisa','lcoleman9@nydailynews.com','168.234.128.249','2011-05-26 07:45:49'), - (11,'Ralph','rfieldsa@home.pl','55.152.163.149','1972-11-18 19:06:11'), - (12,'Louise','lnicholsb@samsung.com','141.116.153.154','2014-11-25 20:56:14'), - (13,'Clarence','cduncanc@sfgate.com','81.171.31.133','2011-11-17 07:02:36'), - (14,'Daniel','dfranklind@omniture.com','8.204.211.37','1980-09-13 00:09:04'), - (15,'Katherine','klanee@auda.org.au','176.96.134.59','1997-08-22 19:36:56'), - (16,'Billy','bwardf@wikia.com','214.108.78.85','2003-10-19 02:14:47'), - (17,'Annie','agarzag@ocn.ne.jp','190.108.42.70','1988-10-28 15:12:35'), - (18,'Shirley','scolemanh@fastcompany.com','109.251.164.84','1988-08-24 10:50:57'), - (19,'Roger','rfrazieri@scribd.com','38.145.218.108','1985-12-31 15:17:15'), - (20,'Lillian','lstanleyj@goodreads.com','47.57.236.17','1970-06-08 02:09:05'), - (21,'Aaron','arodriguezk@nps.gov','205.245.118.221','1985-10-11 23:07:49'), - (22,'Patrick','pparkerl@techcrunch.com','19.8.100.182','2006-03-29 12:53:56'), - (23,'Phillip','pmorenom@intel.com','41.38.254.103','2011-11-07 15:35:43'), - (24,'Henry','hgarcian@newsvine.com','1.191.216.252','2008-08-28 08:30:44'), - (25,'Irene','iturnero@opera.com','50.17.60.190','1994-04-01 07:15:02'), - (26,'Andrew','adunnp@pen.io','123.52.253.176','2000-11-01 06:03:25'), - (27,'David','dgutierrezq@wp.com','238.23.203.42','1988-01-25 07:29:18'), - (28,'Henry','hsanchezr@cyberchimps.com','248.102.2.185','1983-01-01 13:36:37'), - (29,'Evelyn','epetersons@gizmodo.com','32.80.46.119','1979-07-16 17:24:12'), - (30,'Tammy','tmitchellt@purevolume.com','249.246.167.88','2001-04-03 10:00:23'), - (31,'Jacqueline','jlittleu@domainmarket.com','127.181.97.47','1986-02-11 21:35:50'), - (32,'Earl','eortizv@opera.com','166.47.248.240','1996-07-06 08:16:27'), - (33,'Juan','jgordonw@sciencedirect.com','71.77.2.200','1987-01-31 03:46:44'), - (34,'Diane','dhowellx@nyu.edu','140.94.133.12','1994-06-11 02:30:05'), - (35,'Randy','rkennedyy@microsoft.com','73.255.34.196','2005-05-26 20:28:39'), - (36,'Janice','jriveraz@time.com','22.214.227.32','1990-02-09 04:16:52'), - (37,'Laura','lperry10@diigo.com','159.148.145.73','2015-03-17 05:59:25'), - (38,'Gary','gray11@statcounter.com','40.193.124.56','1970-01-27 10:04:51'), - (39,'Jesse','jmcdonald12@typepad.com','31.7.86.103','2009-03-14 08:14:29'), - (40,'Sandra','sgonzalez13@goodreads.com','223.80.168.239','1993-05-21 14:08:54'), - (41,'Scott','smoore14@archive.org','38.238.46.83','1980-08-30 11:16:56'), - (42,'Phillip','pevans15@cisco.com','158.234.59.34','2011-12-15 23:26:31'), - (43,'Steven','sriley16@google.ca','90.247.57.68','2011-10-29 19:03:28'), - (44,'Deborah','dbrown17@hexun.com','179.125.143.240','1995-04-10 14:36:07'), - (45,'Lori','lross18@ow.ly','64.80.162.180','1980-12-27 16:49:15'), - (46,'Sean','sjackson19@tumblr.com','240.116.183.69','1988-06-12 21:24:45'), - (47,'Terry','tbarnes1a@163.com','118.38.213.137','1997-09-22 16:43:19'), - (48,'Dorothy','dross1b@ebay.com','116.81.76.49','2005-02-28 13:33:24'), - (49,'Samuel','swashington1c@house.gov','38.191.253.40','1989-01-19 21:15:48'), - (50,'Ralph','rcarter1d@tinyurl.com','104.84.60.174','2007-08-11 10:21:49'), - (51,'Wayne','whudson1e@princeton.edu','90.61.24.102','1983-07-03 16:58:12'), - (52,'Rose','rjames1f@plala.or.jp','240.83.81.10','1995-06-08 11:46:23'), - (53,'Louise','lcox1g@theglobeandmail.com','105.11.82.145','2016-09-19 14:45:51'), - (54,'Kenneth','kjohnson1h@independent.co.uk','139.5.45.94','1976-08-17 11:26:19'), - (55,'Donna','dbrown1i@amazon.co.uk','19.45.169.45','2006-05-27 16:51:40'), - (56,'Johnny','jvasquez1j@trellian.com','118.202.238.23','1975-11-17 08:42:32'), - (57,'Patrick','pramirez1k@tamu.edu','231.25.153.198','1997-08-06 11:51:09'), - (58,'Helen','hlarson1l@prweb.com','8.40.21.39','1993-08-04 19:53:40'), - (59,'Patricia','pspencer1m@gmpg.org','212.198.40.15','1977-08-03 16:37:27'), - (60,'Joseph','jspencer1n@marriott.com','13.15.63.238','2005-07-23 20:22:06'), - (61,'Phillip','pschmidt1o@blogtalkradio.com','177.98.201.190','1976-05-19 21:47:44'), - (62,'Joan','jwebb1p@google.ru','105.229.170.71','1972-09-07 17:53:47'), - (63,'Phyllis','pkennedy1q@imgur.com','35.145.8.244','2000-01-01 22:33:37'), - (64,'Katherine','khunter1r@smh.com.au','248.168.205.32','1991-01-09 06:40:24'), - (65,'Laura','lvasquez1s@wiley.com','128.129.115.152','1997-10-23 12:04:56'), - (66,'Juan','jdunn1t@state.gov','44.228.124.51','2004-11-10 05:07:35'), - (67,'Judith','jholmes1u@wiley.com','40.227.179.115','1977-08-02 17:01:45'), - (68,'Beverly','bbaker1v@wufoo.com','208.34.84.59','2016-03-06 20:07:23'), - (69,'Lawrence','lcarr1w@flickr.com','59.158.212.223','1988-09-13 06:07:21'), - (70,'Gloria','gwilliams1x@mtv.com','245.231.88.33','1995-03-18 22:32:46'), - (71,'Steven','ssims1y@cbslocal.com','104.50.58.255','2001-08-05 21:26:20'), - (72,'Betty','bmills1z@arstechnica.com','103.177.214.220','1981-12-14 21:26:54'), - (73,'Mildred','mfuller20@prnewswire.com','151.158.8.130','2000-04-19 10:13:55'), - (74,'Donald','dday21@icq.com','9.178.102.255','1972-12-03 00:58:24'), - (75,'Eric','ethomas22@addtoany.com','85.2.241.227','1992-11-01 05:59:30'), - (76,'Joyce','jarmstrong23@sitemeter.com','169.224.20.36','1985-10-24 06:50:01'), - (77,'Maria','mmartinez24@amazonaws.com','143.189.167.135','2005-10-05 05:17:42'), - (78,'Harry','hburton25@youtube.com','156.47.176.237','1978-03-26 05:53:33'), - (79,'Kevin','klawrence26@hao123.com','79.136.183.83','1994-10-12 04:38:52'), - (80,'David','dhall27@prweb.com','133.149.172.153','1976-12-15 16:24:24'), - (81,'Kathy','kperry28@twitter.com','229.242.72.228','1979-03-04 02:58:56'), - (82,'Adam','aprice29@elegantthemes.com','13.145.21.10','1982-11-07 11:46:59'), - (83,'Brandon','bgriffin2a@va.gov','73.249.128.212','2013-10-30 05:30:36'), - (84,'Henry','hnguyen2b@discovery.com','211.36.214.242','1985-01-09 06:37:27'), - (85,'Eric','esanchez2c@edublogs.org','191.166.188.251','2004-05-01 23:21:42'), - (86,'Jason','jlee2d@jimdo.com','193.92.16.182','1973-01-08 09:05:39'), - (87,'Diana','drichards2e@istockphoto.com','19.130.175.245','1994-10-05 22:50:49'), - (88,'Andrea','awelch2f@abc.net.au','94.155.233.96','2002-04-26 08:41:44'), - (89,'Louis','lwagner2g@miitbeian.gov.cn','26.217.34.111','2003-08-25 07:56:39'), - (90,'Jane','jsims2h@seesaa.net','43.4.220.135','1987-03-20 20:39:04'), - (91,'Larry','lgrant2i@si.edu','97.126.79.34','2000-09-07 20:26:19'), - (92,'Louis','ldean2j@prnewswire.com','37.148.40.127','2011-09-16 20:12:14'), - (93,'Jennifer','jcampbell2k@xing.com','38.106.254.142','1988-07-15 05:06:49'), - (94,'Wayne','wcunningham2l@google.com.hk','223.28.26.187','2009-12-15 06:16:54'), - (95,'Lori','lstevens2m@icq.com','181.250.181.58','1984-10-28 03:29:19'), - (96,'Judy','jsimpson2n@marriott.com','180.121.239.219','1986-02-07 15:18:10'), - (97,'Phillip','phoward2o@usa.gov','255.247.0.175','2002-12-26 08:44:45'), - (98,'Gloria','gwalker2p@usa.gov','156.140.7.128','1997-10-04 07:58:58'), - (99,'Paul','pjohnson2q@umn.edu','183.59.198.197','1991-11-14 12:33:55'), - (100,'Frank','fgreene2r@blogspot.com','150.143.68.121','2010-06-12 23:55:39'), - (101,'Deborah','dknight2s@reverbnation.com','222.131.211.191','1970-07-08 08:54:23'), - (102,'Sandra','sblack2t@tripadvisor.com','254.183.128.254','2000-04-12 02:39:36'), - (103,'Edward','eburns2u@dailymotion.com','253.89.118.18','1993-10-10 10:54:01'), - (104,'Anthony','ayoung2v@ustream.tv','118.4.193.176','1978-08-26 17:07:29'), - (105,'Donald','dlawrence2w@wp.com','139.200.159.227','2007-07-21 20:56:20'), - (106,'Matthew','mfreeman2x@google.fr','205.26.239.92','2014-12-05 17:05:39'), - (107,'Sean','ssanders2y@trellian.com','143.89.82.108','1993-07-14 21:45:02'), - (108,'Sharon','srobinson2z@soundcloud.com','66.234.247.54','1977-04-06 19:07:03'), - (109,'Jennifer','jwatson30@t-online.de','196.102.127.7','1998-03-07 05:12:23'), - (110,'Clarence','cbrooks31@si.edu','218.93.234.73','2002-11-06 17:22:25'), - (111,'Jose','jflores32@goo.gl','185.105.244.231','1995-01-05 06:32:21'), - (112,'George','glee33@adobe.com','173.82.249.196','2015-01-04 02:47:46'), - (113,'Larry','lhill34@linkedin.com','66.5.206.195','2010-11-02 10:21:17'), - (114,'Marie','mmeyer35@mysql.com','151.152.88.107','1990-05-22 20:52:51'), - (115,'Clarence','cwebb36@skype.com','130.198.55.217','1972-10-27 07:38:54'), - (116,'Sarah','scarter37@answers.com','80.89.18.153','1971-08-24 19:29:30'), - (117,'Henry','hhughes38@webeden.co.uk','152.60.114.174','1973-01-27 09:00:42'), - (118,'Teresa','thenry39@hao123.com','32.187.239.106','2015-11-06 01:48:44'), - (119,'Billy','bgutierrez3a@sun.com','52.37.70.134','2002-03-19 03:20:19'), - (120,'Anthony','agibson3b@github.io','154.251.232.213','1991-04-19 01:08:15'), - (121,'Sandra','sromero3c@wikia.com','44.124.171.2','1998-09-06 20:30:34'), - (122,'Paula','pandrews3d@blogs.com','153.142.118.226','2003-06-24 16:31:24'), - (123,'Terry','tbaker3e@csmonitor.com','99.120.45.219','1970-12-09 23:57:21'), - (124,'Lois','lwilson3f@reuters.com','147.44.171.83','1971-01-09 22:28:51'), - (125,'Sara','smorgan3g@nature.com','197.67.192.230','1992-01-28 20:33:24'), - (126,'Charles','ctorres3h@china.com.cn','156.115.216.2','1993-10-02 19:36:34'), - (127,'Richard','ralexander3i@marriott.com','248.235.180.59','1999-02-03 18:40:55'), - (128,'Christina','charper3j@cocolog-nifty.com','152.114.116.129','1978-09-13 00:37:32'), - (129,'Steve','sadams3k@economist.com','112.248.91.98','2004-03-21 09:07:43'), - (130,'Katherine','krobertson3l@ow.ly','37.220.107.28','1977-03-18 19:28:50'), - (131,'Donna','dgibson3m@state.gov','222.218.76.221','1999-02-01 06:46:16'), - (132,'Christina','cwest3n@mlb.com','152.114.6.160','1979-12-24 15:30:35'), - (133,'Sandra','swillis3o@meetup.com','180.71.49.34','1984-09-27 08:05:54'), - (134,'Clarence','cedwards3p@smugmug.com','10.64.180.186','1979-04-16 16:52:10'), - (135,'Ruby','rjames3q@wp.com','98.61.54.20','2007-01-13 14:25:52'), - (136,'Sarah','smontgomery3r@tripod.com','91.45.164.172','2009-07-25 04:34:30'), - (137,'Sarah','soliver3s@eventbrite.com','30.106.39.146','2012-05-09 22:12:33'), - (138,'Deborah','dwheeler3t@biblegateway.com','59.105.213.173','1999-11-09 08:08:44'), - (139,'Deborah','dray3u@i2i.jp','11.108.186.217','2014-02-04 03:15:19'), - (140,'Paul','parmstrong3v@alexa.com','6.250.59.43','2009-12-21 10:08:53'), - (141,'Aaron','abishop3w@opera.com','207.145.249.62','1996-04-25 23:20:23'), - (142,'Henry','hsanders3x@google.ru','140.215.203.171','2012-01-29 11:52:32'), - (143,'Anne','aanderson3y@1688.com','74.150.102.118','1982-04-03 13:46:17'), - (144,'Victor','vmurphy3z@hugedomains.com','222.155.99.152','1987-11-03 19:58:41'), - (145,'Evelyn','ereid40@pbs.org','249.122.33.117','1977-12-14 17:09:57'), - (146,'Brian','bgonzalez41@wikia.com','246.254.235.141','1991-02-24 00:45:58'), - (147,'Sandra','sgray42@squarespace.com','150.73.28.159','1972-07-28 17:26:32'), - (148,'Alice','ajones43@a8.net','78.253.12.177','2002-12-05 16:57:46'), - (149,'Jessica','jhanson44@mapquest.com','87.229.30.160','1994-01-30 11:40:04'), - (150,'Louise','lbailey45@reuters.com','191.219.31.101','2011-09-07 21:11:45'), - (151,'Christopher','cgonzalez46@printfriendly.com','83.137.213.239','1984-10-24 14:58:04'), - (152,'Gregory','gcollins47@yandex.ru','28.176.10.115','1998-07-25 17:17:10'), - (153,'Jane','jperkins48@usnews.com','46.53.164.159','1979-08-19 15:25:00'), - (154,'Phyllis','plong49@yahoo.co.jp','208.140.88.2','1985-07-06 02:16:36'), - (155,'Adam','acarter4a@scribd.com','78.48.148.204','2005-07-20 03:31:09'), - (156,'Frank','fweaver4b@angelfire.com','199.180.255.224','2011-03-04 23:07:54'), - (157,'Ronald','rmurphy4c@cloudflare.com','73.42.97.231','1991-01-11 10:39:41'), - (158,'Richard','rmorris4d@e-recht24.de','91.9.97.223','2009-01-17 21:05:15'), - (159,'Rose','rfoster4e@woothemes.com','203.169.53.16','1991-04-21 02:09:38'), - (160,'George','ggarrett4f@uiuc.edu','186.61.5.167','1989-11-11 11:29:42'), - (161,'Victor','vhamilton4g@biblegateway.com','121.229.138.38','2012-06-22 18:01:23'), - (162,'Mark','mbennett4h@businessinsider.com','209.184.29.203','1980-04-16 15:26:34'), - (163,'Martin','mwells4i@ifeng.com','97.223.55.105','2010-05-26 14:08:18'), - (164,'Diana','dstone4j@google.ru','90.155.52.47','2013-02-11 00:14:54'), - (165,'Walter','wferguson4k@blogger.com','30.63.212.44','1986-02-20 17:46:46'), - (166,'Denise','dcoleman4l@vistaprint.com','10.209.153.77','1992-05-13 20:14:14'), - (167,'Philip','pknight4m@xing.com','15.28.135.167','2000-09-11 18:41:13'), - (168,'Russell','rcarr4n@youtube.com','113.55.165.50','2008-07-10 17:49:27'), - (169,'Donna','dburke4o@dion.ne.jp','70.0.105.111','1992-02-10 17:24:58'), - (170,'Anne','along4p@squidoo.com','36.154.58.107','2012-08-19 23:35:31'), - (171,'Clarence','cbanks4q@webeden.co.uk','94.57.53.114','1972-03-11 21:46:44'), - (172,'Betty','bbowman4r@cyberchimps.com','178.115.209.69','2013-01-13 21:34:51'), - (173,'Andrew','ahudson4s@nytimes.com','84.32.252.144','1998-09-15 14:20:04'), - (174,'Keith','kgordon4t@cam.ac.uk','189.237.211.102','2009-01-22 05:34:38'), - (175,'Patrick','pwheeler4u@mysql.com','47.22.117.226','1984-09-05 22:33:15'), - (176,'Jesse','jfoster4v@mapquest.com','229.95.131.46','1990-01-20 12:19:15'), - (177,'Arthur','afisher4w@jugem.jp','107.255.244.98','1983-10-13 11:08:46'), - (178,'Nicole','nryan4x@wsj.com','243.211.33.221','1974-05-30 23:19:14'), - (179,'Bruce','bjohnson4y@sfgate.com','17.41.200.101','1992-09-23 02:02:19'), - (180,'Terry','tcox4z@reference.com','20.189.120.106','1982-02-13 12:43:14'), - (181,'Ashley','astanley50@kickstarter.com','86.3.56.98','1976-05-09 01:27:16'), - (182,'Michael','mrivera51@about.me','72.118.249.0','1971-11-11 17:28:37'), - (183,'Steven','sgonzalez52@mozilla.org','169.112.247.47','2002-08-24 14:59:25'), - (184,'Kathleen','kfuller53@bloglovin.com','80.93.59.30','2002-03-11 13:41:29'), - (185,'Nicole','nhenderson54@usda.gov','39.253.60.30','1995-04-24 05:55:07'), - (186,'Ralph','rharper55@purevolume.com','167.147.142.189','1980-02-10 18:35:45'), - (187,'Heather','hcunningham56@photobucket.com','96.222.196.229','2007-06-15 05:37:50'), - (188,'Nancy','nlittle57@cbc.ca','241.53.255.175','2007-07-12 23:42:48'), - (189,'Juan','jramirez58@pinterest.com','190.128.84.27','1978-11-07 23:37:37'), - (190,'Beverly','bfowler59@chronoengine.com','54.144.230.49','1979-03-31 23:27:28'), - (191,'Shirley','sstevens5a@prlog.org','200.97.231.248','2011-12-06 07:08:50'), - (192,'Annie','areyes5b@squidoo.com','223.32.182.101','2011-05-28 02:42:09'), - (193,'Jack','jkelley5c@tiny.cc','47.34.118.150','1981-12-05 17:31:40'), - (194,'Keith','krobinson5d@1und1.de','170.210.209.31','1999-03-09 11:05:43'), - (195,'Joseph','jmiller5e@google.com.au','136.74.212.139','1984-10-08 13:18:20'), - (196,'Annie','aday5f@blogspot.com','71.99.186.69','1986-02-18 12:27:34'), - (197,'Nancy','nperez5g@liveinternet.ru','28.160.6.107','1983-10-20 17:51:20'), - (198,'Tammy','tward5h@ucoz.ru','141.43.164.70','1980-03-31 04:45:29'), - (199,'Doris','dryan5i@ted.com','239.117.202.188','1985-07-03 03:17:53'), - (200,'Rose','rmendoza5j@photobucket.com','150.200.206.79','1973-04-21 21:36:40'), - (201,'Cynthia','cbutler5k@hubpages.com','80.153.174.161','2001-01-20 01:42:26'), - (202,'Samuel','soliver5l@people.com.cn','86.127.246.140','1970-09-02 02:19:00'), - (203,'Carl','csanchez5m@mysql.com','50.149.237.107','1993-12-01 07:02:09'), - (204,'Kathryn','kowens5n@geocities.jp','145.166.205.201','2004-07-06 18:39:33'), - (205,'Nicholas','nnichols5o@parallels.com','190.240.66.170','2014-11-11 18:52:19'), - (206,'Keith','kwillis5p@youtube.com','181.43.206.100','1998-06-13 06:30:51'), - (207,'Justin','jwebb5q@intel.com','211.54.245.74','2000-11-04 16:58:26'), - (208,'Gary','ghicks5r@wikipedia.org','196.154.213.104','1992-12-01 19:48:28'), - (209,'Martin','mpowell5s@flickr.com','153.67.12.241','1983-06-30 06:24:32'), - (210,'Brenda','bkelley5t@xinhuanet.com','113.100.5.172','2005-01-08 20:50:22'), - (211,'Edward','eray5u@a8.net','205.187.246.65','2011-09-26 08:04:44'), - (212,'Steven','slawson5v@senate.gov','238.150.250.36','1978-11-22 02:48:09'), - (213,'Robert','rthompson5w@furl.net','70.7.89.236','2001-09-12 08:52:07'), - (214,'Jack','jporter5x@diigo.com','220.172.29.99','1976-07-26 14:29:21'), - (215,'Lisa','ljenkins5y@oakley.com','150.151.170.180','2010-03-20 19:21:16'), - (216,'Theresa','tbell5z@mayoclinic.com','247.25.53.173','2001-03-11 05:36:40'), - (217,'Jimmy','jstephens60@weather.com','145.101.93.235','1983-04-12 09:35:30'), - (218,'Louis','lhunt61@amazon.co.jp','78.137.6.253','1997-08-29 19:34:34'), - (219,'Lawrence','lgilbert62@ted.com','243.132.8.78','2015-04-08 22:06:56'), - (220,'David','dgardner63@4shared.com','204.40.46.136','1971-07-09 03:29:11'), - (221,'Charles','ckennedy64@gmpg.org','211.83.233.2','2011-02-26 11:55:04'), - (222,'Lillian','lbanks65@msu.edu','124.233.12.80','2010-05-16 20:29:02'), - (223,'Ernest','enguyen66@baidu.com','82.45.128.148','1996-07-04 10:07:04'), - (224,'Ryan','rrussell67@cloudflare.com','202.53.240.223','1983-08-05 12:36:29'), - (225,'Donald','ddavis68@ustream.tv','47.39.218.137','1989-05-27 02:30:56'), - (226,'Joe','jscott69@blogspot.com','140.23.131.75','1973-03-16 12:21:31'), - (227,'Anne','amarshall6a@google.ca','113.162.200.197','1988-12-09 03:38:29'), - (228,'Willie','wturner6b@constantcontact.com','85.83.182.249','1991-10-06 01:51:10'), - (229,'Nicole','nwilson6c@sogou.com','30.223.51.135','1977-05-29 19:54:56'), - (230,'Janet','jwheeler6d@stumbleupon.com','153.194.27.144','2011-03-13 12:48:47'), - (231,'Lois','lcarr6e@statcounter.com','0.41.36.53','1993-02-06 04:52:01'), - (232,'Shirley','scruz6f@tmall.com','37.156.39.223','2007-02-18 17:47:01'), - (233,'Patrick','pford6g@reverbnation.com','36.198.200.89','1977-03-06 15:47:24'), - (234,'Lisa','lhudson6h@usatoday.com','134.213.58.137','2014-10-28 01:56:56'), - (235,'Pamela','pmartinez6i@opensource.org','5.151.127.202','1987-11-30 16:44:47'), - (236,'Larry','lperez6j@infoseek.co.jp','235.122.96.148','1979-01-18 06:33:45'), - (237,'Pamela','pramirez6k@census.gov','138.233.34.163','2012-01-29 10:35:20'), - (238,'Daniel','dcarr6l@php.net','146.21.152.242','1984-11-17 08:22:59'), - (239,'Patrick','psmith6m@indiegogo.com','136.222.199.36','2001-05-30 22:16:44'), - (240,'Raymond','rhenderson6n@hc360.com','116.31.112.38','2000-01-05 20:35:41'), - (241,'Teresa','treynolds6o@miitbeian.gov.cn','198.126.205.220','1996-11-08 01:27:31'), - (242,'Johnny','jmason6p@flickr.com','192.8.232.114','2013-05-14 05:35:50'), - (243,'Angela','akelly6q@guardian.co.uk','234.116.60.197','1977-08-20 02:05:17'), - (244,'Douglas','dcole6r@cmu.edu','128.135.212.69','2016-10-26 17:40:36'), - (245,'Frances','fcampbell6s@twitpic.com','94.22.243.235','1987-04-26 07:07:13'), - (246,'Donna','dgreen6t@chron.com','227.116.46.107','2011-07-25 12:59:54'), - (247,'Benjamin','bfranklin6u@redcross.org','89.141.142.89','1974-05-03 20:28:18'), - (248,'Randy','rpalmer6v@rambler.ru','70.173.63.178','2011-12-20 17:40:18'), - (249,'Melissa','mmurray6w@bbb.org','114.234.118.137','1991-02-26 12:45:44'), - (250,'Jean','jlittle6x@epa.gov','141.21.163.254','1991-08-16 04:57:09'), - (251,'Daniel','dolson6y@nature.com','125.75.104.97','2010-04-23 06:25:54'), - (252,'Kathryn','kwells6z@eventbrite.com','225.104.28.249','2015-01-31 02:21:50'), - (253,'Theresa','tgonzalez70@ox.ac.uk','91.93.156.26','1971-12-11 10:31:31'), - (254,'Beverly','broberts71@bluehost.com','244.40.158.89','2013-09-21 13:02:31'), - (255,'Pamela','pmurray72@netscape.com','218.54.95.216','1985-04-16 00:34:00'), - (256,'Timothy','trichardson73@amazonaws.com','235.49.24.229','2000-11-11 09:48:28'), - (257,'Mildred','mpalmer74@is.gd','234.125.95.132','1992-05-25 02:25:02'), - (258,'Jessica','jcampbell75@google.it','55.98.30.140','2014-08-26 00:26:34'), - (259,'Beverly','bthomas76@cpanel.net','48.78.228.176','1970-08-18 10:40:05'), - (260,'Eugene','eward77@cargocollective.com','139.226.204.2','1996-12-04 23:17:00'), - (261,'Andrea','aallen78@webnode.com','160.31.214.38','2009-07-06 07:22:37'), - (262,'Justin','jruiz79@merriam-webster.com','150.149.246.122','2005-06-06 11:44:19'), - (263,'Kenneth','kedwards7a@networksolutions.com','98.82.193.128','2001-07-03 02:00:10'), - (264,'Rachel','rday7b@miibeian.gov.cn','114.15.247.221','1994-08-18 19:45:40'), - (265,'Russell','rmiller7c@instagram.com','184.130.152.253','1977-11-06 01:58:12'), - (266,'Bonnie','bhudson7d@cornell.edu','235.180.186.206','1990-12-03 22:45:24'), - (267,'Raymond','rknight7e@yandex.ru','161.2.44.252','1995-08-25 04:31:19'), - (268,'Bonnie','brussell7f@elpais.com','199.237.57.207','1991-03-29 08:32:06'), - (269,'Marie','mhenderson7g@elpais.com','52.203.131.144','2004-06-04 21:50:28'), - (270,'Alan','acarr7h@trellian.com','147.51.205.72','2005-03-03 10:51:31'), - (271,'Barbara','bturner7i@hugedomains.com','103.160.110.226','2004-08-04 13:42:40'), - (272,'Christina','cdaniels7j@census.gov','0.238.61.251','1972-10-18 12:47:33'), - (273,'Jeremy','jgomez7k@reuters.com','111.26.65.56','2013-01-13 10:41:35'), - (274,'Laura','lwood7l@icio.us','149.153.38.205','2011-06-25 09:33:59'), - (275,'Matthew','mbowman7m@auda.org.au','182.138.206.172','1999-03-05 03:25:36'), - (276,'Denise','dparker7n@icq.com','0.213.88.138','2011-11-04 09:43:06'), - (277,'Phillip','pparker7o@discuz.net','219.242.165.240','1973-10-19 04:22:29'), - (278,'Joan','jpierce7p@salon.com','63.31.213.202','1989-04-09 22:06:24'), - (279,'Irene','ibaker7q@cbc.ca','102.33.235.114','1992-09-04 13:00:57'), - (280,'Betty','bbowman7r@ted.com','170.91.249.242','2015-09-28 08:14:22'), - (281,'Teresa','truiz7s@boston.com','82.108.158.207','1999-07-18 05:17:09'), - (282,'Helen','hbrooks7t@slideshare.net','102.87.162.187','2003-01-06 15:45:29'), - (283,'Karen','kgriffin7u@wunderground.com','43.82.44.184','2010-05-28 01:56:37'), - (284,'Lisa','lfernandez7v@mtv.com','200.238.218.220','1993-04-03 20:33:51'), - (285,'Jesse','jlawrence7w@timesonline.co.uk','95.122.105.78','1990-01-05 17:28:43'), - (286,'Terry','tross7x@macromedia.com','29.112.114.133','2009-08-29 21:32:17'), - (287,'Angela','abradley7y@icq.com','177.44.27.72','1989-10-04 21:46:06'), - (288,'Maria','mhart7z@dailymotion.com','55.27.55.202','1975-01-21 01:22:57'), - (289,'Raymond','randrews80@pinterest.com','88.90.78.67','1992-03-16 21:37:40'), - (290,'Kathy','krice81@bluehost.com','212.63.196.102','2000-12-14 03:06:44'), - (291,'Cynthia','cramos82@nymag.com','107.89.190.6','2005-06-28 02:02:33'), - (292,'Kimberly','kjones83@mysql.com','86.169.101.101','2007-06-13 22:56:49'), - (293,'Timothy','thansen84@microsoft.com','108.100.254.90','2003-04-04 10:31:57'), - (294,'Carol','cspencer85@berkeley.edu','75.118.144.187','1999-03-30 14:53:21'), - (295,'Louis','lmedina86@latimes.com','141.147.163.24','1991-04-11 17:53:13'), - (296,'Margaret','mcole87@google.fr','53.184.26.83','1991-12-19 01:54:10'), - (297,'Mary','mgomez88@yellowpages.com','208.56.57.99','1976-05-21 18:05:08'), - (298,'Amanda','aanderson89@geocities.com','147.73.15.252','1987-08-22 15:05:28'), - (299,'Kathryn','kgarrett8a@nature.com','27.29.177.220','1976-07-15 04:25:04'), - (300,'Dorothy','dmason8b@shareasale.com','106.210.99.193','1990-09-03 21:39:31'), - (301,'Lois','lkennedy8c@amazon.de','194.169.29.187','2007-07-29 14:09:31'), - (302,'Irene','iburton8d@washingtonpost.com','196.143.110.249','2013-09-05 11:32:46'), - (303,'Betty','belliott8e@wired.com','183.105.222.199','1979-09-19 19:29:13'), - (304,'Bobby','bmeyer8f@census.gov','36.13.161.145','2014-05-24 14:34:39'), - (305,'Ann','amorrison8g@sfgate.com','72.154.54.137','1978-10-05 14:22:34'), - (306,'Daniel','djackson8h@wunderground.com','144.95.32.34','1990-07-27 13:23:05'), - (307,'Joe','jboyd8i@alibaba.com','187.105.86.178','2011-09-28 16:46:32'), - (308,'Ralph','rdunn8j@fc2.com','3.19.87.255','1984-10-18 08:00:40'), - (309,'Craig','ccarter8k@gizmodo.com','235.152.76.215','1998-07-04 12:15:21'), - (310,'Paula','pdean8l@hhs.gov','161.100.173.197','1973-02-13 09:38:55'), - (311,'Andrew','agarrett8m@behance.net','199.253.123.218','1991-02-14 13:36:32'), - (312,'Janet','jhowell8n@alexa.com','39.189.139.79','2012-11-24 20:17:33'), - (313,'Keith','khansen8o@godaddy.com','116.186.223.196','1987-08-23 21:22:05'), - (314,'Nicholas','nedwards8p@state.gov','142.175.142.11','1977-03-28 18:27:27'), - (315,'Jacqueline','jallen8q@oaic.gov.au','189.66.135.192','1994-10-26 11:44:26'), - (316,'Frank','fgardner8r@mapy.cz','154.77.119.169','1983-01-29 19:19:51'), - (317,'Eric','eharrison8s@google.cn','245.139.65.123','1984-02-04 09:54:36'), - (318,'Gregory','gcooper8t@go.com','171.147.0.221','2004-06-14 05:22:08'), - (319,'Jean','jfreeman8u@rakuten.co.jp','67.243.121.5','1977-01-07 18:23:43'), - (320,'Juan','jlewis8v@shinystat.com','216.181.171.189','2001-08-23 17:32:43'), - (321,'Randy','rwilliams8w@shinystat.com','105.152.146.28','1983-02-17 00:05:50'), - (322,'Stephen','shart8x@sciencedirect.com','196.131.205.148','2004-02-15 10:12:03'), - (323,'Annie','ahunter8y@example.com','63.36.34.103','2003-07-23 21:15:25'), - (324,'Melissa','mflores8z@cbc.ca','151.230.217.90','1983-11-02 14:53:56'), - (325,'Jane','jweaver90@about.me','0.167.235.217','1987-07-29 00:13:44'), - (326,'Anthony','asmith91@oracle.com','97.87.48.41','2001-05-31 18:44:11'), - (327,'Terry','tdavis92@buzzfeed.com','46.20.12.51','2015-09-12 23:13:55'), - (328,'Brandon','bmontgomery93@gravatar.com','252.101.48.186','2010-10-28 08:26:27'), - (329,'Chris','cmurray94@bluehost.com','25.158.167.97','2004-05-05 16:10:31'), - (330,'Denise','dfuller95@hugedomains.com','216.210.149.28','1979-04-20 08:57:24'), - (331,'Arthur','amcdonald96@sakura.ne.jp','206.42.36.213','2009-08-15 03:26:16'), - (332,'Jesse','jhoward97@google.cn','46.181.118.30','1974-04-18 14:08:41'), - (333,'Frank','fsimpson98@domainmarket.com','163.220.211.87','2006-06-30 14:46:52'), - (334,'Janice','jwoods99@pen.io','229.245.237.182','1988-04-06 11:52:58'), - (335,'Rebecca','rroberts9a@huffingtonpost.com','148.96.15.80','1976-10-05 08:44:16'), - (336,'Joshua','jray9b@opensource.org','192.253.12.198','1971-12-25 22:27:07'), - (337,'Joyce','jcarpenter9c@statcounter.com','125.171.46.215','2001-12-31 22:08:13'), - (338,'Andrea','awest9d@privacy.gov.au','79.101.180.201','1983-02-18 20:07:47'), - (339,'Christine','chudson9e@yelp.com','64.198.43.56','1997-09-08 08:03:43'), - (340,'Joe','jparker9f@earthlink.net','251.215.148.153','1973-11-04 05:08:18'), - (341,'Thomas','tkim9g@answers.com','49.187.34.47','1991-08-07 21:13:48'), - (342,'Janice','jdean9h@scientificamerican.com','4.197.117.16','2009-12-08 02:35:49'), - (343,'James','jmitchell9i@umich.edu','43.121.18.147','2011-04-28 17:04:09'), - (344,'Charles','cgardner9j@purevolume.com','197.78.240.240','1998-02-11 06:47:07'), - (345,'Robert','rhenderson9k@friendfeed.com','215.84.180.88','2002-05-10 15:33:14'), - (346,'Chris','cgray9l@4shared.com','249.70.192.240','1998-10-03 16:43:42'), - (347,'Gloria','ghayes9m@hibu.com','81.103.138.26','1999-12-26 11:23:13'), - (348,'Edward','eramirez9n@shareasale.com','38.136.90.136','2010-08-19 08:01:06'), - (349,'Cheryl','cbutler9o@google.ca','172.180.78.172','1995-05-27 20:03:52'), - (350,'Margaret','mwatkins9p@sfgate.com','3.20.198.6','2014-10-21 01:42:58'), - (351,'Rebecca','rwelch9q@examiner.com','45.81.42.208','2001-02-08 12:19:06'), - (352,'Joe','jpalmer9r@phpbb.com','163.202.92.190','1970-01-05 11:29:12'), - (353,'Sandra','slewis9s@dyndns.org','77.215.201.236','1974-01-05 07:04:04'), - (354,'Todd','tfranklin9t@g.co','167.125.181.82','2009-09-28 10:13:58'), - (355,'Joseph','jlewis9u@webmd.com','244.204.6.11','1990-10-21 15:49:57'), - (356,'Alan','aknight9v@nydailynews.com','152.197.95.83','1996-03-08 08:43:17'), - (357,'Sharon','sdean9w@123-reg.co.uk','237.46.40.26','1985-11-30 12:09:24'), - (358,'Annie','awright9x@cafepress.com','190.45.231.111','2000-08-24 11:56:06'), - (359,'Diane','dhamilton9y@youtube.com','85.146.171.196','2015-02-24 02:03:57'), - (360,'Antonio','alane9z@auda.org.au','61.63.146.203','2001-05-13 03:43:34'), - (361,'Matthew','mallena0@hhs.gov','29.97.32.19','1973-02-19 23:43:32'), - (362,'Bonnie','bfowlera1@soup.io','251.216.99.53','2013-08-01 15:35:41'), - (363,'Margaret','mgraya2@examiner.com','69.255.151.79','1998-01-23 22:24:59'), - (364,'Joan','jwagnera3@printfriendly.com','192.166.120.61','1973-07-13 00:30:22'), - (365,'Catherine','cperkinsa4@nytimes.com','58.21.24.214','2006-11-19 11:52:26'), - (366,'Mark','mcartera5@cpanel.net','220.33.102.142','2007-09-09 09:43:27'), - (367,'Paula','ppricea6@msn.com','36.182.238.124','2009-11-11 09:13:05'), - (368,'Catherine','cgreena7@army.mil','228.203.58.19','2005-08-09 16:52:15'), - (369,'Helen','hhamiltona8@symantec.com','155.56.194.99','2005-02-01 05:40:36'), - (370,'Jane','jmeyera9@ezinearticles.com','133.244.113.213','2013-11-06 22:10:23'), - (371,'Wanda','wevansaa@bloglovin.com','233.125.192.48','1994-12-26 23:43:42'), - (372,'Mark','mmarshallab@tumblr.com','114.74.60.47','2016-09-29 18:03:01'), - (373,'Andrew','amartinezac@google.cn','182.54.37.130','1976-06-06 17:04:17'), - (374,'Helen','hmoralesad@e-recht24.de','42.45.4.123','1977-03-28 19:06:59'), - (375,'Bonnie','bstoneae@php.net','196.149.79.137','1970-02-05 17:05:58'), - (376,'Douglas','dfreemanaf@nasa.gov','215.65.124.218','2008-11-20 21:51:55'), - (377,'Willie','wwestag@army.mil','35.189.92.118','1992-07-24 05:08:08'), - (378,'Cheryl','cwagnerah@upenn.edu','228.239.222.141','2010-01-25 06:29:01'), - (379,'Sandra','swardai@baidu.com','63.11.113.240','1985-05-23 08:07:37'), - (380,'Julie','jrobinsonaj@jugem.jp','110.58.202.50','2015-03-05 09:42:07'), - (381,'Larry','lwagnerak@shop-pro.jp','98.234.25.24','1975-07-22 22:22:02'), - (382,'Juan','jcastilloal@yelp.com','24.174.74.202','2007-01-17 09:32:43'), - (383,'Donna','dfrazieram@artisteer.com','205.26.147.45','1990-02-11 20:55:46'), - (384,'Rachel','rfloresan@w3.org','109.60.216.162','1983-05-22 22:42:18'), - (385,'Robert','rreynoldsao@theguardian.com','122.65.209.130','2009-05-01 18:02:51'), - (386,'Donald','dbradleyap@etsy.com','42.54.35.126','1997-01-16 16:31:52'), - (387,'Rachel','rfisheraq@nih.gov','160.243.250.45','2006-02-17 22:05:49'), - (388,'Nicholas','nhamiltonar@princeton.edu','156.211.37.111','1976-06-21 03:36:29'), - (389,'Timothy','twhiteas@ca.gov','36.128.23.70','1975-09-24 03:51:18'), - (390,'Diana','dbradleyat@odnoklassniki.ru','44.102.120.184','1983-04-27 09:02:50'), - (391,'Billy','bfowlerau@jimdo.com','91.200.68.196','1995-01-29 06:57:35'), - (392,'Bruce','bandrewsav@ucoz.com','48.12.101.125','1992-10-27 04:31:39'), - (393,'Linda','lromeroaw@usa.gov','100.71.233.19','1992-06-08 15:13:18'), - (394,'Debra','dwatkinsax@ucoz.ru','52.160.233.193','2001-11-11 06:51:01'), - (395,'Katherine','kburkeay@wix.com','151.156.242.141','2010-06-14 19:54:28'), - (396,'Martha','mharrisonaz@youku.com','21.222.10.199','1989-10-16 14:17:55'), - (397,'Dennis','dwellsb0@youtu.be','103.16.29.3','1985-12-21 06:05:51'), - (398,'Gloria','grichardsb1@bloglines.com','90.147.120.234','1982-08-27 01:04:43'), - (399,'Brenda','bfullerb2@t.co','33.253.63.90','2011-04-20 05:00:35'), - (400,'Larry','lhendersonb3@disqus.com','88.95.132.128','1982-08-31 02:15:12'), - (401,'Richard','rlarsonb4@wisc.edu','13.48.231.150','1979-04-15 14:08:09'), - (402,'Terry','thuntb5@usa.gov','65.91.103.240','1998-05-15 11:50:49'), - (403,'Harry','hburnsb6@nasa.gov','33.38.21.244','1981-04-12 14:02:20'), - (404,'Diana','dellisb7@mlb.com','218.229.81.135','1997-01-29 00:17:25'), - (405,'Jack','jburkeb8@tripadvisor.com','210.227.182.216','1984-03-09 17:24:03'), - (406,'Julia','jlongb9@fotki.com','10.210.12.104','2005-10-26 03:54:13'), - (407,'Lois','lscottba@msu.edu','188.79.136.138','1973-02-02 18:40:39'), - (408,'Sandra','shendersonbb@shareasale.com','114.171.220.108','2012-06-09 18:22:26'), - (409,'Irene','isanchezbc@cdbaby.com','109.255.50.119','1983-09-28 21:11:27'), - (410,'Emily','ebrooksbd@bandcamp.com','227.81.93.79','1970-08-31 21:08:01'), - (411,'Michelle','mdiazbe@businessweek.com','236.249.6.226','1993-05-22 08:07:07'), - (412,'Tammy','tbennettbf@wisc.edu','145.253.239.152','1978-12-31 20:24:51'), - (413,'Christine','cgreenebg@flickr.com','97.25.140.118','1978-07-17 12:55:30'), - (414,'Patricia','pgarzabh@tuttocitta.it','139.246.192.211','1984-02-27 13:40:08'), - (415,'Kimberly','kromerobi@aol.com','73.56.88.247','1976-09-16 14:22:04'), - (416,'George','gjohnstonbj@fda.gov','240.36.245.185','1979-07-24 14:36:02'), - (417,'Eugene','efullerbk@sciencedaily.com','42.38.105.140','2012-09-12 01:56:41'), - (418,'Andrea','astevensbl@goo.gl','31.152.207.204','1979-05-24 11:06:21'), - (419,'Shirley','sreidbm@scientificamerican.com','103.60.31.241','1984-02-23 04:07:41'), - (420,'Terry','tmorenobn@blinklist.com','92.161.34.42','1994-06-25 14:01:35'), - (421,'Christopher','cmorenobo@go.com','158.86.176.82','1973-09-05 09:18:47'), - (422,'Dennis','dhansonbp@ning.com','40.160.81.75','1982-01-20 10:19:41'), - (423,'Beverly','brussellbq@de.vu','138.32.56.204','1997-11-06 07:20:19'), - (424,'Howard','hparkerbr@163.com','103.171.134.171','2015-06-24 15:37:10'), - (425,'Helen','hmccoybs@fema.gov','61.200.4.71','1995-06-20 08:59:10'), - (426,'Ann','ahudsonbt@cafepress.com','239.187.71.125','1977-04-11 07:59:28'), - (427,'Tina','twestbu@nhs.uk','80.213.117.74','1992-08-19 05:54:44'), - (428,'Terry','tnguyenbv@noaa.gov','21.93.118.95','1991-09-19 23:22:55'), - (429,'Ashley','aburtonbw@wix.com','233.176.205.109','2009-11-10 05:01:20'), - (430,'Eric','emyersbx@1und1.de','168.91.212.67','1987-08-10 07:16:20'), - (431,'Barbara','blittleby@lycos.com','242.14.189.239','2008-08-02 12:13:04'), - (432,'Sean','sevansbz@instagram.com','14.39.177.13','2007-04-16 17:28:49'), - (433,'Shirley','sburtonc0@newsvine.com','34.107.138.76','1980-12-10 02:19:29'), - (434,'Patricia','pfreemanc1@so-net.ne.jp','219.213.142.117','1987-03-01 02:25:45'), - (435,'Paula','pfosterc2@vkontakte.ru','227.14.138.141','1972-09-22 12:59:34'), - (436,'Nicole','nstewartc3@1688.com','8.164.23.115','1998-10-27 00:10:17'), - (437,'Earl','ekimc4@ovh.net','100.26.244.177','2013-01-22 10:05:46'), - (438,'Beverly','breedc5@reuters.com','174.12.226.27','1974-09-22 07:29:36'), - (439,'Lawrence','lbutlerc6@a8.net','105.164.42.164','1992-06-05 00:43:40'), - (440,'Charles','cmoorec7@ucoz.com','252.197.131.69','1990-04-09 02:34:05'), - (441,'Alice','alawsonc8@live.com','183.73.220.232','1989-02-28 09:11:04'), - (442,'Dorothy','dcarpenterc9@arstechnica.com','241.47.200.14','2005-05-02 19:57:21'), - (443,'Carolyn','cfowlerca@go.com','213.109.55.202','1978-09-10 20:18:20'), - (444,'Anthony','alongcb@free.fr','169.221.158.204','1984-09-13 01:59:23'), - (445,'Annie','amoorecc@e-recht24.de','50.34.148.61','2009-03-26 03:41:07'), - (446,'Carlos','candrewscd@ihg.com','236.69.59.212','1972-03-29 22:42:48'), - (447,'Beverly','bramosce@google.ca','164.250.184.49','1982-11-10 04:34:01'), - (448,'Teresa','tlongcf@umich.edu','174.88.53.223','1987-05-17 12:48:00'), - (449,'Roy','rboydcg@uol.com.br','91.58.243.215','1974-06-16 17:59:54'), - (450,'Ashley','afieldsch@tamu.edu','130.138.11.126','1983-09-15 05:52:36'), - (451,'Judith','jhawkinsci@cmu.edu','200.187.103.245','2003-10-22 12:24:03'), - (452,'Rebecca','rwestcj@ocn.ne.jp','72.85.3.103','1980-11-13 11:01:26'), - (453,'Raymond','rporterck@infoseek.co.jp','146.33.216.151','1982-05-17 23:58:03'), - (454,'Janet','jmarshallcl@odnoklassniki.ru','52.46.193.166','1998-10-04 00:02:21'), - (455,'Shirley','speterscm@salon.com','248.126.31.15','1987-01-30 06:04:59'), - (456,'Annie','abowmancn@economist.com','222.213.248.59','2006-03-14 23:52:59'), - (457,'Jean','jlarsonco@blogspot.com','71.41.25.195','2007-09-08 23:49:45'), - (458,'Phillip','pmoralescp@stanford.edu','74.119.87.28','2011-03-14 20:25:40'), - (459,'Norma','nrobinsoncq@economist.com','28.225.21.54','1989-10-21 01:22:43'), - (460,'Kimberly','kclarkcr@dion.ne.jp','149.171.132.153','2008-06-27 02:27:30'), - (461,'Ruby','rmorriscs@ucla.edu','177.85.163.249','2016-01-28 16:43:44'), - (462,'Jonathan','jcastilloct@tripod.com','78.4.28.77','2000-05-24 17:33:06'), - (463,'Edward','ebryantcu@jigsy.com','140.31.98.193','1992-12-17 08:32:47'), - (464,'Chris','chamiltoncv@eepurl.com','195.171.234.206','1970-12-05 03:42:19'), - (465,'Michael','mweavercw@reference.com','7.233.133.213','1987-03-29 02:30:54'), - (466,'Howard','hlawrencecx@businessweek.com','113.225.124.224','1990-07-30 07:20:57'), - (467,'Philip','phowardcy@comsenz.com','159.170.247.249','2010-10-15 10:18:37'), - (468,'Mary','mmarshallcz@xing.com','125.132.189.70','2007-07-19 13:48:47'), - (469,'Scott','salvarezd0@theguardian.com','78.49.103.230','1987-10-31 06:10:44'), - (470,'Wayne','wcarrolld1@blog.com','238.1.120.204','1980-11-19 03:26:10'), - (471,'Jennifer','jwoodsd2@multiply.com','92.20.224.49','2010-05-06 22:17:04'), - (472,'Raymond','rwelchd3@toplist.cz','176.158.35.240','2007-12-12 19:02:51'), - (473,'Steven','sdixond4@wisc.edu','167.55.237.52','1984-05-05 11:44:37'), - (474,'Ralph','rjamesd5@ameblo.jp','241.190.50.133','2000-07-06 08:44:37'), - (475,'Jason','jrobinsond6@hexun.com','138.119.139.56','2006-02-03 05:27:45'), - (476,'Doris','dwoodd7@fema.gov','180.220.156.190','1978-05-11 20:14:20'), - (477,'Elizabeth','eberryd8@youtu.be','74.188.53.229','2006-11-18 08:29:06'), - (478,'Irene','igilbertd9@privacy.gov.au','194.152.218.1','1985-09-17 02:46:52'), - (479,'Jessica','jdeanda@ameblo.jp','178.103.93.118','1974-06-07 19:04:05'), - (480,'Rachel','ralvarezdb@phoca.cz','17.22.223.174','1999-03-08 02:43:25'), - (481,'Kenneth','kthompsondc@shinystat.com','229.119.91.234','2007-05-15 13:17:32'), - (482,'Harold','hmurraydd@parallels.com','133.26.188.80','1993-11-15 03:42:07'), - (483,'Paula','phowellde@samsung.com','34.215.28.216','1993-11-29 15:55:00'), - (484,'Ruth','rpiercedf@tripadvisor.com','111.30.130.123','1986-08-17 10:19:38'), - (485,'Phyllis','paustindg@vk.com','50.84.34.178','1994-04-13 03:05:24'), - (486,'Laura','lfosterdh@usnews.com','37.8.101.33','2001-06-30 08:58:59'), - (487,'Eric','etaylordi@com.com','103.183.253.45','2006-09-15 20:18:46'), - (488,'Doris','driveradj@prweb.com','247.16.2.199','1989-05-08 09:27:09'), - (489,'Ryan','rhughesdk@elegantthemes.com','103.234.153.232','1989-08-01 18:36:06'), - (490,'Steve','smoralesdl@jigsy.com','3.76.84.207','2011-03-13 17:01:05'), - (491,'Louis','lsullivandm@who.int','78.135.44.208','1975-11-26 16:01:23'), - (492,'Catherine','ctuckerdn@seattletimes.com','93.137.106.21','1990-03-13 16:14:56'), - (493,'Ann','adixondo@gmpg.org','191.136.222.111','2002-06-05 14:22:18'), - (494,'Johnny','jhartdp@amazon.com','103.252.198.39','1988-07-30 23:54:49'), - (495,'Susan','srichardsdq@skype.com','126.247.192.11','2005-01-09 12:08:14'), - (496,'Brenda','bparkerdr@skype.com','63.232.216.86','1974-05-18 05:58:29'), - (497,'Tammy','tmurphyds@constantcontact.com','56.56.37.112','2014-08-05 18:22:25'), - (498,'Larry','lhayesdt@wordpress.com','162.146.13.46','1997-02-26 14:01:53'), - (499,'Evelyn','ethomasdu@hhs.gov','6.241.88.250','2007-09-14 13:03:34'), - (500,'Paula','pshawdv@networksolutions.com','123.27.47.249','2003-10-30 21:19:20'); - -create table {schema}.seed_config_expected_1 as ( - - select *, 'default'::text as c1, 'default'::text as c2, 'was true'::text as some_bool from {schema}.seed - -); - -create table {schema}.seed_config_expected_2 as ( - - select *, 'abc'::text as c1, 'def'::text as c2, 'was true'::text as some_bool from {schema}.seed - -); - -create table {schema}.seed_config_expected_3 as ( - - select *, 'ghi'::text as c1, 'jkl'::text as c2, 'was true'::text as some_bool from {schema}.seed - -); - -create table {schema}.seed_summary ( - year timestamp without time zone, - count bigint -); - -INSERT INTO {schema}.seed_summary - ("year","count") -VALUES - ('1970-01-01 00:00:00',10), - ('1971-01-01 00:00:00',6), - ('1972-01-01 00:00:00',9), - ('1973-01-01 00:00:00',12), - ('1974-01-01 00:00:00',8), - ('1975-01-01 00:00:00',5), - ('1976-01-01 00:00:00',11), - ('1977-01-01 00:00:00',13), - ('1978-01-01 00:00:00',11), - ('1979-01-01 00:00:00',13), - ('1980-01-01 00:00:00',9), - ('1981-01-01 00:00:00',3), - ('1982-01-01 00:00:00',9), - ('1983-01-01 00:00:00',15), - ('1984-01-01 00:00:00',13), - ('1985-01-01 00:00:00',11), - ('1986-01-01 00:00:00',5), - ('1987-01-01 00:00:00',14), - ('1988-01-01 00:00:00',9), - ('1989-01-01 00:00:00',10), - ('1990-01-01 00:00:00',12), - ('1991-01-01 00:00:00',16), - ('1992-01-01 00:00:00',15), - ('1993-01-01 00:00:00',11), - ('1994-01-01 00:00:00',10), - ('1995-01-01 00:00:00',10), - ('1996-01-01 00:00:00',6), - ('1997-01-01 00:00:00',11), - ('1998-01-01 00:00:00',12), - ('1999-01-01 00:00:00',9), - ('2000-01-01 00:00:00',13), - ('2001-01-01 00:00:00',14), - ('2002-01-01 00:00:00',9), - ('2003-01-01 00:00:00',8), - ('2004-01-01 00:00:00',9), - ('2005-01-01 00:00:00',14), - ('2006-01-01 00:00:00',9), - ('2007-01-01 00:00:00',16), - ('2008-01-01 00:00:00',6), - ('2009-01-01 00:00:00',15), - ('2010-01-01 00:00:00',13), - ('2011-01-01 00:00:00',23), - ('2012-01-01 00:00:00',9), - ('2013-01-01 00:00:00',10), - ('2014-01-01 00:00:00',9), - ('2015-01-01 00:00:00',10), - ('2016-01-01 00:00:00',5); diff --git a/tests/functional/dependencies/data/update.sql b/tests/functional/dependencies/data/update.sql deleted file mode 100644 index a3845ee4..00000000 --- a/tests/functional/dependencies/data/update.sql +++ /dev/null @@ -1,7 +0,0 @@ - -UPDATE {schema}.seed set first_name = 'Paul', updated_at = now() where id = 500; - -INSERT INTO {schema}.seed - ("id","first_name","email","ip_address","updated_at") -VALUES - (501, 'Steve', 'sthomas@hhs.gov', '6.241.88.251', now()); diff --git a/tests/functional/dependencies/duplicate_dependency/dbt_project.yml b/tests/functional/dependencies/duplicate_dependency/dbt_project.yml deleted file mode 100644 index dbda758f..00000000 --- a/tests/functional/dependencies/duplicate_dependency/dbt_project.yml +++ /dev/null @@ -1,5 +0,0 @@ -name: 'test' -version: '1.0' -config-version: 2 - -profile: 'default' diff --git a/tests/functional/dependencies/early_hook_dependency/dbt_project.yml b/tests/functional/dependencies/early_hook_dependency/dbt_project.yml deleted file mode 100644 index 7cde1ad4..00000000 --- a/tests/functional/dependencies/early_hook_dependency/dbt_project.yml +++ /dev/null @@ -1,6 +0,0 @@ -name: early_hooks -version: '1.0' -config-version: 2 -on-run-start: - - create table {{ var('test_create_table') }} as (select 1 as id) - - create table {{ var('test_create_second_table') }} as (select 3 as id) diff --git a/tests/functional/dependencies/late_hook_dependency/dbt_project.yml b/tests/functional/dependencies/late_hook_dependency/dbt_project.yml deleted file mode 100644 index 62750f8d..00000000 --- a/tests/functional/dependencies/late_hook_dependency/dbt_project.yml +++ /dev/null @@ -1,6 +0,0 @@ -name: late_hooks -version: '1.0' -config-version: 2 -on-run-start: - - insert into {{ var('test_create_table') }} values (2) - - insert into {{ var('test_create_second_table') }} values (4) diff --git a/tests/functional/dependencies/local_dependency/dbt_project.yml b/tests/functional/dependencies/local_dependency/dbt_project.yml deleted file mode 100644 index d56280a5..00000000 --- a/tests/functional/dependencies/local_dependency/dbt_project.yml +++ /dev/null @@ -1,23 +0,0 @@ - -name: 'local_dep' -version: '1.0' -config-version: 2 - -profile: 'default' - -model-paths: ["models"] -analysis-paths: ["analyses"] -test-paths: ["tests"] -seed-paths: ["seeds"] -macro-paths: ["macros"] - -require-dbt-version: '>=0.1.0' - -target-path: "target" # directory which will store compiled SQL files -clean-targets: # directories to be removed by `dbt clean` - - "target" - - "dbt_packages" - - -seeds: - quote_columns: False diff --git a/tests/functional/dependencies/local_dependency/macros/dep_macro.sql b/tests/functional/dependencies/local_dependency/macros/dep_macro.sql deleted file mode 100644 index 81e9a0fa..00000000 --- a/tests/functional/dependencies/local_dependency/macros/dep_macro.sql +++ /dev/null @@ -1,3 +0,0 @@ -{% macro some_overridden_macro() -%} -100 -{%- endmacro %} diff --git a/tests/functional/dependencies/local_dependency/macros/generate_schema_name.sql b/tests/functional/dependencies/local_dependency/macros/generate_schema_name.sql deleted file mode 100644 index 1e8d62a6..00000000 --- a/tests/functional/dependencies/local_dependency/macros/generate_schema_name.sql +++ /dev/null @@ -1,15 +0,0 @@ -{# This should not be ignored, even as it's in a subpackage #} -{% macro generate_schema_name(custom_schema_name=none, node=none) -%} - {{ var('schema_override', target.schema) }} -{%- endmacro %} - -{# This should not be ignored, even as it's in a subpackage #} -{% macro generate_database_name(custom_database_name=none, node=none) -%} - {{ 'dbt' }} -{%- endmacro %} - - -{# This should not be ignored, even as it's in a subpackage #} -{% macro generate_alias_name(custom_alias_name=none, node=none) -%} - {{ node.name ~ '_subpackage_generate_alias_name' }} -{%- endmacro %} diff --git a/tests/functional/dependencies/local_dependency/models/model_to_import.sql b/tests/functional/dependencies/local_dependency/models/model_to_import.sql deleted file mode 100644 index 4b91aa0f..00000000 --- a/tests/functional/dependencies/local_dependency/models/model_to_import.sql +++ /dev/null @@ -1 +0,0 @@ -select * from {{ ref('seed') }} diff --git a/tests/functional/dependencies/local_dependency/models/schema.yml b/tests/functional/dependencies/local_dependency/models/schema.yml deleted file mode 100644 index 4b3278ed..00000000 --- a/tests/functional/dependencies/local_dependency/models/schema.yml +++ /dev/null @@ -1,11 +0,0 @@ -version: 2 -sources: - - name: my_source - schema: invalid_schema - tables: - - name: my_table - - name: seed_source - schema: "{{ var('schema_override', target.schema) }}" - tables: - - name: "seed" - identifier: "seed_subpackage_generate_alias_name" diff --git a/tests/functional/dependencies/local_dependency/seeds/seed.csv b/tests/functional/dependencies/local_dependency/seeds/seed.csv deleted file mode 100644 index 3ff3deb8..00000000 --- a/tests/functional/dependencies/local_dependency/seeds/seed.csv +++ /dev/null @@ -1,2 +0,0 @@ -id -1 diff --git a/tests/functional/dependencies/models_local/dep_source_model.sql b/tests/functional/dependencies/models_local/dep_source_model.sql deleted file mode 100644 index e7e5fcfd..00000000 --- a/tests/functional/dependencies/models_local/dep_source_model.sql +++ /dev/null @@ -1,2 +0,0 @@ -{# If our dependency source didn't exist, this would be an errror #} -select * from {{ source('seed_source', 'seed') }} diff --git a/tests/functional/dependencies/models_local/my_configured_model.sql b/tests/functional/dependencies/models_local/my_configured_model.sql deleted file mode 100644 index 554ed3b4..00000000 --- a/tests/functional/dependencies/models_local/my_configured_model.sql +++ /dev/null @@ -1,4 +0,0 @@ -{{ - config(schema='configured') -}} -select * from {{ ref('model_to_import') }} diff --git a/tests/functional/dependencies/models_local/my_model.sql b/tests/functional/dependencies/models_local/my_model.sql deleted file mode 100644 index a84f75e1..00000000 --- a/tests/functional/dependencies/models_local/my_model.sql +++ /dev/null @@ -1,2 +0,0 @@ - -select * from {{ ref('model_to_import') }} diff --git a/tests/functional/dependencies/models_local/schema.yml b/tests/functional/dependencies/models_local/schema.yml deleted file mode 100644 index af65187f..00000000 --- a/tests/functional/dependencies/models_local/schema.yml +++ /dev/null @@ -1,7 +0,0 @@ -version: 2 -sources: - - name: my_source - schema: "{{ var('schema_override', target.schema) }}" - tables: - - name: my_table - identifier: seed diff --git a/tests/functional/dependencies/models_local/source_override_model.sql b/tests/functional/dependencies/models_local/source_override_model.sql deleted file mode 100644 index d567d208..00000000 --- a/tests/functional/dependencies/models_local/source_override_model.sql +++ /dev/null @@ -1,2 +0,0 @@ -{# If our source override didn't take, this would be an errror #} -select * from {{ source('my_source', 'my_table') }} diff --git a/tests/functional/dependencies/test_dependency_options.py b/tests/functional/dependencies/test_dependency_options.py deleted file mode 100644 index 08ffc5d2..00000000 --- a/tests/functional/dependencies/test_dependency_options.py +++ /dev/null @@ -1,106 +0,0 @@ -import os -import shutil - -from dbt.tests.util import run_dbt -import pytest - - -class TestDepsOptions(object): - # this revision of dbt-integration-project requires dbt-utils.git@0.5.0, which the - # package config handling should detect - @pytest.fixture(scope="class") - def packages(self): - return { - "packages": [ - { - "package": "fivetran/fivetran_utils", - "version": "0.4.7", - }, - ] - } - - @pytest.fixture - def clean_start(self, project): - if os.path.exists("dbt_packages"): - shutil.rmtree("dbt_packages") - if os.path.exists("package-lock.yml"): - os.remove("package-lock.yml") - - def test_deps_lock(self, clean_start): - run_dbt(["deps", "--lock"]) - assert not os.path.exists("dbt_packages") - assert os.path.exists("package-lock.yml") - with open("package-lock.yml") as fp: - contents = fp.read() - assert ( - contents - == """packages: -- package: fivetran/fivetran_utils - version: 0.4.7 -- package: dbt-labs/dbt_utils - version: 1.1.1 -sha1_hash: 71304bca2138cf8004070b3573a1e17183c0c1a8 -""" - ) - - def test_deps_default(self, clean_start): - run_dbt(["deps"]) - assert len(os.listdir("dbt_packages")) == 2 - assert os.path.exists("package-lock.yml") - with open("package-lock.yml") as fp: - contents = fp.read() - assert ( - contents - == """packages: -- package: fivetran/fivetran_utils - version: 0.4.7 -- package: dbt-labs/dbt_utils - version: 1.1.1 -sha1_hash: 71304bca2138cf8004070b3573a1e17183c0c1a8 -""" - ) - - def test_deps_add(self, clean_start): - run_dbt(["deps", "--add-package", "dbt-labs/audit_helper@0.9.0"]) - with open("packages.yml") as fp: - contents = fp.read() - assert ( - contents - == """packages: - - package: fivetran/fivetran_utils - version: 0.4.7 - - package: dbt-labs/audit_helper - version: 0.9.0 -""" - ) - assert len(os.listdir("dbt_packages")) == 3 - - def test_deps_add_without_install(self, clean_start): - os.rename("packages.yml", "dependencies.yml") - run_dbt( - [ - "deps", - "--add-package", - "dbt-labs/audit_helper@0.9.0", - "--lock", - ] - ) - assert not os.path.exists("dbt_packages") - assert not os.path.exists("packages.yml") - with open("dependencies.yml") as fp: - contents = fp.read() - assert ( - contents - == """packages: - - package: fivetran/fivetran_utils - version: 0.4.7 - - package: dbt-labs/audit_helper - version: 0.9.0 -""" - ) - - def test_deps_upgrade(self, clean_start, mocker): - run_dbt(["deps", "--lock"]) - patched_lock = mocker.patch("dbt.task.deps.DepsTask.lock") - run_dbt(["deps", "--upgrade"]) - assert patched_lock.call_count == 1 diff --git a/tests/functional/dependencies/test_local_dependency.py b/tests/functional/dependencies/test_local_dependency.py deleted file mode 100644 index a4a42d1b..00000000 --- a/tests/functional/dependencies/test_local_dependency.py +++ /dev/null @@ -1,356 +0,0 @@ -import json -import os -from pathlib import Path -import shutil -from unittest import mock - -from dbt.exceptions import DbtProjectError, DependencyError -from dbt.tests.util import check_relations_equal -from dbt_common.exceptions import CompilationError, DbtRuntimeError -import dbt_common.semver as semver -import pytest -import yaml - -from tests.functional.utils import ( - run_dbt, - run_dbt_and_capture, - up_one, -) - - -models__dep_source = """ -{# If our dependency source didn't exist, this would be an errror #} -select * from {{ source('seed_source', 'seed') }} -""" - -models__my_configured_model = """ -{{ - config(schema='configured') -}} -select * from {{ ref('model_to_import') }} -""" - -models__my_model = """ -select * from {{ ref('model_to_import') }} -""" - -models__source_override_model = """ -{# If our source override didn't take, this would be an errror #} -select * from {{ source('my_source', 'my_table') }} -""" - -models__iterate = """ -{% for x in no_such_dependency.no_such_method() %} -{% endfor %} -""" - -models__hooks_actual = """ -select * from {{ var('test_create_table') }} -union all -select * from {{ var('test_create_second_table') }} -""" - -models__hooks_expected = """ -{# surely there is a better way to do this! #} - -{% for _ in range(1, 5) %} -select {{ loop.index }} as id -{% if not loop.last %}union all{% endif %} -{% endfor %} -""" - -properties__schema_yml = """ -version: 2 -sources: - - name: my_source - schema: "{{ var('schema_override', target.schema) }}" - tables: - - name: my_table - identifier: seed_subpackage_generate_alias_name -""" - -macros__macro_sql = """ -{# This macro also exists in the dependency -dbt should be fine with that #} -{% macro some_overridden_macro() -%} -999 -{%- endmacro %} -""" - -macros__macro_override_schema_sql = """ -{% macro generate_schema_name(schema_name, node) -%} - - {{ schema_name }}_{{ node.schema }}_macro - -{%- endmacro %} -""" - - -class BaseDependencyTest(object): - @pytest.fixture(scope="class") - def macros(self): - return {"macro.sql": macros__macro_sql} - - @pytest.fixture(scope="class") - def models(self): - return { - "dep_source_model.sql": models__dep_source, - "my_configured_model.sql": models__my_configured_model, - "my_model.sql": models__my_model, - "source_override_model.sql": models__source_override_model, - } - - @pytest.fixture(scope="class") - def properties(self): - return { - "schema.yml": properties__schema_yml, - } - - @pytest.fixture(scope="class", autouse=True) - def modify_schema_fqn(self, project): - schema_fqn = "{}.{}".format( - project.database, - project.test_schema, - ) - schema_fqn_configured = "{}.{}".format( - project.database, - project.test_schema + "_configured", - ) - - project.created_schemas.append(schema_fqn) - project.created_schemas.append(schema_fqn_configured) - - @pytest.fixture(scope="class", autouse=True) - def setUp(self, project, modify_schema_fqn): - shutil.copytree( - project.test_dir / Path("local_dependency"), - project.project_root / Path("local_dependency"), - ) - - @pytest.fixture(scope="class") - def packages(self): - return {"packages": [{"local": "local_dependency"}]} - - -class TestSimpleDependency(BaseDependencyTest): - def test_local_dependency(self, project): - run_dbt(["deps"]) - run_dbt(["seed"]) - results = run_dbt() - assert len(results) == 5 - - assert {r.node.schema for r in results} == { - project.test_schema, - project.test_schema + "_configured", - } - - base_schema_nodes = [r.node for r in results if r.node.schema == project.test_schema] - assert len(base_schema_nodes) == 4 - - check_relations_equal( - project.adapter, - [ - f"{project.test_schema}.source_override_model", - f"{project.test_schema}.seed_subpackage_generate_alias_name", - ], - ) - check_relations_equal( - project.adapter, - [ - f"{project.test_schema}.dep_source_model", - f"{project.test_schema}.seed_subpackage_generate_alias_name", - ], - ) - - def test_no_dependency_paths(self, project): - run_dbt(["deps"]) - run_dbt(["seed"]) - - # prove dependency does not exist as model in project - dep_path = os.path.join("models_local", "model_to_import.sql") - results = run_dbt( - ["run", "--models", f"+{dep_path}"], - ) - assert len(results) == 0 - - # prove model can run when importing that dependency - local_path = Path("models") / "my_model.sql" - results = run_dbt( - ["run", "--models", f"+{local_path}"], - ) - assert len(results) == 2 - - -class TestSimpleDependencyRelativePath(BaseDependencyTest): - def test_local_dependency_relative_path(self, project): - last_dir = Path(project.project_root).name - with up_one(): - _, stdout = run_dbt_and_capture(["deps", "--project-dir", last_dir]) - assert ( - "Installed from " in stdout - ), "Test output didn't contain expected string" - - -class TestMissingDependency(object): - @pytest.fixture(scope="class") - def models(self): - return { - "iterate.sql": models__iterate, - } - - def test_missing_dependency(self, project): - # dbt should raise a runtime exception - with pytest.raises(DbtRuntimeError): - run_dbt(["compile"]) - - -class TestSimpleDependencyWithSchema(BaseDependencyTest): - def dbt_vargs(self, schema): - # we can't add this to the config because Sources don't respect dbt_project.yml - vars_arg = yaml.safe_dump({"schema_override": "dbt_test_{}_macro".format(schema)}) - return ["--vars", vars_arg] - - def project_config(self): - return { - "models": { - "schema": "dbt_test", - }, - "seeds": { - "schema": "dbt_test", - }, - } - - @mock.patch("dbt.config.project.get_installed_version") - def test_local_dependency_out_of_date(self, mock_get, project): - mock_get.return_value = semver.VersionSpecifier.from_version_string("0.0.1") - run_dbt(["deps"] + self.dbt_vargs(project.test_schema)) - # check seed - with pytest.raises(DbtProjectError) as exc: - run_dbt(["seed"] + self.dbt_vargs(project.test_schema)) - assert "--no-version-check" in str(exc.value) - # check run too - with pytest.raises(DbtProjectError) as exc: - run_dbt(["run"] + self.dbt_vargs(project.test_schema)) - assert "--no-version-check" in str(exc.value) - - @mock.patch("dbt.config.project.get_installed_version") - def test_local_dependency_out_of_date_no_check(self, mock_get): - mock_get.return_value = semver.VersionSpecifier.from_version_string("0.0.1") - run_dbt(["deps"]) - run_dbt(["seed", "--no-version-check"]) - results = run_dbt(["run", "--no-version-check"]) - assert len(results) == 5 - - -class TestSimpleDependencyNoVersionCheckConfig(BaseDependencyTest): - @pytest.fixture(scope="class") - def project_config_update(self): - return { - "flags": { - "send_anonymous_usage_stats": False, - "version_check": False, - }, - "models": { - "schema": "dbt_test", - }, - "seeds": { - "schema": "dbt_test", - }, - } - - @pytest.fixture(scope="class") - def macros(self): - return {"macro.sql": macros__macro_override_schema_sql} - - @mock.patch("dbt.config.project.get_installed_version") - def test_local_dependency_out_of_date_no_check(self, mock_get, project): - # we can't add this to the config because Sources don't respect dbt_project.yml - base_schema = "dbt_test_{}_macro".format(project.test_schema) - vars_arg = yaml.safe_dump( - { - "schema_override": base_schema, - } - ) - - mock_get.return_value = semver.VersionSpecifier.from_version_string("0.0.1") - run_dbt(["deps", "--vars", vars_arg]) - run_dbt(["seed", "--vars", vars_arg]) - results = run_dbt(["run", "--vars", vars_arg]) - len(results) == 5 - - -class TestSimpleDependencyHooks(BaseDependencyTest): - @pytest.fixture(scope="class") - def models(self): - return { - "actual.sql": models__hooks_actual, - "expected.sql": models__hooks_expected, - } - - @pytest.fixture(scope="class") - def project_config_update(self): - # these hooks should run first, so nothing to drop - return { - "on-run-start": [ - "drop table if exists {{ var('test_create_table') }}", - "drop table if exists {{ var('test_create_second_table') }}", - ] - } - - @pytest.fixture(scope="class") - def packages(self): - return { - "packages": [{"local": "early_hook_dependency"}, {"local": "late_hook_dependency"}] - } - - @pytest.fixture(scope="class") - def prepare_dependencies(self, project): - shutil.copytree( - project.test_dir / Path("early_hook_dependency"), - project.project_root / Path("early_hook_dependency"), - ) - shutil.copytree( - project.test_dir / Path("late_hook_dependency"), - project.project_root / Path("late_hook_dependency"), - ) - - def test_hook_dependency(self, prepare_dependencies, project): - cli_vars = json.dumps( - { - "test_create_table": '"{}"."hook_test"'.format(project.test_schema), - "test_create_second_table": '"{}"."hook_test_2"'.format(project.test_schema), - } - ) - - run_dbt(["deps", "--vars", cli_vars]) - results = run_dbt(["run", "--vars", cli_vars]) - assert len(results) == 2 - check_relations_equal(project.adapter, ["actual", "expected"]) - - -class TestSimpleDependencyDuplicateName(BaseDependencyTest): - @pytest.fixture(scope="class", autouse=True) - def setUp(self): - pass # do not copy local dependency automatically - - @pytest.fixture(scope="class") - def packages(self): - return {"packages": [{"local": "duplicate_dependency"}]} - - @pytest.fixture(scope="class") - def prepare_dependencies(self, project): - shutil.copytree( - project.test_dir / Path("duplicate_dependency"), - project.project_root / Path("duplicate_dependency"), - ) - - def test_local_dependency_same_name(self, prepare_dependencies, project): - with pytest.raises(DependencyError): - run_dbt(["deps"], expect_pass=False) - - def test_local_dependency_same_name_sneaky(self, prepare_dependencies, project): - shutil.copytree("duplicate_dependency", "./dbt_packages/duplicate_dependency") - with pytest.raises(CompilationError): - run_dbt(["compile"]) - - # needed to avoid compilation errors from duplicate package names in test autocleanup - run_dbt(["clean"]) diff --git a/tests/functional/dependencies/test_simple_dependency.py b/tests/functional/dependencies/test_simple_dependency.py deleted file mode 100644 index f35d902d..00000000 --- a/tests/functional/dependencies/test_simple_dependency.py +++ /dev/null @@ -1,435 +0,0 @@ -import os -from pathlib import Path -import tempfile - -from dbt.exceptions import DbtProjectError -from dbt.tests.util import ( - check_relations_equal, - run_dbt, - write_config_file, -) -import pytest - - -models__disabled_one = """ -{{config(enabled=False)}} - -select 1 -""" - -models__disabled_two = """ -{{config(enabled=False)}} - -select * from {{ref('disabled_one')}} -""" - -models__empty = """ -""" - -models__view_summary = """ -{{ - config( - materialized='view' - ) -}} - - -with t as ( - - select * from {{ ref('view_model') }} - -) - -select date_trunc('year', updated_at) as year, - count(*) -from t -group by 1 -""" - - -class SimpleDependencyBase(object): - @pytest.fixture(scope="class", autouse=True) - def setUp(self, project): - project.run_sql_file(project.test_data_dir / Path("seed.sql")) - - @pytest.fixture(scope="class") - def models(self): - return { - "empty.sql": models__empty, - "view_summary.sql": models__view_summary, - "view_summary.sql": models__view_summary, - } - - @pytest.fixture(scope="class") - def packages(self): - return { - "packages": [ - { - "git": "https://github.com/dbt-labs/dbt-integration-project", - "revision": "1.1", - } - ] - } - - # These two functions included to enable override in ...NoProfile derived test class - @pytest.fixture(scope="class") - def run_deps(self, project): - return run_dbt(["deps"]) - - @pytest.fixture(scope="function") - def run_clean(self, project): - yield - - # clear test schema - assert os.path.exists("target") - run_dbt(["clean"]) - assert not os.path.exists("target") - - -class TestSimpleDependency(SimpleDependencyBase): - def test_simple_dependency(self, run_deps, project, run_clean): - """dependencies should draw from a changing base table""" - results = run_dbt() - assert len(results) == 4 - - check_relations_equal(project.adapter, ["seed", "table_model"]) - check_relations_equal(project.adapter, ["seed", "view_model"]) - check_relations_equal(project.adapter, ["seed", "incremental"]) - check_relations_equal(project.adapter, ["seed_summary", "view_summary"]) - - project.run_sql_file(project.test_data_dir / Path("update.sql")) - results = run_dbt() - assert len(results) == 4 - - check_relations_equal(project.adapter, ["seed", "table_model"]) - check_relations_equal(project.adapter, ["seed", "view_model"]) - check_relations_equal(project.adapter, ["seed", "incremental"]) - - -class TestSimpleDependencyWithDependenciesFile(SimpleDependencyBase): - @pytest.fixture(scope="class") - def packages(self): - return {} - - @pytest.fixture(scope="class") - def dependencies(self): - return { - "packages": [ - { - "git": "https://github.com/dbt-labs/dbt-integration-project", - "warn-unpinned": True, - } - ] - } - - def test_dependency_with_dependencies_file(self, run_deps, project): - # Tests that "packages" defined in a dependencies.yml file works - run_dbt(["deps"]) - results = run_dbt() - assert len(results) == 4 - - -class TestSimpleDependencyWithEmptyPackagesFile(SimpleDependencyBase): - @pytest.fixture(scope="class") - def packages(self): - return " " - - def test_dependency_with_empty_packages_file(self, run_deps, project): - # Tests that an empty packages file doesn't fail with a Python error - run_dbt(["deps"]) - - -class TestSimpleDependencyNoProfile(SimpleDependencyBase): - """dbt deps and clean commands should not require a profile.""" - - @pytest.fixture(scope="class") - def run_deps(self, project): - with tempfile.TemporaryDirectory() as tmpdir: - result = run_dbt(["deps", "--profiles-dir", tmpdir]) - return result - - @pytest.fixture(scope="class") - def run_clean(self, project): - with tempfile.TemporaryDirectory() as tmpdir: - result = run_dbt(["clean", "--profiles-dir", tmpdir]) - return result - - def test_simple_dependency_no_profile(self, project, run_deps, run_clean): - """only need fixtures as opposed to any model assertions since those are - irrelevant and won't occur within the same runtime as a dbt run -s ...""" - pass - - -class TestSimpleDependencyWithModels(SimpleDependencyBase): - def test_simple_dependency_with_models(self, run_deps, project, run_clean): - results = run_dbt(["run", "--models", "view_model+"]) - len(results) == 2 - - check_relations_equal(project.adapter, ["seed", "view_model"]) - check_relations_equal(project.adapter, ["seed_summary", "view_summary"]) - - created_models = project.get_tables_in_schema() - - assert "table_model" not in created_models - assert "incremental" not in created_models - assert created_models["view_model"] == "view" - assert created_models["view_summary"] == "view" - - -class TestSimpleDependencyUnpinned(object): - @pytest.fixture(scope="class", autouse=True) - def setUp(self, project): - project.run_sql_file(project.test_data_dir / Path("seed.sql")) - - @pytest.fixture(scope="class") - def packages(self): - return { - "packages": [ - { - "git": "https://github.com/dbt-labs/dbt-integration-project", - "warn-unpinned": True, - } - ] - } - - def test_simple_dependency(self, project): - run_dbt(["deps"]) - - -class TestSimpleDependencyWithDuplicates(object): - # dbt should convert these into a single dependency internally - @pytest.fixture(scope="class") - def packages(self): - return { - "packages": [ - { - "git": "https://github.com/dbt-labs/dbt-integration-project", - "revision": "dbt/1.0.0", - }, - { - "git": "https://github.com/dbt-labs/dbt-integration-project.git", - "revision": "dbt/1.0.0", - }, - ] - } - - def test_simple_dependency_deps(self, project): - run_dbt(["deps"]) - - -class TestSimpleDependencyWithSubdirs(object): - # dbt should convert these into a single dependency internally - @pytest.fixture(scope="class") - def packages(self): - return { - "packages": [ - { - "git": "https://github.com/dbt-labs/dbt-multipe-packages.git", - "subdirectory": "dbt-utils-main", - "revision": "v0.1.0", - }, - { - "git": "https://github.com/dbt-labs/dbt-multipe-packages.git", - "subdirectory": "dbt-date-main", - "revision": "v0.1.0", - }, - ] - } - - def test_git_with_multiple_subdir(self, project): - run_dbt(["deps"]) - assert os.path.exists("package-lock.yml") - expected = """packages: -- git: https://github.com/dbt-labs/dbt-multipe-packages.git - revision: 53782f3ede8fdf307ee1d8e418aa65733a4b72fa - subdirectory: dbt-utils-main -- git: https://github.com/dbt-labs/dbt-multipe-packages.git - revision: 53782f3ede8fdf307ee1d8e418aa65733a4b72fa - subdirectory: dbt-date-main -sha1_hash: b9c8042f29446c55a33f9f211737f445a640c7a1 -""" - with open("package-lock.yml") as fp: - contents = fp.read() - assert contents == expected - assert len(os.listdir("dbt_packages")) == 2 - - -class TestRekeyedDependencyWithSubduplicates(object): - # this revision of dbt-integration-project requires dbt-utils.git@0.5.0, which the - # package config handling should detect - @pytest.fixture(scope="class") - def packages(self): - return { - "packages": [ - { - "git": "https://github.com/dbt-labs/dbt-integration-project", - "revision": "config-1.0.0-deps", - }, - { - "git": "https://github.com/dbt-labs/dbt-utils", - "revision": "0.5.0", - }, - ] - } - - def test_simple_dependency_deps(self, project): - run_dbt(["deps"]) - assert len(os.listdir("dbt_packages")) == 2 - - -class TestTarballNestedDependencies(object): - # this version of dbt_expectations has a dependency on dbt_date, which the - # package config handling should detect - @pytest.fixture(scope="class") - def packages(self): - return { - "packages": [ - { - "tarball": "https://github.com/calogica/dbt-expectations/archive/refs/tags/0.9.0.tar.gz", - "name": "dbt_expectations", - }, - ] - } - - def test_simple_dependency_deps(self, project): - run_dbt(["deps"]) - assert set(os.listdir("dbt_packages")) == set(["dbt_expectations", "dbt_date"]) - - -class DependencyBranchBase(object): - @pytest.fixture(scope="class", autouse=True) - def setUp(self, project): - project.run_sql_file(project.test_data_dir / Path("seed.sql")) - - @pytest.fixture(scope="class") - def packages(self): - return { - "packages": [ - { - "git": "https://github.com/dbt-labs/dbt-integration-project", - "revision": "dbt/1.0.0", - }, - ] - } - - def deps_run_assert_equality(self, project): - run_dbt(["deps"]) - results = run_dbt() - assert len(results) == 4 - - check_relations_equal(project.adapter, ["seed", "table_model"]) - check_relations_equal(project.adapter, ["seed", "view_model"]) - check_relations_equal(project.adapter, ["seed", "incremental"]) - - created_models = project.get_tables_in_schema() - - assert created_models["table_model"] == "table" - assert created_models["view_model"] == "view" - assert created_models["view_summary"] == "view" - assert created_models["incremental"] == "table" - - -class TestSimpleDependencyBranch(DependencyBranchBase): - @pytest.fixture(scope="class") - def models(self): - return { - "view_summary.sql": models__view_summary, - } - - def test_simple_dependency(self, project): - self.deps_run_assert_equality(project) - check_relations_equal(project.adapter, ["seed_summary", "view_summary"]) - - project.run_sql_file(project.test_data_dir / Path("update.sql")) - self.deps_run_assert_equality(project) - - -class TestSimpleDependencyBranchWithEmpty(DependencyBranchBase): - @pytest.fixture(scope="class") - def models(self): - """extra models included""" - return { - "disabled_one.sql": models__disabled_one, - "disabled_two.sql": models__disabled_two, - "view_summary.sql": models__view_summary, - "empty.sql": models__empty, - } - - def test_empty_models_not_compiled_in_dependencies(self, project): - self.deps_run_assert_equality(project) - - models = project.get_tables_in_schema() - - assert "empty" not in models.keys() - - -class TestSimpleDependencyBadProfile(object): - @pytest.fixture(scope="class") - def project_config_update(self): - return { - "config-version": 2, - "models": { - "+any_config": "{{ target.name }}", - "+enabled": "{{ target.name in ['redshift', 'postgres'] | as_bool }}", - }, - } - - # Write out the profile data as a yaml file - @pytest.fixture(scope="class", autouse=True) - def dbt_profile_target(self): - # Need to set the environment variable here initially because - # the unittest setup does a load_config. - os.environ["PROFILE_TEST_HOST"] = "localhost" - return { - "type": "postgres", - "threads": 4, - "host": "{{ env_var('PROFILE_TEST_HOST') }}", - "port": 5432, - "user": "root", - "pass": "password", - "dbname": "dbt", - } - - def test_deps_bad_profile(self, project): - del os.environ["PROFILE_TEST_HOST"] - run_dbt(["deps"]) - run_dbt(["clean"]) - - -class TestSimpleDependcyTarball(object): - @pytest.fixture(scope="class") - def packages(self): - return { - "packages": [ - { - "tarball": "https://codeload.github.com/dbt-labs/dbt-utils/tar.gz/0.9.6", - "name": "dbt_utils", - } - ] - } - - def test_deps_simple_tarball_doesnt_error_out(self, project): - run_dbt(["deps"]) - assert len(os.listdir("dbt_packages")) == 1 - - -class TestBadTarballDependency(object): - def test_malformed_tarball_package_causes_exception(self, project): - # We have to specify the bad formatted package here because if we do it - # in a `packages` fixture, the test will blow up in the setup phase, meaning - # we can't appropriately catch it with a `pytest.raises` - bad_tarball_package_spec = { - "packages": [ - { - "tarball": "https://codeload.github.com/dbt-labs/dbt-utils/tar.gz/0.9.6", - "version": "dbt_utils", - } - ] - } - write_config_file(bad_tarball_package_spec, "packages.yml") - - with pytest.raises( - DbtProjectError, match=r"The packages.yml file in this project is malformed" - ) as e: - run_dbt(["deps"]) - assert e is not None diff --git a/tests/functional/dependencies/test_simple_dependency_with_configs.py b/tests/functional/dependencies/test_simple_dependency_with_configs.py deleted file mode 100644 index 55ecff9a..00000000 --- a/tests/functional/dependencies/test_simple_dependency_with_configs.py +++ /dev/null @@ -1,106 +0,0 @@ -from pathlib import Path - -from dbt.tests.util import check_relations_equal, run_dbt -import pytest - - -models__view_summary = """ -{{ - config( - materialized='view' - ) -}} - - -with t as ( - - select * from {{ ref('view_model') }} - -) - -select date_trunc('year', updated_at) as year, - count(*) -from t -group by 1 -""" - - -class BaseTestSimpleDependencyWithConfigs(object): - @pytest.fixture(scope="class", autouse=True) - def setUp(self, project): - project.run_sql_file(project.test_data_dir / Path("seed.sql")) - - @pytest.fixture(scope="class") - def models(self): - return { - "view_summary.sql": models__view_summary, - } - - -class TestSimpleDependencyWithConfigs(BaseTestSimpleDependencyWithConfigs): - @pytest.fixture(scope="class") - def packages(self): - return { - "packages": [ - { - "git": "https://github.com/dbt-labs/dbt-integration-project", - "revision": "with-configs-1.0.0", - }, - ] - } - - @pytest.fixture(scope="class") - def project_config_update(self): - return { - "config-version": 2, - "vars": { - "dbt_integration_project": {"bool_config": True}, - }, - } - - def test_simple_dependency(self, project): - run_dbt(["deps"]) - results = run_dbt() - assert len(results) == 5 - - check_relations_equal(project.adapter, ["seed_config_expected_1", "config"]) - check_relations_equal(project.adapter, ["seed", "table_model"]) - check_relations_equal(project.adapter, ["seed", "view_model"]) - check_relations_equal(project.adapter, ["seed", "incremental"]) - - -class TestSimpleDependencyWithOverriddenConfigs(BaseTestSimpleDependencyWithConfigs): - @pytest.fixture(scope="class") - def packages(self): - return { - "packages": [ - { - "git": "https://github.com/dbt-labs/dbt-integration-project", - "revision": "with-configs-1.0.0", - }, - ] - } - - @pytest.fixture(scope="class") - def project_config_update(self): - return { - "config-version": 2, - "vars": { - # project-level configs - "dbt_integration_project": { - "config_1": "abc", - "config_2": "def", - "bool_config": True, - }, - }, - } - - def test_simple_dependency(self, project): - run_dbt(["deps"]) - results = run_dbt(["run"]) - len(results) == 5 - - check_relations_equal(project.adapter, ["seed_config_expected_2", "config"]) - check_relations_equal(project.adapter, ["seed", "table_model"]) - check_relations_equal(project.adapter, ["seed", "view_model"]) - check_relations_equal(project.adapter, ["seed", "incremental"]) diff --git a/tests/functional/metrics/fixtures.py b/tests/functional/metrics/fixtures.py deleted file mode 100644 index 5a8373fb..00000000 --- a/tests/functional/metrics/fixtures.py +++ /dev/null @@ -1,666 +0,0 @@ -# not strictly necessary, but this reflects the integration tests currently in the 'dbt-metrics' package right now -# i'm including just the first 10 rows for more concise 'git diff' - -mock_purchase_data_csv = """purchased_at,payment_type,payment_total -2021-02-14 17:52:36,maestro,2418.94 -2021-02-15 04:16:50,jcb,3043.28 -2021-02-15 11:30:45,solo,1505.81 -2021-02-16 13:08:18,,1532.85 -2021-02-17 05:41:34,americanexpress,319.91 -2021-02-18 06:47:32,jcb,2143.44 -2021-02-19 01:37:09,jcb,840.1 -2021-02-19 03:38:49,jcb,1388.18 -2021-02-19 04:22:41,jcb,2834.96 -2021-02-19 13:28:50,china-unionpay,2440.98 -""".strip() - -models_people_sql = """ -select 1 as id, 'Drew' as first_name, 'Banin' as last_name, 'yellow' as favorite_color, true as loves_dbt, 5 as tenure, current_timestamp as created_at -union all -select 2 as id, 'Jeremy' as first_name, 'Cohen' as last_name, 'indigo' as favorite_color, true as loves_dbt, 4 as tenure, current_timestamp as created_at -union all -select 3 as id, 'Callum' as first_name, 'McCann' as last_name, 'emerald' as favorite_color, true as loves_dbt, 0 as tenure, current_timestamp as created_at -""" - -semantic_model_people_yml = """ -version: 2 - -semantic_models: - - name: semantic_people - model: ref('people') - dimensions: - - name: favorite_color - type: categorical - - name: created_at - type: TIME - type_params: - time_granularity: day - measures: - - name: years_tenure - agg: SUM - expr: tenure - - name: people - agg: count - expr: id - entities: - - name: id - type: primary - defaults: - agg_time_dimension: created_at -""" - -basic_metrics_yml = """ -version: 2 - -metrics: - - - name: number_of_people - label: "Number of people" - description: Total count of people - type: simple - type_params: - measure: people - meta: - my_meta: 'testing' - - - name: collective_tenure - label: "Collective tenure" - description: Total number of years of team experience - type: simple - type_params: - measure: - name: "years_tenure" - filter: "{{ Dimension('id__loves_dbt') }} is true" - - - name: average_tenure - label: "Average tenure" - description: "The average tenure per person" - type: ratio - type_params: - numerator: collective_tenure - denominator: number_of_people - - - name: average_tenure_plus_one - label: "Average tenure, plus 1" - description: "The average tenure per person" - type: derived - type_params: - metrics: - - average_tenure - expr: "average_tenure + 1" -""" - -metricflow_time_spine_sql = """ -SELECT to_date('02/20/2023, 'mm/dd/yyyy') as date_day -""" - -models_people_metrics_yml = """ -version: 2 - -metrics: - - - name: number_of_people - label: "Number of people" - description: Total count of people - type: simple - type_params: - measure: people - meta: - my_meta: 'testing' - - - name: collective_tenure - label: "Collective tenure" - description: Total number of years of team experience - type: simple - type_params: - measure: - name: years_tenure - filter: "{{ Dimension('id__loves_dbt') }} is true" - join_to_timespine: true - fill_nulls_with: 0 - - - name: collective_window - label: "Collective window" - description: Testing window - type: simple - type_params: - measure: - name: years_tenure - filter: "{{ Dimension('id__loves_dbt') }} is true" - window: 14 days - - - name: average_tenure - label: Average Tenure - description: The average tenure of our people - type: ratio - type_params: - numerator: collective_tenure - denominator: number_of_people - - - name: average_tenure_minus_people - label: Average Tenure minus People - description: Well this isn't really useful is it? - type: derived - type_params: - expr: average_tenure - number_of_people - metrics: - - average_tenure - - number_of_people - -""" - -invalid_models_people_metrics_yml = """ -version: 2 - -metrics: - - - name: number_of_people - label: "Number of people" - description: Total count of people - model: "ref(people)" - calculation_method: count - expression: "*" - timestamp: created_at - time_grains: [day, week, month] - dimensions: - - favorite_color - - loves_dbt - meta: - my_meta: 'testing' - - - name: collective_tenure - label: "Collective tenure" - description: Total number of years of team experience - model: "ref(people)" - calculation_method: sum - expression: tenure - timestamp: created_at - time_grains: [day] - filters: - - field: loves_dbt - operator: 'is' - value: 'true' - -""" - -invalid_metrics_missing_model_yml = """ -version: 2 - -metrics: - - - name: number_of_people - label: "Number of people" - description: Total count of people - calculation_method: count - expression: "*" - timestamp: created_at - time_grains: [day, week, month] - dimensions: - - favorite_color - - loves_dbt - meta: - my_meta: 'testing' - - - name: collective_tenure - label: "Collective tenure" - description: Total number of years of team experience - calculation_method: sum - expression: tenure - timestamp: created_at - time_grains: [day] - filters: - - field: loves_dbt - operator: 'is' - value: 'true' - -""" - -invalid_metrics_missing_expression_yml = """ -version: 2 -metrics: - - name: number_of_people - label: "Number of people" - model: "ref(people)" - description: Total count of people - calculation_method: count - timestamp: created_at - time_grains: [day, week, month] - dimensions: - - favorite_color - - loves_dbt - meta: - my_meta: 'testing' -""" - -names_with_spaces_metrics_yml = """ -version: 2 - -metrics: - - - name: number of people - label: "Number of people" - description: Total count of people - type: simple - type_params: - measure: people - meta: - my_meta: 'testing' - -""" - -names_with_special_chars_metrics_yml = """ -version: 2 - -metrics: - - - name: number_of_people! - label: "Number of people" - description: Total count of people - type: simple - type_params: - measure: people - meta: - my_meta: 'testing' - -""" - - -names_with_leading_numeric_metrics_yml = """ -version: 2 - -metrics: - - - name: 1_number_of_people - label: "Number of people" - description: Total count of people - type: simple - type_params: - measure: people - meta: - my_meta: 'testing' - -""" - -long_name_metrics_yml = """ -version: 2 - -metrics: - - - name: this_name_is_going_to_contain_more_than_250_characters_but_be_otherwise_acceptable_and_then_will_throw_an_error_which_I_expect_to_happen_and_repeat_this_name_is_going_to_contain_more_than_250_characters_but_be_otherwise_acceptable_and_then_will_throw_an_error_which_I_expect_to_happen - label: "Number of people" - description: Total count of people - type: simple - type_params: - measure: people - meta: - my_meta: 'testing' - -""" - -downstream_model_sql = """ --- this model will depend on these three metrics -{% set some_metrics = [ - metric('count_orders'), - metric('sum_order_revenue'), - metric('average_order_value') -] %} - -/* -{% if not execute %} - - -- the only properties available to us at 'parse' time are: - -- 'metric_name' - -- 'package_name' (None if same package) - - {% set metric_names = [] %} - {% for m in some_metrics %} - {% do metric_names.append(m.metric_name) %} - {% endfor %} - - -- this config does nothing, but it lets us check these values below - {{ config(metric_names = metric_names) }} - -{% else %} - - -- these are the properties available to us at 'execution' time - - {% for m in some_metrics %} - name: {{ m.name }} - label: {{ m.label }} - type: {{ m.type }} - type_params: {{ m.type_params }} - filter: {{ m.filter }} - {% endfor %} - -{% endif %} - -select 1 as id -""" - -invalid_derived_metric_contains_model_yml = """ -version: 2 -metrics: - - name: count_orders - label: Count orders - model: ref('mock_purchase_data') - - calculation_method: count - expression: "*" - timestamp: purchased_at - time_grains: [day, week, month, quarter, year] - - dimensions: - - payment_type - - - name: sum_order_revenue - label: Total order revenue - model: ref('mock_purchase_data') - - calculation_method: sum - expression: "payment_total" - timestamp: purchased_at - time_grains: [day, week, month, quarter, year] - - dimensions: - - payment_type - - - name: average_order_value - label: Average Order Value - - calculation_method: derived - expression: "{{metric('sum_order_revenue')}} / {{metric('count_orders')}} " - model: ref('mock_purchase_data') - timestamp: purchased_at - time_grains: [day, week, month, quarter, year] - - dimensions: - - payment_type -""" - -purchasing_model_sql = """ -select purchased_at, payment_type, payment_total from {{ ref('mock_purchase_data') }} -""" - -semantic_model_purchasing_yml = """ -version: 2 - -semantic_models: - - name: semantic_purchasing - model: ref('purchasing') - measures: - - name: num_orders - agg: COUNT - expr: purchased_at - - name: order_revenue - agg: SUM - expr: payment_total - dimensions: - - name: purchased_at - type: TIME - entities: - - name: purchase - type: primary - expr: '1' - defaults: - agg_time_dimension: purchased_at - -""" - -derived_metric_yml = """ -version: 2 -metrics: - - name: count_orders - label: Count orders - type: simple - type_params: - measure: num_orders - - - name: sum_order_revenue - label: Total order revenue - type: simple - type_params: - measure: order_revenue - - - name: average_order_value - label: Average Order Value - type: ratio - type_params: - numerator: - name: sum_order_revenue - denominator: - name: count_orders -""" - -disabled_metric_level_schema_yml = """ -version: 2 - -metrics: - - - name: number_of_people - label: "Number of people" - description: Total count of people - type: simple - type_params: - measure: people - config: - enabled: False - meta: - my_meta: 'testing' - - - name: collective_tenure - label: "Collective tenure" - description: Total number of years of team experience - type: simple - type_params: - measure: - name: years_tenure - filter: "{{ Dimension('id__loves_dbt') }} is true" - -""" - -enabled_metric_level_schema_yml = """ -version: 2 - -metrics: - - - name: number_of_people - label: "Number of people" - description: Total count of people - type: simple - type_params: - measure: people - config: - enabled: True - meta: - my_meta: 'testing' - - - name: collective_tenure - label: "Collective tenure" - description: Total number of years of team experience - type: simple - type_params: - measure: - name: years_tenure - filter: "{{ Dimension('id__loves_dbt') }} is true" - -""" - -models_people_metrics_sql = """ --- this model will depend on these two metrics -{% set some_metrics = [ - metric('number_of_people'), - metric('collective_tenure') -] %} - -/* -{% if not execute %} - - -- the only properties available to us at 'parse' time are: - -- 'metric_name' - -- 'package_name' (None if same package) - - {% set metric_names = [] %} - {% for m in some_metrics %} - {% do metric_names.append(m.metric_name) %} - {% endfor %} - - -- this config does nothing, but it lets us check these values below - {{ config(metric_names = metric_names) }} - -{% else %} - - -- these are the properties available to us at 'execution' time - - {% for m in some_metrics %} - name: {{ m.name }} - label: {{ m.label }} - type: {{ m.type }} - type_params: {{ m.type_params }} - filter: {{ m.filter }} - window: {{ m.window }} - {% endfor %} - -{% endif %} - -select 1 as id -""" - -metrics_1_yml = """ -version: 2 - -metrics: - - name: some_metric - label: Some Metric - type: simple - type_params: - measure: some_measure -""" - -metrics_2_yml = """ -version: 2 - -metrics: - - name: some_metric - label: Some Metric - type: simple - type_params: - measure: some_measure -""" - -model_a_sql = """ -select 1 as fun -""" - -model_b_sql = """ --- {{ metric('some_metric') }} - -{% if execute %} - {% set model_ref_node = graph.nodes.values() | selectattr('name', 'equalto', 'model_a') | first %} - {% set relation = api.Relation.create( - database = model_ref_node.database, - schema = model_ref_node.schema, - identifier = model_ref_node.alias - ) - %} -{% else %} - {% set relation = "" %} -{% endif %} - --- this one is a real ref -select * from {{ ref('model_a') }} -union all --- this one is synthesized via 'graph' var -select * from {{ relation }} -""" - -invalid_config_metric_yml = """ -version: 2 - -metrics: - - name: number_of_people - label: "Number of people" - config: - enabled: True and False - description: Total count of people - type: simple - type_params: - measure: people - meta: - my_meta: 'testing' -""" - -invalid_metric_without_timestamp_with_time_grains_yml = """ -version: 2 - -metrics: - - name: number_of_people - label: "Number of people" - description: Total count of people - model: "ref('people')" - time_grains: [day, week, month] - calculation_method: count - expression: "*" - dimensions: - - favorite_color - - loves_dbt - meta: - my_meta: 'testing' -""" - -invalid_metric_without_timestamp_with_window_yml = """ -version: 2 - -metrics: - - name: number_of_people - label: "Number of people" - description: Total count of people - model: "ref('people')" - window: - count: 14 - period: day - calculation_method: count - expression: "*" - dimensions: - - favorite_color - - loves_dbt - meta: - my_meta: 'testing' -""" - -conversion_semantic_model_purchasing_yml = """ -version: 2 - -semantic_models: - - name: semantic_purchasing - model: ref('purchasing') - measures: - - name: num_orders - agg: COUNT - expr: purchased_at - - name: num_visits - agg: SUM - expr: 1 - dimensions: - - name: purchased_at - type: TIME - entities: - - name: purchase - type: primary - expr: '1' - defaults: - agg_time_dimension: purchased_at - -""" - -conversion_metric_yml = """ -version: 2 -metrics: - - name: converted_orders_over_visits - label: Number of orders converted from visits - type: conversion - type_params: - conversion_type_params: - base_measure: num_visits - conversion_measure: num_orders - entity: purchase -""" diff --git a/tests/functional/metrics/test_metric_configs.py b/tests/functional/metrics/test_metric_configs.py deleted file mode 100644 index f4b75015..00000000 --- a/tests/functional/metrics/test_metric_configs.py +++ /dev/null @@ -1,206 +0,0 @@ -from dbt.contracts.graph.model_config import MetricConfig -from dbt.exceptions import ParsingError -from dbt.tests.util import get_manifest, run_dbt, update_config_file -from dbt_common.dataclass_schema import ValidationError -from dbt_common.exceptions import CompilationError -import pytest - -from tests.functional.metrics.fixtures import ( - disabled_metric_level_schema_yml, - enabled_metric_level_schema_yml, - invalid_config_metric_yml, - metricflow_time_spine_sql, - models_people_metrics_sql, - models_people_metrics_yml, - models_people_sql, - semantic_model_people_yml, -) - - -class MetricConfigTests: - @pytest.fixture(scope="class", autouse=True) - def setUp(self): - pytest.expected_config = MetricConfig( - enabled=True, - ) - - -# Test enabled config in dbt_project.yml -class TestMetricEnabledConfigProjectLevel(MetricConfigTests): - @pytest.fixture(scope="class") - def models(self): - return { - "people.sql": models_people_sql, - "metricflow_time_spine.sql": metricflow_time_spine_sql, - "semantic_model_people.yml": semantic_model_people_yml, - "schema.yml": models_people_metrics_yml, - } - - @pytest.fixture(scope="class") - def project_config_update(self): - return { - "metrics": { - "average_tenure_minus_people": { - "enabled": True, - }, - } - } - - def test_enabled_metric_config_dbt_project(self, project): - run_dbt(["parse"]) - manifest = get_manifest(project.project_root) - assert "metric.test.average_tenure_minus_people" in manifest.metrics - - new_enabled_config = { - "metrics": { - "test": { - "average_tenure_minus_people": { - "enabled": False, - }, - } - } - } - update_config_file(new_enabled_config, project.project_root, "dbt_project.yml") - run_dbt(["parse"]) - manifest = get_manifest(project.project_root) - assert "metric.test.average_tenure_minus_people" not in manifest.metrics - assert "metric.test.collective_tenure" in manifest.metrics - - -# Test enabled config at metrics level in yml file -class TestConfigYamlMetricLevel(MetricConfigTests): - @pytest.fixture(scope="class") - def models(self): - return { - "people.sql": models_people_sql, - "metricflow_time_spine.sql": metricflow_time_spine_sql, - "semantic_model_people.yml": semantic_model_people_yml, - "schema.yml": disabled_metric_level_schema_yml, - } - - def test_metric_config_yaml_metric_level(self, project): - run_dbt(["parse"]) - manifest = get_manifest(project.project_root) - assert "metric.test.number_of_people" not in manifest.metrics - assert "metric.test.collective_tenure" in manifest.metrics - - -# Test inheritence - set configs at project and metric level - expect metric level to win -class TestMetricConfigsInheritence(MetricConfigTests): - @pytest.fixture(scope="class") - def models(self): - return { - "people.sql": models_people_sql, - "metricflow_time_spine.sql": metricflow_time_spine_sql, - "semantic_model_people.yml": semantic_model_people_yml, - "schema.yml": enabled_metric_level_schema_yml, - } - - @pytest.fixture(scope="class") - def project_config_update(self): - return {"metrics": {"enabled": False}} - - def test_metrics_all_configs(self, project): - run_dbt(["parse"]) - manifest = get_manifest(project.project_root) - # This should be overridden - assert "metric.test.number_of_people" in manifest.metrics - # This should stay disabled - assert "metric.test.collective_tenure" not in manifest.metrics - - config_test_table = manifest.metrics.get("metric.test.number_of_people").config - - assert isinstance(config_test_table, MetricConfig) - assert config_test_table == pytest.expected_config - - -# Test CompilationError if a model references a disabled metric -class TestDisabledMetricRef(MetricConfigTests): - @pytest.fixture(scope="class") - def models(self): - return { - "people.sql": models_people_sql, - "metricflow_time_spine.sql": metricflow_time_spine_sql, - "semantic_model_people.yml": semantic_model_people_yml, - "people_metrics.sql": models_people_metrics_sql, - "schema.yml": models_people_metrics_yml, - } - - def test_disabled_metric_ref_model(self, project): - run_dbt(["parse"]) - manifest = get_manifest(project.project_root) - assert "metric.test.number_of_people" in manifest.metrics - assert "metric.test.collective_tenure" in manifest.metrics - assert "model.test.people_metrics" in manifest.nodes - assert "metric.test.average_tenure" in manifest.metrics - assert "metric.test.average_tenure_minus_people" in manifest.metrics - - new_enabled_config = { - "metrics": { - "test": { - "number_of_people": { - "enabled": False, - }, - "average_tenure_minus_people": { - "enabled": False, - }, - "average_tenure": { - "enabled": False, - }, - } - } - } - - update_config_file(new_enabled_config, project.project_root, "dbt_project.yml") - with pytest.raises(CompilationError): - run_dbt(["parse"]) - - -# Test invalid metric configs -class TestInvalidMetric(MetricConfigTests): - @pytest.fixture(scope="class") - def models(self): - return { - "people.sql": models_people_sql, - "metricflow_time_spine.sql": metricflow_time_spine_sql, - "semantic_model_people.yml": semantic_model_people_yml, - "schema.yml": invalid_config_metric_yml, - } - - def test_invalid_config_metric(self, project): - with pytest.raises(ValidationError) as excinfo: - run_dbt(["parse"]) - expected_msg = "'True and False' is not of type 'boolean'" - assert expected_msg in str(excinfo.value) - - -class TestDisabledMetric(MetricConfigTests): - @pytest.fixture(scope="class") - def models(self): - return { - "people.sql": models_people_sql, - "metricflow_time_spine.sql": metricflow_time_spine_sql, - "semantic_model_people.yml": semantic_model_people_yml, - "schema.yml": models_people_metrics_yml, - } - - def test_disabling_upstream_metric_errors(self, project): - run_dbt(["parse"]) # shouldn't error out yet - - new_enabled_config = { - "metrics": { - "test": { - "number_of_people": { - "enabled": False, - }, - } - } - } - - update_config_file(new_enabled_config, project.project_root, "dbt_project.yml") - with pytest.raises(ParsingError) as excinfo: - run_dbt(["parse"]) - expected_msg = ( - "The metric `number_of_people` is disabled and thus cannot be referenced." - ) - assert expected_msg in str(excinfo.value) diff --git a/tests/functional/metrics/test_metric_deferral.py b/tests/functional/metrics/test_metric_deferral.py deleted file mode 100644 index 11affcd0..00000000 --- a/tests/functional/metrics/test_metric_deferral.py +++ /dev/null @@ -1,83 +0,0 @@ -import os -from pathlib import Path - -from dbt.tests.util import copy_file, run_dbt, write_file -import pytest - -from tests.functional.metrics.fixtures import ( - metrics_1_yml, - metrics_2_yml, - model_a_sql, - model_b_sql, -) - - -class TestMetricDeferral: - @pytest.fixture(scope="class", autouse=True) - def setup(self, project): - # Create "prod" schema - prod_schema_name = project.test_schema + "_prod" - project.create_test_schema(schema_name=prod_schema_name) - # Create "state" directory - path = Path(project.project_root) / "state" - Path.mkdir(path) - - @pytest.fixture(scope="class") - def dbt_profile_data(self, unique_schema): - return { - "test": { - "outputs": { - "default": { - "type": "postgres", - "threads": 4, - "host": "localhost", - "port": int(os.getenv("POSTGRES_TEST_PORT", 5432)), - "user": os.getenv("POSTGRES_TEST_USER", "root"), - "pass": os.getenv("POSTGRES_TEST_PASS", "password"), - "dbname": os.getenv("POSTGRES_TEST_DATABASE", "dbt"), - "schema": unique_schema, - }, - "prod": { - "type": "postgres", - "threads": 4, - "host": "localhost", - "port": int(os.getenv("POSTGRES_TEST_PORT", 5432)), - "user": os.getenv("POSTGRES_TEST_USER", "root"), - "pass": os.getenv("POSTGRES_TEST_PASS", "password"), - "dbname": os.getenv("POSTGRES_TEST_DATABASE", "dbt"), - "schema": unique_schema + "_prod", - }, - }, - "target": "default", - }, - } - - @pytest.fixture(scope="class") - def models(self): - return { - "model_a.sql": model_a_sql, - "model_b.sql": model_b_sql, - "metrics.yml": metrics_1_yml, - } - - @pytest.mark.skip("TODO") - def test_metric_deferral(self, project): - results = run_dbt(["run", "--target", "prod"]) - assert len(results) == 2 - - # copy manifest.json to "state" directory - target_path = os.path.join(project.project_root, "target") - copy_file(target_path, "manifest.json", project.project_root, ["state", "manifest.json"]) - - # Change metrics file - write_file(metrics_2_yml, project.project_root, "models", "metrics.yml") - - # Confirm that some_metric + model_b are both selected, and model_a is not selected - results = run_dbt(["ls", "-s", "state:modified+", "--state", "state/", "--target", "prod"]) - assert results == ["metric:test.some_metric", "test.model_b"] - - # Run in default schema - results = run_dbt( - ["run", "-s", "state:modified+", "--state", "state/", "--defer", "--target", "default"] - ) - assert len(results) == 1 diff --git a/tests/functional/metrics/test_metric_helper_functions.py b/tests/functional/metrics/test_metric_helper_functions.py deleted file mode 100644 index 7f12232a..00000000 --- a/tests/functional/metrics/test_metric_helper_functions.py +++ /dev/null @@ -1,53 +0,0 @@ -from dbt.contracts.graph.manifest import Manifest -from dbt.contracts.graph.metrics import ResolvedMetricReference -from dbt.tests.util import run_dbt -import pytest - -from tests.functional.metrics.fixtures import ( - basic_metrics_yml, - metricflow_time_spine_sql, - models_people_sql, - semantic_model_people_yml, -) - - -class TestMetricHelperFunctions: - @pytest.fixture(scope="class") - def models(self): - return { - "metrics.yml": basic_metrics_yml, - "semantic_people.yml": semantic_model_people_yml, - "metricflow_time_spine.sql": metricflow_time_spine_sql, - "people.sql": models_people_sql, - } - - def test_derived_metric( - self, - project, - ): - # initial parse - manifest = run_dbt(["parse"]) - assert isinstance(manifest, Manifest) - - parsed_metric = manifest.metrics["metric.test.average_tenure_plus_one"] - testing_metric = ResolvedMetricReference(parsed_metric, manifest) - - full_metric_dependency = set(testing_metric.full_metric_dependency()) - expected_full_metric_dependency = set( - ["average_tenure_plus_one", "average_tenure", "collective_tenure", "number_of_people"] - ) - assert full_metric_dependency == expected_full_metric_dependency - - base_metric_dependency = set(testing_metric.base_metric_dependency()) - expected_base_metric_dependency = set(["collective_tenure", "number_of_people"]) - assert base_metric_dependency == expected_base_metric_dependency - - derived_metric_dependency = set(testing_metric.derived_metric_dependency()) - expected_derived_metric_dependency = set(["average_tenure_plus_one", "average_tenure"]) - assert derived_metric_dependency == expected_derived_metric_dependency - - derived_metric_dependency_depth = list(testing_metric.derived_metric_dependency_depth()) - expected_derived_metric_dependency_depth = list( - [{"average_tenure_plus_one": 1}, {"average_tenure": 2}] - ) - assert derived_metric_dependency_depth == expected_derived_metric_dependency_depth diff --git a/tests/functional/metrics/test_metrics.py b/tests/functional/metrics/test_metrics.py deleted file mode 100644 index 1275e47a..00000000 --- a/tests/functional/metrics/test_metrics.py +++ /dev/null @@ -1,399 +0,0 @@ -from dbt.cli.main import dbtRunner -from dbt.contracts.graph.manifest import Manifest -from dbt.exceptions import ParsingError -from dbt.tests.util import get_manifest, run_dbt -import pytest - -from tests.functional.metrics.fixtures import ( - conversion_metric_yml, - conversion_semantic_model_purchasing_yml, - derived_metric_yml, - downstream_model_sql, - invalid_derived_metric_contains_model_yml, - invalid_metric_without_timestamp_with_time_grains_yml, - invalid_metric_without_timestamp_with_window_yml, - invalid_metrics_missing_expression_yml, - invalid_metrics_missing_model_yml, - invalid_models_people_metrics_yml, - long_name_metrics_yml, - metricflow_time_spine_sql, - mock_purchase_data_csv, - models_people_metrics_yml, - models_people_sql, - names_with_leading_numeric_metrics_yml, - names_with_spaces_metrics_yml, - names_with_special_chars_metrics_yml, - purchasing_model_sql, - semantic_model_people_yml, - semantic_model_purchasing_yml, -) - - -class TestSimpleMetrics: - @pytest.fixture(scope="class") - def models(self): - return { - "people_metrics.yml": models_people_metrics_yml, - "metricflow_time_spine.sql": metricflow_time_spine_sql, - "semantic_model_people.yml": semantic_model_people_yml, - "people.sql": models_people_sql, - } - - def test_simple_metric( - self, - project, - ): - runner = dbtRunner() - result = runner.invoke(["parse"]) - assert result.success - assert isinstance(result.result, Manifest) - manifest = get_manifest(project.project_root) - metric_ids = list(manifest.metrics.keys()) - expected_metric_ids = [ - "metric.test.number_of_people", - "metric.test.collective_tenure", - "metric.test.collective_window", - "metric.test.average_tenure", - "metric.test.average_tenure_minus_people", - ] - assert metric_ids == expected_metric_ids - - assert ( - len(manifest.metrics["metric.test.number_of_people"].type_params.input_measures) == 1 - ) - assert ( - len(manifest.metrics["metric.test.collective_tenure"].type_params.input_measures) == 1 - ) - assert ( - len(manifest.metrics["metric.test.collective_window"].type_params.input_measures) == 1 - ) - assert len(manifest.metrics["metric.test.average_tenure"].type_params.input_measures) == 2 - assert ( - len( - manifest.metrics[ - "metric.test.average_tenure_minus_people" - ].type_params.input_measures - ) - == 3 - ) - - -class TestInvalidRefMetrics: - @pytest.fixture(scope="class") - def models(self): - return { - "people_metrics.yml": invalid_models_people_metrics_yml, - "people.sql": models_people_sql, - } - - # tests that we get a ParsingError with an invalid model ref, where - # the model name does not have quotes - def test_simple_metric( - self, - project, - ): - # initial run - with pytest.raises(ParsingError): - run_dbt(["run"]) - - -class TestInvalidMetricMissingModel: - @pytest.fixture(scope="class") - def models(self): - return { - "people_metrics.yml": invalid_metrics_missing_model_yml, - "people.sql": models_people_sql, - } - - # tests that we get a ParsingError with an invalid model ref, where - # the model name does not have quotes - def test_simple_metric( - self, - project, - ): - # initial run - with pytest.raises(ParsingError): - run_dbt(["run"]) - - -class TestInvalidMetricMissingExpression: - @pytest.fixture(scope="class") - def models(self): - return { - "people_metrics.yml": invalid_metrics_missing_expression_yml, - "people.sql": models_people_sql, - } - - # tests that we get a ParsingError with a missing expression - def test_simple_metric( - self, - project, - ): - # initial run - with pytest.raises(ParsingError): - run_dbt(["run"]) - - -class TestNamesWithSpaces: - @pytest.fixture(scope="class") - def models(self): - return { - "people_metrics.yml": names_with_spaces_metrics_yml, - "people.sql": models_people_sql, - } - - def test_names_with_spaces(self, project): - with pytest.raises(ParsingError) as exc: - run_dbt(["run"]) - assert "cannot contain spaces" in str(exc.value) - - -class TestNamesWithSpecialChar: - @pytest.fixture(scope="class") - def models(self): - return { - "people_metrics.yml": names_with_special_chars_metrics_yml, - "people.sql": models_people_sql, - } - - def test_names_with_special_char(self, project): - with pytest.raises(ParsingError) as exc: - run_dbt(["run"]) - assert "must contain only letters, numbers and underscores" in str(exc.value) - - -class TestNamesWithLeandingNumber: - @pytest.fixture(scope="class") - def models(self): - return { - "people_metrics.yml": names_with_leading_numeric_metrics_yml, - "people.sql": models_people_sql, - } - - def test_names_with_leading_number(self, project): - with pytest.raises(ParsingError) as exc: - run_dbt(["run"]) - assert "must begin with a letter" in str(exc.value) - - -class TestLongName: - @pytest.fixture(scope="class") - def models(self): - return { - "people_metrics.yml": long_name_metrics_yml, - "people.sql": models_people_sql, - } - - def test_long_name(self, project): - with pytest.raises(ParsingError) as exc: - run_dbt(["run"]) - assert "cannot contain more than 250 characters" in str(exc.value) - - -class TestInvalidDerivedMetrics: - @pytest.fixture(scope="class") - def models(self): - return { - "derived_metric.yml": invalid_derived_metric_contains_model_yml, - "downstream_model.sql": downstream_model_sql, - } - - def test_invalid_derived_metrics(self, project): - with pytest.raises(ParsingError): - run_dbt(["run"]) - - -class TestMetricDependsOn: - @pytest.fixture(scope="class") - def models(self): - return { - "people.sql": models_people_sql, - "metricflow_time_spine.sql": metricflow_time_spine_sql, - "semantic_models.yml": semantic_model_people_yml, - "people_metrics.yml": models_people_metrics_yml, - } - - def test_metric_depends_on(self, project): - manifest = run_dbt(["parse"]) - assert isinstance(manifest, Manifest) - - expected_depends_on_for_number_of_people = ["semantic_model.test.semantic_people"] - expected_depends_on_for_average_tenure = [ - "metric.test.collective_tenure", - "metric.test.number_of_people", - ] - - number_of_people_metric = manifest.metrics["metric.test.number_of_people"] - assert number_of_people_metric.depends_on.nodes == expected_depends_on_for_number_of_people - - average_tenure_metric = manifest.metrics["metric.test.average_tenure"] - assert average_tenure_metric.depends_on.nodes == expected_depends_on_for_average_tenure - - -class TestDerivedMetric: - @pytest.fixture(scope="class") - def models(self): - return { - "downstream_model.sql": downstream_model_sql, - "purchasing.sql": purchasing_model_sql, - "metricflow_time_spine.sql": metricflow_time_spine_sql, - "semantic_models.yml": semantic_model_purchasing_yml, - "derived_metric.yml": derived_metric_yml, - } - - # not strictly necessary to use "real" mock data for this test - # we just want to make sure that the 'metric' calls match our expectations - # but this sort of thing is possible, to have actual data flow through and validate results - @pytest.fixture(scope="class") - def seeds(self): - return { - "mock_purchase_data.csv": mock_purchase_data_csv, - } - - def test_derived_metric( - self, - project, - ): - # initial parse - results = run_dbt(["parse"]) - - # make sure all the metrics are in the manifest - manifest = get_manifest(project.project_root) - metric_ids = list(manifest.metrics.keys()) - expected_metric_ids = [ - "metric.test.count_orders", - "metric.test.sum_order_revenue", - "metric.test.average_order_value", - ] - assert metric_ids == expected_metric_ids - - # make sure the downstream_model depends on these metrics - metric_names = ["average_order_value", "count_orders", "sum_order_revenue"] - downstream_model = manifest.nodes["model.test.downstream_model"] - assert sorted(downstream_model.metrics) == [[metric_name] for metric_name in metric_names] - assert sorted(downstream_model.depends_on.nodes) == [ - "metric.test.average_order_value", - "metric.test.count_orders", - "metric.test.sum_order_revenue", - ] - assert sorted(downstream_model.config["metric_names"]) == metric_names - - # make sure the 'expression' metric depends on the two upstream metrics - derived_metric = manifest.metrics["metric.test.average_order_value"] - assert sorted(derived_metric.depends_on.nodes) == [ - "metric.test.count_orders", - "metric.test.sum_order_revenue", - ] - - # actually compile - results = run_dbt(["compile", "--select", "downstream_model"]) - compiled_code = results[0].node.compiled_code - - # make sure all these metrics properties show up in compiled SQL - for metric_name in manifest.metrics: - parsed_metric_node = manifest.metrics[metric_name] - for property in [ - "name", - "label", - "type", - "type_params", - "filter", - ]: - expected_value = getattr(parsed_metric_node, property) - assert f"{property}: {expected_value}" in compiled_code - - -class TestInvalidTimestampTimeGrainsMetrics: - @pytest.fixture(scope="class") - def models(self): - return { - "people_metrics.yml": invalid_metric_without_timestamp_with_time_grains_yml, - "people.sql": models_people_sql, - } - - # Tests that we get a ParsingError with an invalid metric definition. - # This metric definition is missing timestamp but HAS a time_grains property - def test_simple_metric( - self, - project, - ): - # initial run - with pytest.raises(ParsingError): - run_dbt(["run"]) - - -class TestInvalidTimestampWindowMetrics: - @pytest.fixture(scope="class") - def models(self): - return { - "people_metrics.yml": invalid_metric_without_timestamp_with_window_yml, - "people.sql": models_people_sql, - } - - # Tests that we get a ParsingError with an invalid metric definition. - # This metric definition is missing timestamp but HAS a window property - def test_simple_metric( - self, - project, - ): - # initial run - with pytest.raises(ParsingError): - run_dbt(["run"]) - - -class TestConversionMetric: - @pytest.fixture(scope="class") - def models(self): - return { - "purchasing.sql": purchasing_model_sql, - "metricflow_time_spine.sql": metricflow_time_spine_sql, - "semantic_models.yml": conversion_semantic_model_purchasing_yml, - "conversion_metric.yml": conversion_metric_yml, - } - - @pytest.fixture(scope="class") - def seeds(self): - return { - "mock_purchase_data.csv": mock_purchase_data_csv, - } - - def test_conversion_metric( - self, - project, - ): - # initial parse - runner = dbtRunner() - result = runner.invoke(["parse"]) - assert result.success - assert isinstance(result.result, Manifest) - - # make sure the metric is in the manifest - manifest = get_manifest(project.project_root) - metric_ids = list(manifest.metrics.keys()) - expected_metric_ids = [ - "metric.test.converted_orders_over_visits", - ] - assert metric_ids == expected_metric_ids - assert manifest.metrics[ - "metric.test.converted_orders_over_visits" - ].type_params.conversion_type_params - assert ( - len( - manifest.metrics[ - "metric.test.converted_orders_over_visits" - ].type_params.input_measures - ) - == 2 - ) - assert ( - manifest.metrics[ - "metric.test.converted_orders_over_visits" - ].type_params.conversion_type_params.window - is None - ) - assert ( - manifest.metrics[ - "metric.test.converted_orders_over_visits" - ].type_params.conversion_type_params.entity - == "purchase" - )