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

Empty dataset throws MissingRequiredWarning #75

Closed
rly opened this issue May 30, 2019 · 0 comments · Fixed by #107
Closed

Empty dataset throws MissingRequiredWarning #75

rly opened this issue May 30, 2019 · 0 comments · Fixed by #107
Labels
category: bug errors in the code or code behavior

Comments

@rly
Copy link
Contributor

rly commented May 30, 2019

I think we decided that an empty dataset should be allowed. So the following MissingRequiredWarning should not be thrown.

In /tests/unit/build_tests/test_io_map.py:

def test_build_empty(self):
        ''' Test default mapping functionality when no attributes are nested '''
        container = Bar('my_bar', [], 'value1', 10)
        builder = self.mapper.build(container, self.manager)
        expected = GroupBuilder('my_bar', datasets={'data': DatasetBuilder('data', [])},
                                attributes={'attr1': 'value1', 'attr2': 10})
        self.assertDictEqual(builder, expected)

results in:

c:\users\ryan\documents\nwb\hdmf\src\hdmf\build\map.py:974: MissingRequiredWarning: dataset 'data' for 'my_bar' of type (Bar)
@rly rly added the category: bug errors in the code or code behavior label May 30, 2019
@rly rly changed the title Empty dataset currently throws MissingRequiredWarning Empty dataset throws MissingRequiredWarning May 30, 2019
@rly rly closed this as completed in #107 Jul 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: bug errors in the code or code behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant