@@ -2535,6 +2535,39 @@ def test_table_uuid_check_on_commit(rest_mock: Mocker, example_table_metadata_v2
25352535 assert f"refreshed={ different_uuid } " in str (exc_info .value )
25362536
25372537
2538+ def test_table_refresh_updates_config (rest_mock : Mocker , example_table_metadata_v2 : dict [str , Any ]) -> None :
2539+ metadata_location = "s3://warehouse/database/table/metadata.json"
2540+
2541+ rest_mock .get (
2542+ f"{ TEST_URI } v1/namespaces/namespace/tables/table_name" ,
2543+ json = {
2544+ "metadata-location" : metadata_location ,
2545+ "metadata" : example_table_metadata_v2 ,
2546+ "config" : {"original-key" : "original-value" },
2547+ },
2548+ status_code = 200 ,
2549+ request_headers = TEST_HEADERS ,
2550+ )
2551+
2552+ catalog = RestCatalog ("rest" , uri = TEST_URI , token = TEST_TOKEN )
2553+ table = catalog .load_table (("namespace" , "table_name" ))
2554+ assert table .config == {"original-key" : "original-value" }
2555+
2556+ rest_mock .get (
2557+ f"{ TEST_URI } v1/namespaces/namespace/tables/table_name" ,
2558+ json = {
2559+ "metadata-location" : metadata_location ,
2560+ "metadata" : example_table_metadata_v2 ,
2561+ "config" : {"updated-key" : "updated-value" },
2562+ },
2563+ status_code = 200 ,
2564+ request_headers = TEST_HEADERS ,
2565+ )
2566+
2567+ table .refresh ()
2568+ assert table .config == {"updated-key" : "updated-value" }
2569+
2570+
25382571def test_table_uuid_check_on_refresh (rest_mock : Mocker , example_table_metadata_v2 : dict [str , Any ]) -> None :
25392572 original_uuid = "9c12d441-03fe-4693-9a96-a0705ddf69c1"
25402573 different_uuid = "550e8400-e29b-41d4-a716-446655440000"
0 commit comments