-
Notifications
You must be signed in to change notification settings - Fork 3
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
Fix bugs in how size and arraysize were being handled #106
Conversation
Fix obvious bug where wrong arraysize variable was being used in setting size. Do not set arraysize automatically for fields with length of 1.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #106 +/- ##
==========================================
+ Coverage 91.01% 91.49% +0.47%
==========================================
Files 16 16
Lines 1881 1881
Branches 410 410
==========================================
+ Hits 1712 1721 +9
+ Misses 96 86 -10
- Partials 73 74 +1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
I've tested on dev and the size validation errors are all gone. One small comment/question regarding arraysize=1
@@ -407,7 +407,9 @@ def visit_column(self, column_obj: datamodel.Column, table_obj: Table) -> Tap11B | |||
felis_type = FelisType.felis_type(felis_datatype.value) | |||
column.datatype = column_obj.votable_datatype or felis_type.votable_name | |||
|
|||
column.arraysize = column_obj.votable_arraysize or column_obj.length | |||
column.arraysize = column_obj.votable_arraysize or ( | |||
column_obj.length if (column_obj.length is not None and column_obj.length > 1) else None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a case where column_obj.votable_arraysize
is None column_obj_length == 1
and we want column.arraysize
set to that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It says in the TAP 1.1 spec that arraysize should never be set to 1 but should be null instead in this case.
Fix obvious bug where wrong arraysize variable was being used in setting size.
Do not set arraysize automatically for fields with length of 1.
Checklist
docs/changes