MCPcopy Create free account
hub / github.com/apache/impala / parse_bool_option

Function parse_bool_option

shell/impala_shell/option_parser.py:52–62  ·  view source on GitHub ↗

Returns True for '1' and 'True', and False for '0' and 'False'. Throws ValueError for other values.

(value)

Source from the content-addressed store, hash-verified

50
51
52def parse_bool_option(value):
53 """Returns True for '1' and 'True', and False for '0' and 'False'.
54 Throws ValueError for other values.
55 """
56 if value.lower() in ["true", "1"]:
57 return True
58 elif value.lower() in ["false", "0"]:
59 return False
60 else:
61 raise InvalidOptionValueError("Unexpected value in configuration file. '" + value
62 + "' is not a valid value for a boolean option.")
63
64
65def parse_shell_options(options, defaults, option_list):

Callers 1

parse_shell_optionsFunction · 0.85

Calls 1

Tested by

no test coverage detected