Пример #1
0
 def preprocess_field_names(self, data, **_):  # type: ignore
     """Pre-process the jobs limit response fields."""
     FIELDS_MAP = {  # pylint: disable=invalid-name
         'maximumJobs': 'maximum_jobs',
         'runningJobs': 'running_jobs'
     }
     return map_field_names(FIELDS_MAP, data)
Пример #2
0
 def preprocess_field_names(self, data, **_):  # type: ignore
     """Pre-process the info queue response fields."""
     FIELDS_MAP = {  # pylint: disable=invalid-name
         'status': '_status',
         'estimatedStartTime': 'estimated_start_time',
         'estimatedCompleteTime': 'estimated_complete_time',
         'hubPriority': 'hub_priority',
         'groupPriority': 'group_priority',
         'projectPriority': 'project_priority'
     }
     return map_field_names(FIELDS_MAP, data)
Пример #3
0
    def preprocess_field_names(self, data, **_):  # type: ignore
        """Pre-process the job response fields.

        Rename selected fields of the job response due to name clashes, and
        convert from camel-case the rest of the fields.

        TODO: when updating to terra 0.10, check if changes related to
        marshmallow 3 allow to use directly `data_key`, as in 0.9 terra
        duplicates the unknown keys.
        """
        return map_field_names(FIELDS_MAP, data)