File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 11
11
import os
12
12
13
13
from ads .common .oci_client import OCIClientFactory
14
+ from ads .feature_store .common .utils .utility import get_env_bool
14
15
15
16
try :
16
17
from delta import configure_spark_with_delta_pip
33
34
34
35
35
36
def developer_enabled ():
36
- return os . getenv ("DEVELOPER_MODE" )
37
+ return get_env_bool ("DEVELOPER_MODE" , False )
37
38
38
39
39
40
class SingletonMeta (type ):
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python
2
2
# -*- coding: utf-8; -*-
3
3
import copy
4
+ import os
4
5
# Copyright (c) 2023 Oracle and/or its affiliates.
5
6
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
6
7
@@ -62,6 +63,25 @@ def get_execution_engine_type(
62
63
else ExecutionEngine .SPARK
63
64
)
64
65
66
+ def get_env_bool (env_var : str , default : bool = False ) -> bool :
67
+ """
68
+ :param env_var: Environment variable name
69
+ :param default: Default environment variable value
70
+ :return: Value of the boolean env variable
71
+ """
72
+ env_val = os .getenv (env_var )
73
+ if env_val is None :
74
+ env_val = default
75
+ else :
76
+ env_val = env_val .lower ()
77
+ if env_val == "true" :
78
+ env_val = True
79
+ elif env_val == "false" :
80
+ env_val = False
81
+ else :
82
+ raise ValueError ("For environment variable: {0} only string values T/true or F/false are allowed but: \
83
+ {1} was provided." .format (env_var , env_val ))
84
+ return env_val
65
85
66
86
def get_metastore_id (feature_store_id : str ):
67
87
"""
You can’t perform that action at this time.
0 commit comments