From b36acd3ee252a5d438286bd0d553e087570899d1 Mon Sep 17 00:00:00 2001 From: Brandon Nguyen <112731698+bxngyn@users.noreply.github.com> Date: Mon, 21 Jul 2025 13:03:57 -0400 Subject: [PATCH 1/3] add dupe emma watson to check --- movies/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/movies/__init__.py b/movies/__init__.py index a9d7171b..7ed2c72a 100644 --- a/movies/__init__.py +++ b/movies/__init__.py @@ -125,6 +125,7 @@ def test9(): "Rupert Grint", "Daniel Radcliffe", "Emma Watson", + "Emma Watson", ], ordered=True, ) @@ -221,7 +222,6 @@ def check_single_col(actual, expected, ordered=False): # Get data from column try: result = [str(list(row.values())[0]) for row in actual] - result = result if ordered else set(result) except IndexError: return None @@ -230,7 +230,8 @@ def check_single_col(actual, expected, ordered=False): # If unordered, sort both before checking if not ordered: - expected = set(expected) + result.sort() + expected.sort() if result != expected: raise check50.Mismatch("\n".join(expected), "\n".join(list(result))) From f85cf2ca3b26b4101b610dcf01e91c436a54a645 Mon Sep 17 00:00:00 2001 From: Brandon Nguyen <112731698+bxngyn@users.noreply.github.com> Date: Mon, 21 Jul 2025 13:05:02 -0400 Subject: [PATCH 2/3] add dupe emma watson to db --- movies/movies.db | Bin 24576 -> 24576 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/movies/movies.db b/movies/movies.db index 2c234922ff0a27b187af2d35655cf4d60385bdb5..5924879995ea59cd5b349a403b17b1f79e11e59a 100644 GIT binary patch delta 94 zcmV-k0HObYzyW~30gxL3=#d;l1?T`SZo08#pdSM!42_cqAWH%ajj@3_3>6b51OOuy zMQv?iAXi~@b8l`jIXF49qAX$q13wN*lLs(;0uD;E5kSNZ2L(R^0Ragnvr#^;A#>Uq A{{R30 delta 58 zcmV-A0LA}+zyW~30gxL3=8+sj1?B)QS4y#DpdSMz45E_ Date: Mon, 21 Jul 2025 14:16:08 -0400 Subject: [PATCH 3/3] add id output for 9.sql --- movies/__init__.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/movies/__init__.py b/movies/__init__.py index 7ed2c72a..1d9c1bf1 100644 --- a/movies/__init__.py +++ b/movies/__init__.py @@ -114,18 +114,18 @@ def test8(): @check50.check(exists) def test9(): """9.sql produces correct result""" - check_single_col( + check_double_col( run_query("9.sql"), [ - "Craig T. Nelson", - "Richard Griffifths", - "Samuel L. Jackson", - "Holly Hunter", - "Jason Lee", - "Rupert Grint", - "Daniel Radcliffe", - "Emma Watson", - "Emma Watson", + {"Craig T. Nelson", "33"}, + {"Richard Griffifths", "34"}, + {"Samuel L. Jackson", "30"}, + {"Holly Hunter", "31"}, + {"Jason Lee", "32"}, + {"Rupert Grint", "35"}, + {"Daniel Radcliffe", "36"}, + {"Emma Watson", "38"}, + {"Emma Watson", "11"}, ], ordered=True, )