Skip to content

Schema-Automator incorrectly assigns dates to date-time type #160

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

Closed
amc-corey-cox opened this issue May 8, 2025 · 0 comments · Fixed by #161
Closed

Schema-Automator incorrectly assigns dates to date-time type #160

amc-corey-cox opened this issue May 8, 2025 · 0 comments · Fixed by #161
Assignees
Labels
bug Something isn't working

Comments

@amc-corey-cox
Copy link
Contributor

Describe the bug
With dates in the format 2024-01-22, Schema-Automator assigns the type to date-time in the schema. Validating the data with linkml validate causes the validation to fail because date-time should have the format 2024-01-22T00:00:00Z.

To Reproduce
Create a schema with dates in the 2024-01-22 format, then attempt to validate that data with linkml validate

Expected behavior
Schema-Automator should choose the more appropriate date range to allow validation

Additional context
Here is a quick sample file.

sample_id subject_id sample_type sample_date
SAMP-3343 SUBJ001 Blood 2024-01-22
SAMP-3636 SUBJ002 Blood 2024-01-19
SAMP-3673 SUBJ003 Blood 2024-01-16
SAMP-8569 SUBJ004 Blood 2024-01-16
SAMP-2621 SUBJ005 Saliva 2024-01-20

Output of the attempt to validate:
$ linkml validate --schema toy_data/schema-automator-data/ToySchema.yaml --target-class sample toy_data/raw_data/sample.tsv
[ERROR] [toy_data/raw_data/sample.tsv/0] '2024-01-22' is not a 'date-time' in /sample_date
[ERROR] [toy_data/raw_data/sample.tsv/1] '2024-01-19' is not a 'date-time' in /sample_date
[ERROR] [toy_data/raw_data/sample.tsv/2] '2024-01-16' is not a 'date-time' in /sample_date
[ERROR] [toy_data/raw_data/sample.tsv/3] '2024-01-16' is not a 'date-time' in /sample_date

@amc-corey-cox amc-corey-cox added the bug Something isn't working label May 8, 2025
@amc-corey-cox amc-corey-cox self-assigned this May 8, 2025
@amc-corey-cox amc-corey-cox linked a pull request May 8, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant