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

[Bug]: Validator incorrectly reads datetime-formatted string as isodatetime when spec dtype is string #1023

Closed
rly opened this issue Jan 11, 2024 · 0 comments · Fixed by #1026
Labels
category: bug errors in the code or code behavior priority: medium non-critical problem and/or affecting only a small set of users topic: validator issues related to validation of files

Comments

@rly
Copy link
Contributor

rly commented Jan 11, 2024

What happened?

See NeurodataWithoutBorders/pynwb#1819

This happens in https://github.com/hdmf-dev/hdmf/blob/dev/src/hdmf/validate/validator.py#L105-L107

Steps to Reproduce

# using pynwb
from pynwb.testing.mock.file import mock_NWBFile
from pynwb import NWBHDF5IO

with NWBHDF5IO(path=".../Downloads/test_invalid.nwb.hdf5", mode="w") as io:
    io.write(mock_NWBFile(session_id="2024-01-01"))

Traceback

- found the following errors:
root/general/session_id (general/session_id): incorrect type - expected 'text', got 'isodatetime'

Operating System

Windows

Python Executable

Conda

Python Version

3.11

Package Versions

No response

@rly rly added category: bug errors in the code or code behavior topic: validator issues related to validation of files priority: medium non-critical problem and/or affecting only a small set of users labels Jan 11, 2024
@rly rly closed this as completed in #1026 Jan 12, 2024
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 priority: medium non-critical problem and/or affecting only a small set of users topic: validator issues related to validation of files
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant