Used by Variable/Connection.

https://github.com/apache/airflow/blob/894741e311ffd642e036b80d3b1b5d53c3747cad/airflow/secrets/metastore.py#L32

cls.serialize(v, strict=strict, use_pydantic_models=use_pydantic_models) for v in var
                    ),
                    type_=DAT.SET,
                )
            except TypeError:
                return cls._encode(
                    [cls.serialize(v, strict=strict, use_pydantic_models=use_pydantic_models) for v in var],
                    type_=DAT.SET,
                )
        elif isinstance(var, tuple):
            
            return cls._encode(
                [cls.serialize(v, strict=strict, use_pydantic_models=use_pydantic_models) for v in var],
                type_=DAT.TUPLE,
            )
        elif isinstance(var, TaskGroup):
            return TaskGroupSerialization.serialize_task_group(var)
        elif isinstance(var, Param):
            return cls._encode(cls._serialize_param(var), type_=DAT.PARAM)
        elif isinstance(var, XComArg):
            return cls._encode(serialize_xcom_arg(var), type_=DAT.XCOM_REF)
        elif isinstance(var, Dataset):
            return cls._encode({"uri": var.uri, "extra": var.extra}, type_=DAT.DATASET)
        elif isinstance(var, SimpleTaskInstance):
            return cls._encode(
                cls.serialize(var.__dict__, strict=strict, use_pydantic_models=use_pydantic_models),
                type_=DAT.SIMPLE_TASK_INSTANCE,
            )
        elif use_pydantic_models and _ENABLE_AIP_44:
            def _pydantic_model_dump(model_cls: type[BaseModel], var: Any) -> dict[str, Any]: