Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Checklist
Description
Add methods to parser to add a
_metadata
column to data_lists and track data types of non-string columnsThis is designed to improve on the type infer methods used in #2513 (can update post-merge), so that
set_data
operations can correctly use the expected column data types.Author Notes
Use
There are 2 methods now included to infer data types within the parser
@metadata
row can manually specifytype: number/boolean
within the corresponding column cell.Note - only
number
orboolean
types need to be specified as assumestring
by default, an if using nestedobject
types these will automatically be detected when creating the data_list (columns would be formatted with.
notation, e.g.time.hour
andtime.minute
.Data Changes
The corresponding generated
_metadata
will be included in the parsed data_lists github. Metadata is only included if specific entries exist (so will not appear for simple data_lists where every column is represented by string values)Quality Control
I had originally planned to include errors or warnings when the data_type could not be inferred (e.g. no data in the column), however realised this is probably a fairly common case and having lots of warnings would not be so helpful (example screenshot)
Example - warning log output - not currently in use
So instead, when data types cannot be inferred it will simply be assumed that they are designed to be strings. The data types shouldn't really be all that important unless using
set_data
operation to update data from action list strings (or in the future when adding new rows).Similarly
metadata
is only included for columns that are not formatted as strings, to avoid overload of potentially less helpful information.Future Plans
With the use of the metadata column we could look to expand in the future to include more things features such as data validation or default values
Review Notes
The easiest way to examine the new metadata is to sync and review the deployment repo diffs generated
Dev Notes
If this happens to be merged before #2513 I can update, but I don't think it should block it in any way (non-breaking changes, can just be implemented in future update when reviewing add_data action)
Git Issues
Closes #
Screenshots/Videos
Example - metadata now included in data_lists for all non-string columns (as inferred from data)