tableau / TabPy

Execute Python code on the fly and display results in Tableau visualizations:
https://tableau.github.io/TabPy/
MIT License
1.56k stars 598 forks source link

Refactor config parsing to allow custom parsers. #412

Closed lriggs closed 4 years ago

lriggs commented 4 years ago

ConfigParser has some helpful functions to parse booleans and ints/floats. The boolean parser handles casing and allows true, 1, yes for true values. This is more relable and user friendly than relying on a direct string match. Updated tests.

One change here is with the TABPY_EVALUATE_TIMEOUT setting. Previously it would try and convert that setting to a float and if it failed would default to 30 seconds. Now it will throw an exception at startup and the process will halt. The new method does handle int -> float conversions.

I could add some extra code to restore the old behavior, but maybe its better this way since the user will know that they have a setting which isn't being used. Mostly silent defaults can be hard to recognize.

pep8speaks commented 4 years ago

Hello @lriggs! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers:

Comment last updated at 2020-04-15 19:04:13 UTC
0golovatyi commented 4 years ago

@lriggs The coverage for Python code is very flaky, just ignore that -0.06% decline.