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

[traits.build workflow] Time data types get reformatted with read_csv #49

Open
yangsophieee opened this issue Aug 30, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@yangsophieee
Copy link
Collaborator

Time data types get reformatted with read_csv, such that e.g. "9:00:00" becomes "09:00:00". This is not an issue if it's consistent with the output of metadata_add_contexts and process.R. However, right now metadata_add_contexts recognises "09:00:00" but then it gets written to the metadata as "32400.0".

image
image

@yangsophieee yangsophieee added bug Something isn't working dataset_input labels Aug 30, 2023
@yangsophieee yangsophieee self-assigned this Aug 30, 2023
@yangsophieee
Copy link
Collaborator Author

Note: You can't read in all data as character columns during read_csv because then process_custom_code won't work.

I decided to convert context values to character type before they are converted to yaml, which seems to have fixed the problem!

@yangsophieee
Copy link
Collaborator Author

yangsophieee commented Oct 6, 2023

There is a little bit of an issue where someone might manually add a time context value to the metadata in its original format, i.e. "9:00:00". Then they would find that the context value isn't being detected in the data (because the data has been read in as "09:00:00". There is a dataset_test that says when context values are not in the metadata so this would clear things up, and I added a little note here to notify when a time data type has been detected and reformatted.

@ehwenk
Copy link
Collaborator

ehwenk commented Oct 8, 2023

Nice solution. Does the dataset_test now specify which values data are missing from metadata vs which values metadata values are extra? If so, I think that is good enough, because it will immediately indicate what to change.

@yangsophieee
Copy link
Collaborator Author

@ehwenk Not yet, that is still an issue to be fixed (#63) but I will get to it soon!

@yangsophieee
Copy link
Collaborator Author

It seems that David has been converting time variables to character type within custom_R_code, otherwise the dataset_test test about time data types gets flagged. Needs further investigation, but it seems "11:30" in the data file may not be properly written by metadata_add_context to the metadata file.

@yangsophieee yangsophieee reopened this Nov 16, 2023
@ehwenk ehwenk changed the title Time data types get reformatted with read_csv [traits.build workflow] Time data types get reformatted with read_csv Jul 31, 2024
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
Status: Backlog
Development

No branches or pull requests

2 participants