Skip to content

MetadataBase.loads performs validation, but MetadataBase.load appears not to do validation #174

@dralley

Description

@dralley

def load(self, f):
"""
Load data from a file.
:param f: file-like object or path to file
:type f: file or str
"""
with open_file_obj(f) as f:
parser = self.parse_file(f)
self.deserialize(parser)
def loads(self, s):
"""
Load data from a string.
:param s: input data
:type s: str
"""
io = six.StringIO()
io.write(s)
io.seek(0)
self.load(io)
self.validate()

Why does MetadataBase.loads() call self.validate() but MetadataBase.load() does not?

I would kind of expect self.validate() to be called from MetadataBase.load() so that it would be inherited by MetadataBase.loads()`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions