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

Alignment not validated when set for specific field #202

Open
myheroyuki opened this issue Sep 30, 2022 · 0 comments
Open

Alignment not validated when set for specific field #202

myheroyuki opened this issue Sep 30, 2022 · 0 comments

Comments

@myheroyuki
Copy link
Contributor

What did you do?

Attempted to set the alignment for a header field to the invalid alignment value "rice".

What did you expect to happen?

ValueError: Alignment rice is invalid, use l, c or r. This is what happens when the alignment is set globally and not just for a single field.

What actually happened?

No error message, and the table printed out with the default alignment. If I try to print a formatted html table it crashes with a key error.
It seems like the setter where the value is validated isn't called when assigning a key a value in the align dict.

Please include code that reproduces the issue.

The best reproductions
are
self-contained scripts
with minimal dependencies.

t = helper_table(rows=3)
t.format = True
t.align["Field 1"] = "rice"
print(t.get_string())

This is another small alignment issue I found looking into other alignment related issues like #199, #102 and #111

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

No branches or pull requests

1 participant