Constants
ZenML constants.
handle_bool_env_var(var, default=False)
Converts normal env var to boolean.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
var
|
str
|
The environment variable to convert. |
required |
default
|
bool
|
The default value to return if the env var is not set. |
False
|
Returns:
Type | Description |
---|---|
bool
|
The converted value. |
Source code in src/zenml/constants.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
|
handle_int_env_var(var, default=0)
Converts normal env var to int.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
var
|
str
|
The environment variable to convert. |
required |
default
|
int
|
The default value to return if the env var is not set. |
0
|
Returns:
Type | Description |
---|---|
int
|
The converted value. |
Source code in src/zenml/constants.py
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
|
handle_json_env_var(var, expected_type, default=None)
Converts a json env var into a Python object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
var
|
str
|
The environment variable to convert. |
required |
default
|
Optional[List[str]]
|
The default value to return if the env var is not set. |
None
|
expected_type
|
Type[T]
|
The type of the expected Python object. |
required |
Returns:
Type | Description |
---|---|
Any
|
The converted list value. |
Raises:
Type | Description |
---|---|
TypeError
|
In case the value of the environment variable is not of a valid type. |
Source code in src/zenml/constants.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
|
is_false_string_value(value)
Checks if the given value is a string representation of 'False'.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
Any
|
the value to check. |
required |
Returns:
Type | Description |
---|---|
bool
|
Whether the input value represents a string version of 'False'. |
Source code in src/zenml/constants.py
84 85 86 87 88 89 90 91 92 93 |
|
is_true_string_value(value)
Checks if the given value is a string representation of 'True'.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
Any
|
the value to check. |
required |
Returns:
Type | Description |
---|---|
bool
|
Whether the input value represents a string version of 'True'. |
Source code in src/zenml/constants.py
72 73 74 75 76 77 78 79 80 81 |
|