From c23fcad4495b06cab8a486e4db000a38526f7e66 Mon Sep 17 00:00:00 2001 From: R-Palazzo Date: Thu, 3 Sep 2026 17:48:22 +0100 Subject: [PATCH 1/4] def 2956 --- sdv/datasets/demo.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sdv/datasets/demo.py b/sdv/datasets/demo.py index 0589541f8..1512d1f5c 100644 --- a/sdv/datasets/demo.py +++ b/sdv/datasets/demo.py @@ -224,6 +224,12 @@ def is_direct_json_under_prefix(key): raw = _get_data_from_bucket(key, bucket=bucket, client=client) metadict = json.loads(raw) if isinstance(metadict, dict) and metadict.get('METADATA_SPEC_VERSION') == version: + if version != 'V2': + warnings.warn( + 'An updated metadata V2 is not available for this dataset so the V1 ' + 'metadata was returned.\nYou should be able to model and sample with' + ' the V1 metadata, but please report this issue to the DataCebo.' + ) return raw except Exception: From 48a4d7d172c83b16f2f3ed3c0d1008f434c45260 Mon Sep 17 00:00:00 2001 From: R-Palazzo Date: Thu, 3 Sep 2026 17:48:35 +0100 Subject: [PATCH 2/4] unit test --- tests/unit/datasets/test_demo.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/unit/datasets/test_demo.py b/tests/unit/datasets/test_demo.py index ab1c93c54..1fdcd68de 100644 --- a/tests/unit/datasets/test_demo.py +++ b/tests/unit/datasets/test_demo.py @@ -417,6 +417,11 @@ def test__get_first_v2_metadata_bytes_falls_back_to_v1(mock_get): v2 = json.dumps({'METADATA_SPEC_VERSION': 'V1'}).encode() bad = b'not-json' v1 = json.dumps({'METADATA_SPEC_VERSION': 'V1'}).encode() + expected_warning = re.escape( + 'An updated metadata V2 is not available for this dataset so the V1 ' + 'metadata was returned.\nYou should be able to model and sample with' + ' the V1 metadata, but please report this issue to the DataCebo.' + ) def side_effect(key, bucket, client): return { @@ -433,9 +438,10 @@ def side_effect(key, bucket, client): ] # Run - got = _get_first_v2_metadata_bytes( - contents, 'single_table/dataset/', bucket='test_bucket', client=None - ) + with pytest.warns(UserWarning, match=expected_warning): + got = _get_first_v2_metadata_bytes( + contents, 'single_table/dataset/', bucket='test_bucket', client=None + ) # Assert assert got == v1 From 089381165b83c74cb5e6b1102e0d42782fb12fb4 Mon Sep 17 00:00:00 2001 From: R-Palazzo Date: Thu, 3 Sep 2026 17:48:42 +0100 Subject: [PATCH 3/4] integration test --- tests/integration/datasets/test_demo.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/integration/datasets/test_demo.py b/tests/integration/datasets/test_demo.py index 8799bc298..d1c347367 100644 --- a/tests/integration/datasets/test_demo.py +++ b/tests/integration/datasets/test_demo.py @@ -137,6 +137,20 @@ def test_download_demo_adventure_works_raises_warning(preprocess_mock): download_demo(modality='multi_table', dataset_name='adventure-works') +def test_download_demo_raise_warning_v2_metadata(): + """Test that a warning is raised if the V2 metadata is not available.""" + # Setup + expected_warning = re.escape( + 'An updated metadata V2 is not available for this dataset so the V1 ' + 'metadata was returned.\nYou should be able to model and sample with' + ' the V1 metadata, but please report this issue to the DataCebo.' + ) + + # Run and Assert + with pytest.warns(UserWarning, match=expected_warning): + download_demo(modality='single_table', dataset_name='fake_hotel_guests') + + def test_save_resource(tmp_path): """Test saving an arbitary demo resource.""" # Setup From d92ef8f457b01fd71fef8488a7a1cf1e7e60bb7c Mon Sep 17 00:00:00 2001 From: R-Palazzo Date: Fri, 4 Sep 2026 17:51:45 +0100 Subject: [PATCH 4/4] update message --- sdv/datasets/demo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdv/datasets/demo.py b/sdv/datasets/demo.py index 1512d1f5c..c6220af4f 100644 --- a/sdv/datasets/demo.py +++ b/sdv/datasets/demo.py @@ -227,8 +227,8 @@ def is_direct_json_under_prefix(key): if version != 'V2': warnings.warn( 'An updated metadata V2 is not available for this dataset so the V1 ' - 'metadata was returned.\nYou should be able to model and sample with' - ' the V1 metadata, but please report this issue to the DataCebo.' + 'metadata was returned.\nYou should be able to model and sample with ' + 'the V1 metadata, but please report this issue to the DataCebo.' ) return raw