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(interop/measurements): don't initialize t.field_names #380

Merged
merged 1 commit into from
Apr 9, 2024

Conversation

mxinden
Copy link
Contributor

@mxinden mxinden commented Apr 3, 2024

Previously, when printing the measurements result table, one would initialize the t.field_names field to [""]. Later on t.field_names would be overwritten by the actual table column names, namely the servers under test.

Each time one sets t.field_names, the field_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!

Previously, when printing the measurements result table, one would initialize
the `t.field_names` field to `[""]`. Later on `t.field_names` would be
overwritten by the actual table column names, namely the servers under test.

Each time one sets `t.field_names`, the `field_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.
@marten-seemann marten-seemann merged commit 2a2534a into quic-interop:master Apr 9, 2024
1 check passed
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