Skip to content

Commit a13def7

Browse files
authored
Merge pull request #50 from provectus/config_hot_fix
fixed config issue
2 parents 3aa00b9 + f159c05 commit a13def7

File tree

1 file changed

+33
-18
lines changed

1 file changed

+33
-18
lines changed

functions/data_test/profiling.py

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -94,24 +94,39 @@ def change_ge_config(datasource_root):
9494
}
9595
}
9696
}
97-
stores = configfile["stores"]
98-
new_stores = add_local_s3_to_stores(stores) if os.environ['ENVIRONMENT'] == 'local' else stores
99-
data_docs_sites = configfile["data_docs_sites"]
100-
new_data_docs_sites = add_local_s3_to_data_docs(data_docs_sites) if os.environ['ENVIRONMENT'] == 'local' else data_docs_sites
101-
102-
config = DataContextConfig(config_version=configfile["config_version"], datasources=datasources,
103-
stores=new_stores, data_docs_sites=new_data_docs_sites,
104-
expectations_store_name=configfile["expectations_store_name"],
105-
validations_store_name=configfile["validations_store_name"],
106-
evaluation_parameter_store_name=configfile["evaluation_parameter_store_name"],
107-
plugins_directory="/great_expectations/plugins",
108-
validation_operators=configfile["validation_operators"],
109-
config_variables_file_path=configfile["config_variables_file_path"],
110-
anonymous_usage_statistics=configfile["anonymous_usage_statistics"],
111-
store_backend_defaults=S3StoreBackendDefaults(
112-
default_bucket_name=qa_bucket_name,
113-
expectations_store_prefix=f"{qa_bucket_name}/great_expectations/expectations/",
114-
validations_store_prefix=f"{qa_bucket_name}/great_expectations/uncommitted/validations/"))
97+
98+
if os.environ['ENVIRONMENT'] == 'local':
99+
stores = configfile["stores"]
100+
new_stores = add_local_s3_to_stores(stores) if os.environ['ENVIRONMENT'] == 'local' else stores
101+
data_docs_sites = configfile["data_docs_sites"]
102+
new_data_docs_sites = add_local_s3_to_data_docs(data_docs_sites) if os.environ[
103+
'ENVIRONMENT'] == 'local' else data_docs_sites
104+
config = DataContextConfig(config_version=configfile["config_version"], datasources=datasources,
105+
stores=new_stores, data_docs_sites=new_data_docs_sites,
106+
expectations_store_name=configfile["expectations_store_name"],
107+
validations_store_name=configfile["validations_store_name"],
108+
evaluation_parameter_store_name=configfile["evaluation_parameter_store_name"],
109+
plugins_directory="/great_expectations/plugins",
110+
validation_operators=configfile["validation_operators"],
111+
config_variables_file_path=configfile["config_variables_file_path"],
112+
anonymous_usage_statistics=configfile["anonymous_usage_statistics"],
113+
store_backend_defaults=S3StoreBackendDefaults(
114+
default_bucket_name=qa_bucket_name,
115+
expectations_store_prefix=f"{qa_bucket_name}/great_expectations/expectations/",
116+
validations_store_prefix=f"{qa_bucket_name}/great_expectations/uncommitted/validations/"))
117+
else:
118+
config = DataContextConfig(config_version=configfile["config_version"], datasources=datasources,
119+
expectations_store_name=configfile["expectations_store_name"],
120+
validations_store_name=configfile["validations_store_name"],
121+
evaluation_parameter_store_name=configfile["evaluation_parameter_store_name"],
122+
plugins_directory="/great_expectations/plugins",
123+
validation_operators=configfile["validation_operators"],
124+
config_variables_file_path=configfile["config_variables_file_path"],
125+
anonymous_usage_statistics=configfile["anonymous_usage_statistics"],
126+
store_backend_defaults=S3StoreBackendDefaults(
127+
default_bucket_name=qa_bucket_name,
128+
expectations_store_prefix=f"{qa_bucket_name}/great_expectations/expectations/",
129+
validations_store_prefix=f"{qa_bucket_name}/great_expectations/uncommitted/validations/"))
115130
return config
116131

117132

0 commit comments

Comments
 (0)