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

Fix bugs in how size and arraysize were being handled #106

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

JeremyMcCormick
Copy link
Collaborator

@JeremyMcCormick JeremyMcCormick commented Sep 26, 2024

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

  • Ran Jenkins
  • Added a release note for user-visible changes to docs/changes

Fix obvious bug where wrong arraysize variable was being used in
setting size.

Do not set arraysize automatically for fields with length of 1.
Copy link

codecov bot commented Sep 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.49%. Comparing base (c84042c) to head (b639261).
Report is 2 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@stvoutsin stvoutsin left a 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
Copy link
Contributor

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?

Copy link
Collaborator Author

@JeremyMcCormick JeremyMcCormick Sep 26, 2024

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.

@JeremyMcCormick JeremyMcCormick merged commit b34c43b into main Sep 27, 2024
15 checks passed
@JeremyMcCormick JeremyMcCormick deleted the u/jeremym/fix-tap-size branch September 27, 2024 17:12
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.

2 participants