Repository: sdv-dev/RDT

Issue:
BaseTransformer repr method showing parameters with default values
### Environment Details

* RDT version: v1.17.0
* Python version: 3.13
* Operating System: macos

### Error Description

When calling `repr(CustomTransformer(param=5))`, the returned string representation includes optional parameters. Based on the __repr__ logic, I would expect that only the default and user set parameters should be printed.

### Steps to reproduce
```python
from rdt.transformers import BaseTransformer

class CustomTransformer(BaseTransformer):
    def __init__(self, param0, param1=False):
        self.param0 = param0
        self.param1 = param1

transformer = CustomTransformer(param0='required')
text = repr(transformer)

print(text)
```
- The printout:
```python
CustomTransformer(param0='required', param1=False)
```

Hints from issue comments:

Solution patch:
diff --git a/rdt/transformers/base.py b/rdt/transformers/base.py
index 1863462..97e6c94 100644
--- a/rdt/transformers/base.py
+++ b/rdt/transformers/base.py
@@ -333,13 +333,20 @@ class BaseTransformer:
             if key != 'model_missing_values' and hasattr(self, key)  # Remove after deprecation
         }
 
-        defaults = args.defaults or []
-        defaults = dict(zip(keys, defaults))
-        if defaults == instanced:
+        default_values_list = args.defaults or []
+        default_arg_to_default_value = {}
+        if default_values_list:
+            default_keys = keys[-len(default_values_list) :]
+            default_arg_to_default_value = dict(zip(default_keys, default_values_list))
+
+        if default_arg_to_default_value == instanced:
             return f'{class_name}()'
 
         for arg, value in instanced.items():
-            if arg not in defaults or defaults[arg] != value:
+            if (
+                arg not in default_arg_to_default_value
+                or default_arg_to_default_value[arg] != value
+            ):
                 custom_args.append(f'{arg}={repr(value)}')
 
         args_string = ', '.join(custom_args)


Test patch:
diff --git a/tests/unit/transformers/test_base.py b/tests/unit/transformers/test_base.py
index 248f3bc..c1a7734 100644
--- a/tests/unit/transformers/test_base.py
+++ b/tests/unit/transformers/test_base.py
@@ -354,12 +354,13 @@ class TestBaseTransformer:
         """Test that the ``__repr__`` method returns the class name and parameters.
 
         The ``_repr__`` method should return the class name followed by all non-default
-        parameters wrapped in paranthesis.
+        parameters wrapped in parentheses.
 
         Setup:
             - Create a dummy class which inherits from the ``BaseTransformer`` where:
-                - The class has two parameters in its ``__init__`` method with default values.
-                - The class instance only sets one of them.
+                - The class has one required parameter in it's ``__init__`` method.
+                - The class has three optional parameters in it's ``__init__`` method.
+                - The class instance only sets 2 optional parameters.
         """
 
         # Setup
@@ -378,6 +379,27 @@ class TestBaseTransformer:
         # Assert
         assert text == "Dummy(param0='required', param2='value', param3=True)"
 
+    def test__repr__with_bool_parameters(self):
+        """Test that the ``__repr__`` method returns the class name and parameters.
+
+        The ``_repr__`` method should return the class name followed by all non-default
+        parameters wrapped in parentheses and not include default boolean parameters.
+        """
+
+        # Setup
+        class Dummy(BaseTransformer):
+            def __init__(self, param0, param1=False):
+                self.param0 = param0
+                self.param1 = param1
+
+        transformer = Dummy(param0='required')
+
+        # Run
+        text = repr(transformer)
+
+        # Assert
+        assert text == "Dummy(param0='required')"
+
     def test__str__(self):
         """Test the ``__str__`` method.