|
18 | 18 | SafeSynthesizerParameters, |
19 | 19 | TrainingHyperparams, |
20 | 20 | ) |
21 | | -from nemo_safe_synthesizer.data_processing.validation import validate_groupby_column |
22 | | -from nemo_safe_synthesizer.errors import DataError, ParameterError |
| 21 | +from nemo_safe_synthesizer.errors import ParameterError |
23 | 22 | from nemo_safe_synthesizer.training.huggingface_backend import ( |
24 | 23 | HuggingFaceBackend, |
25 | 24 | compute_metrics, |
@@ -209,17 +208,6 @@ def sample_dataframe(): |
209 | 208 | ) |
210 | 209 |
|
211 | 210 |
|
212 | | -@pytest.fixture |
213 | | -def dataframe_with_null_group(): |
214 | | - """Create a DataFrame with null values in the group column.""" |
215 | | - return pd.DataFrame( |
216 | | - { |
217 | | - "col1": [1, 2, 3], |
218 | | - "group_col": ["g1", None, "g2"], |
219 | | - } |
220 | | - ) |
221 | | - |
222 | | - |
223 | 211 | class TestFilterModelKwargs: |
224 | 212 | def test_filters_trainer_specific_keys(self, backend): |
225 | 213 | """Test that trainer-specific keys are filtered out.""" |
@@ -561,31 +549,6 @@ def test_uses_provided_data_collator(self, backend): |
561 | 549 | assert "data_collator" not in training_args |
562 | 550 |
|
563 | 551 |
|
564 | | -class TestValidateGroupbyColumn: |
565 | | - def test_does_nothing_when_no_groupby(self, sample_dataframe): |
566 | | - """Test that nothing happens when groupby is None.""" |
567 | | - validate_groupby_column(sample_dataframe, None) # Should not raise |
568 | | - |
569 | | - def test_passes_when_column_exists(self, sample_dataframe): |
570 | | - """Test that validation passes when column exists.""" |
571 | | - validate_groupby_column(sample_dataframe, "group_col") # Should not raise |
572 | | - |
573 | | - def test_raises_when_column_missing(self, sample_dataframe): |
574 | | - """Test that ParameterError is raised when column is missing.""" |
575 | | - with pytest.raises(ParameterError, match="Group by column 'nonexistent_col' not found"): |
576 | | - validate_groupby_column(sample_dataframe, "nonexistent_col") |
577 | | - |
578 | | - def test_raises_with_comma_hint_when_column_has_comma(self, sample_dataframe): |
579 | | - """Test that ParameterError is raised when column name has a comma.""" |
580 | | - with pytest.raises(ParameterError, match="multi-column grouping is not supported"): |
581 | | - validate_groupby_column(sample_dataframe, "patient_id,event_id") |
582 | | - |
583 | | - def test_raises_when_column_has_nulls(self, dataframe_with_null_group): |
584 | | - """Test that DataError is raised when column has null values.""" |
585 | | - with pytest.raises(DataError, match="has missing values"): |
586 | | - validate_groupby_column(dataframe_with_null_group, "group_col") |
587 | | - |
588 | | - |
589 | 552 | class TestValidateOrderbyColumn: |
590 | 553 | def test_does_nothing_when_no_orderby(self, backend, sample_dataframe): |
591 | 554 | """Test that nothing happens when orderby is None.""" |
|
0 commit comments