Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dralley opened this issue Jun 14, 2024 · 1 comment

Comments

@dralley
Copy link

dralley commented Jun 14, 2024

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()`

@dralley
Copy link
Author

dralley commented Jun 14, 2024

@lubomir Is this a valid issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant