@@ -91,11 +91,12 @@ def test_named_param(self):
9191 def test_named_param_not_dict (self ):
9292 con = duckdb .connect ()
9393
94- # The missing-parameter names come from an unordered set, so their order is not stable; match all three
95- # regardless of order.
94+ # Passing a list binds positionally as $1, $2, $3, which are excess against the named parameters in the
95+ # query. The excess-parameter names come from an unordered set, so their order is not stable; match all
96+ # three regardless of order.
9697 with pytest .raises (
9798 duckdb .InvalidInputException ,
98- match = r"prepared statement parameters: (?=.*\bname1 \b)(?=.*\bname2 \b)(?=.*\bname3 \b)" ,
99+ match = r"excess parameters: (?=.*\b1 \b)(?=.*\b2 \b)(?=.*\b3 \b)" ,
99100 ):
100101 con .execute ("select $name1, $name2, $name3" , ["name1" , "name2" , "name3" ])
101102
@@ -112,7 +113,7 @@ def test_named_param_not_exhaustive(self):
112113
113114 with pytest .raises (
114115 duckdb .InvalidInputException ,
115- match = "Invalid Input Error: Values were not provided for the following prepared statement parameters: name3" , # noqa: E501
116+ match = "Invalid Input Error: Values were not provided for the following parameters: name3" ,
116117 ):
117118 con .execute ("select $name1, $name2, $name3" , {"name1" : 5 , "name2" : 3 })
118119
@@ -121,17 +122,18 @@ def test_named_param_excessive(self):
121122
122123 with pytest .raises (
123124 duckdb .InvalidInputException ,
124- match = "Values were not provided for the following prepared statement parameters: name3 " ,
125+ match = "Parameter argument/count mismatch, identifiers of the excess parameters: not_a_named_param " ,
125126 ):
126127 con .execute ("select $name1, $name2, $name3" , {"name1" : 5 , "name2" : 3 , "not_a_named_param" : 5 })
127128
128129 def test_named_param_not_named (self ):
129130 con = duckdb .connect ()
130131
131- # Unordered set: match both missing parameters regardless of order.
132+ # Passing a dict for positional parameters makes name1/name2 excess. Unordered set: match both excess
133+ # parameters regardless of order.
132134 with pytest .raises (
133135 duckdb .InvalidInputException ,
134- match = r"prepared statement parameters: (?=.*\b1 \b)(?=.*\b2 \b)" ,
136+ match = r"excess parameters: (?=.*\bname1 \b)(?=.*\bname2 \b)" ,
135137 ):
136138 con .execute ("select $1, $1, $2" , {"name1" : 5 , "name2" : 3 })
137139
0 commit comments