fix(interop/measurements): don't initialize t.field_names #380
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.
Previously, when printing the measurements result table, one would initialize the
t.field_names
field to[""]
. Later ont.field_names
would be overwritten by the actual table column names, namely the servers under test.Each time one sets
t.field_names
, thefield_names
setter logic would run.https://github.com/jazzband/prettytable/blob/1f156f8f82a8442fcec332018de0d66fa308acce/src/prettytable/prettytable.py#L605-L608
Among this is
validate_field_names
, which asserts that the number of fields from the second assignment equals the number of fields of the first assignment.https://github.com/jazzband/prettytable/blob/1f156f8f82a8442fcec332018de0d66fa308acce/src/prettytable/prettytable.py#L411-L421
Initializing
t.field_names
with[""]
is not neccessary. Thus, to prevent the above assertion from failing, this commit removes the initialization, fully depending on the actual assignment with the name of the servers under test.Uff, wasn't aware of Python's property decorators.
Bug introduced by me in #355. Sorry about that.
Spotted by @WesleyRosenblum in #375 (comment). Thanks!