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

Automatic model inference #137

Merged
merged 5 commits into from
Jul 10, 2024
Merged

Automatic model inference #137

merged 5 commits into from
Jul 10, 2024

Conversation

geoo89
Copy link
Contributor

@geoo89 geoo89 commented Jul 3, 2024

Models of sheets can now be automatically inferred if no explicit model is provided.

This is done exclusively by parsing the header row of a sheet. Headers can be annotated with types (basic types and list; dict and existing models are currently not supported). If no annotation is present, the column is assumed to be a string.

Examples of what the data in a column can represent:

  • field: field is inferred to be a string
  • field:int: field is inferred to be a int
  • field:list: field is inferred to be a list
  • field:List[int]: field is inferred to be a list of integers
  • field.1: field is inferred to be a list, and this column contains its first entry
  • field.1:int: field is inferred to be a list of integers, and this column contains its first entry
  • field.subfield: field is inferred to be another model with one or multiple subfields, and this column contains values for the subfield subfield
  • field.subfield:int: field is inferred to be another model with one or multiple subfields, and this column contains values for the subfield subfield which is inferred to be an integer
  • field.1.subfield: field is inferred to be a list of another model with one or multiple subfields, and this column contains values for the subfield subfield of the first list entry

Intermediate models like in the last three examples are created automatically.

@geoo89
Copy link
Contributor Author

geoo89 commented Jul 10, 2024

Did pipeline run for crisis and confirmed that it yields the same outputs.

@geoo89 geoo89 merged commit 1e8c45f into main Jul 10, 2024
12 checks passed
@istride istride deleted the feat/model-inference branch November 23, 2024 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant