1- """Tests for the DuckDB settings feature."""
1+ """Tests for the settings feature."""
22
33import pyarrow as pa
44import pytest
@@ -35,7 +35,7 @@ def test_settings_accessor_returns_settings(self) -> None:
3535 invocation = make_invocation (
3636 function_name = "settings_aware" ,
3737 arguments = Arguments (positional = (pa .scalar (3 ),)),
38- duckdb_settings = {"vgi_verbose_mode" : "true" , "other" : "value" },
38+ settings = {"vgi_verbose_mode" : "true" , "other" : "value" },
3939 )
4040 func = SettingsAwareFunction (
4141 invocation = invocation ,
@@ -61,7 +61,7 @@ def test_get_setting_returns_value(self) -> None:
6161 invocation = make_invocation (
6262 function_name = "settings_aware" ,
6363 arguments = Arguments (positional = (pa .scalar (3 ),)),
64- duckdb_settings = {"vgi_verbose_mode" : "true" },
64+ settings = {"vgi_verbose_mode" : "true" },
6565 )
6666 func = SettingsAwareFunction (
6767 invocation = invocation ,
@@ -74,7 +74,7 @@ def test_output_schema_without_verbose(self) -> None:
7474 invocation = make_invocation (
7575 function_name = "settings_aware" ,
7676 arguments = Arguments (positional = (pa .scalar (3 ),)),
77- duckdb_settings = {"vgi_verbose_mode" : "false" },
77+ settings = {"vgi_verbose_mode" : "false" },
7878 )
7979 func = SettingsAwareFunction (
8080 invocation = invocation ,
@@ -88,7 +88,7 @@ def test_output_schema_with_verbose(self) -> None:
8888 invocation = make_invocation (
8989 function_name = "settings_aware" ,
9090 arguments = Arguments (positional = (pa .scalar (3 ),)),
91- duckdb_settings = {"vgi_verbose_mode" : "true" },
91+ settings = {"vgi_verbose_mode" : "true" },
9292 )
9393 func = SettingsAwareFunction (
9494 invocation = invocation ,
@@ -108,7 +108,7 @@ def test_settings_passed_to_function_verbose_false(self) -> None:
108108 client .table_function (
109109 function_name = "settings_aware" ,
110110 arguments = Arguments (positional = (pa .scalar (3 ),)),
111- duckdb_settings = {"vgi_verbose_mode" : "false" },
111+ settings = {"vgi_verbose_mode" : "false" },
112112 )
113113 )
114114
@@ -125,7 +125,7 @@ def test_settings_passed_to_function_verbose_true(self) -> None:
125125 client .table_function (
126126 function_name = "settings_aware" ,
127127 arguments = Arguments (positional = (pa .scalar (3 ),)),
128- duckdb_settings = {"vgi_verbose_mode" : "true" },
128+ settings = {"vgi_verbose_mode" : "true" },
129129 )
130130 )
131131
@@ -145,7 +145,7 @@ def test_missing_required_setting_fails(self) -> None:
145145 client .table_function (
146146 function_name = "settings_aware" ,
147147 arguments = Arguments (positional = (pa .scalar (3 ),)),
148- # No duckdb_settings provided
148+ # No settings provided
149149 )
150150 )
151151
@@ -167,14 +167,14 @@ def test_settings_roundtrip(self) -> None:
167167 function_type = InvocationType .TABLE ,
168168 correlation_id = "test" ,
169169 invocation_id = b"test-id" ,
170- duckdb_settings = {"TimeZone" : "UTC" , "threads" : "4" },
170+ settings = {"TimeZone" : "UTC" , "threads" : "4" },
171171 )
172172
173173 serialized = original .serialize ()
174174 batch = pa .ipc .open_stream (pa .py_buffer (serialized )).read_all ().to_batches ()[0 ]
175175 deserialized = Invocation .deserialize (batch )
176176
177- assert deserialized .duckdb_settings == {"TimeZone" : "UTC" , "threads" : "4" }
177+ assert deserialized .settings == {"TimeZone" : "UTC" , "threads" : "4" }
178178
179179 def test_none_settings_roundtrip (self ) -> None :
180180 """None settings should survive serialization."""
@@ -186,14 +186,14 @@ def test_none_settings_roundtrip(self) -> None:
186186 function_type = InvocationType .TABLE ,
187187 correlation_id = "test" ,
188188 invocation_id = b"test-id" ,
189- duckdb_settings = None ,
189+ settings = None ,
190190 )
191191
192192 serialized = original .serialize ()
193193 batch = pa .ipc .open_stream (pa .py_buffer (serialized )).read_all ().to_batches ()[0 ]
194194 deserialized = Invocation .deserialize (batch )
195195
196- assert deserialized .duckdb_settings is None
196+ assert deserialized .settings is None
197197
198198
199199class TestMetadataSerialization :
0 commit comments