@@ -263,10 +263,10 @@ def test__create_gaussian_normalizer_config(self, mock_rdt):
263263 assert config == expected_config
264264 assert mock_rdt .transformers .GaussianNormalizer .call_args_list == expected_calls
265265
266- @patch ('sdv.single_table.copulagan.LOGGER ' )
266+ @patch ('sdv.single_table.utils.warnings ' )
267267 @patch ('sdv.single_table.copulagan.CTGANSynthesizer._fit' )
268268 @patch ('sdv.single_table.copulagan.rdt' )
269- def test__fit_logging (self , mock_rdt , mock_ctgansynthesizer__fit , mock_logger ):
269+ def test__fit_logging (self , mock_rdt , mock_ctgansynthesizer__fit , mock_warnings ):
270270 """Test a message is logged.
271271
272272 A message should be logged if the columns passed in ``numerical_distributions``
@@ -284,10 +284,11 @@ def test__fit_logging(self, mock_rdt, mock_ctgansynthesizer__fit, mock_logger):
284284 instance ._fit (processed_data )
285285
286286 # Assert
287- mock_logger . info . assert_called_once_with (
288- "Requested distribution 'gamma' cannot be applied to column 'col' "
289- 'because it no longer exists after preprocessing .'
287+ warning_message = (
288+ "Cannot use distribution 'gamma' for column 'col' because the column is not "
289+ 'statistically modeled .'
290290 )
291+ mock_warnings .warn .assert_called_once_with (warning_message , UserWarning )
291292
292293 @patch ('sdv.single_table.copulagan.CTGANSynthesizer._fit' )
293294 @patch ('sdv.single_table.copulagan.rdt' )
0 commit comments