1d532d1cb8b829bdf7055a22c206032ca0b72e46,python/ray/dashboard/metrics_exporter/schema.py,BaseModel,parse_obj,#Any#Any#,32

Before Change



        // Check if given_args have args that is not required.
        for arg in given_args:
            if arg not in required_args:
                raise ValidationError(
                    "Given argument has a key {}, which is not required "
                    "by this schema: {}".format(arg, required_args))

        // Check if given args have all required args.
        if len(required_args) != len(given_args):
            raise ValidationError("Given args: {} doesn"t have all the "
                                  "necessary args for this schema: {}".format(
                                      given_args, required_args))

        return cls(**obj)


class IngestRequest(BaseModel):

After Change


        for field, schema in cls.__schema__.items():
            required, default, arg_type = schema
            if field not in obj:
                if required:
                    raise ValidationError("{} is required, but doesn"t "
                                          "exist in a given object {}".format(
                                              field, obj))
                else:
                    // Set default value if the field is optional
                    obj[field] = default

        return cls(**obj)


class IngestRequest(BaseModel):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: ray-project/ray
Commit Name: 1d532d1cb8b829bdf7055a22c206032ca0b72e46
Time: 2020-04-02
Author: rkooo567@gmail.com
File Name: python/ray/dashboard/metrics_exporter/schema.py
Class Name: BaseModel
Method Name: parse_obj


Project Name: AlexsLemonade/refinebio
Commit Name: bf4d4be450616eeb0252b276c9febc4a50e83ace
Time: 2020-07-06
Author: willvauclain.dev@gmail.com
File Name: api/data_refinery_api/views/dataset.py
Class Name:
Method Name: validate_dataset


Project Name: AlexsLemonade/refinebio
Commit Name: a971f44300932557e9a806c991c5e81eedf62e4e
Time: 2020-06-16
Author: willvauclain.dev@gmail.com
File Name: api/data_refinery_api/serializers.py
Class Name:
Method Name: validate_dataset