What is the type of `variable_def['data_schema']` -  a list or dict?  If it's a dict, this has the same problem as the above enumerate.