code: def test_type_removed_from_defaults_config():
      config = {
          "input_features": [
              {"name": "feature_1", "type": "category"},
              {"name": "Sex", "type": "category"},
          ],
          "output_features": [
              {"name": "Survived", "type": "category"},
          ],
          "defaults": {
              "binary": {
                  "encoder": {
                      "type": "passthrough",
                  },
                  "preprocessing": {
                      "missing_value_strategy": "fill_with_false",
                  },
                  "type": "binary",
              },
              "category": {
                  "encoder": {
                      "type": "onehot",
                  },
                  "preprocessing": {
                      "missing_value_strategy": "fill_with_const",
                      "most_common": 10000,
                  },
                  "type": "category",
              },
          },
          "model_type": "ecd",
      }
  
      config_2 = copy.deepcopy(config)
      config_2["model_type"] = "gbm"
  
      config_obj = ModelConfig.from_dict(config).to_dict()
      config_obj_2 = ModelConfig.from_dict(config_2).to_dict()
  
      for feature_type in config_obj.get("defaults"):
          assert "type" not in config_obj["defaults"][feature_type]
  
      for feature_type in config_obj_2.get("defaults"):
          assert "type" not in config_obj_2["defaults"][feature_type]
  
imports: import copy
  import math
  from typing import Any, Dict
  import pytest
  from ludwig.constants import BATCH_SIZE, BFILL, CLASS_WEIGHTS, DEFAULTS, EVAL_BATCH_SIZE, EXECUTOR, HYPEROPT, INPUT_FEATURES, LEARNING_RATE_SCHEDULER, LOSS, NUMBER, OUTPUT_FEATURES, PREPROCESSING, SCHEDULER, SPLIT, TRAINER, TYPE
  from ludwig.schema.model_config import ModelConfig
  from ludwig.schema.trainer import ECDTrainerConfig
  from ludwig.utils.backward_compatibility import _update_backend_cache_credentials, _upgrade_encoder_decoder_params, _upgrade_feature, _upgrade_preprocessing_split, upgrade_config_dict_to_latest_version, upgrade_missing_value_strategy, upgrade_model_progress
  from ludwig.utils.trainer_utils import TrainerMetric
label_desc: Use image node_id 17 for calling a global function with example usage: test_type_removed_from_defaults_config() without return types