Skip to content

Commit

Permalink
Merge pull request #50 from provectus/config_hot_fix
Browse files Browse the repository at this point in the history
fixed config issue
  • Loading branch information
bvolodarskiy authored Mar 29, 2023
2 parents 3aa00b9 + f159c05 commit a13def7
Showing 1 changed file with 33 additions and 18 deletions.
51 changes: 33 additions & 18 deletions functions/data_test/profiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,24 +94,39 @@ def change_ge_config(datasource_root):
}
}
}
stores = configfile["stores"]
new_stores = add_local_s3_to_stores(stores) if os.environ['ENVIRONMENT'] == 'local' else stores
data_docs_sites = configfile["data_docs_sites"]
new_data_docs_sites = add_local_s3_to_data_docs(data_docs_sites) if os.environ['ENVIRONMENT'] == 'local' else data_docs_sites

config = DataContextConfig(config_version=configfile["config_version"], datasources=datasources,
stores=new_stores, data_docs_sites=new_data_docs_sites,
expectations_store_name=configfile["expectations_store_name"],
validations_store_name=configfile["validations_store_name"],
evaluation_parameter_store_name=configfile["evaluation_parameter_store_name"],
plugins_directory="/great_expectations/plugins",
validation_operators=configfile["validation_operators"],
config_variables_file_path=configfile["config_variables_file_path"],
anonymous_usage_statistics=configfile["anonymous_usage_statistics"],
store_backend_defaults=S3StoreBackendDefaults(
default_bucket_name=qa_bucket_name,
expectations_store_prefix=f"{qa_bucket_name}/great_expectations/expectations/",
validations_store_prefix=f"{qa_bucket_name}/great_expectations/uncommitted/validations/"))

if os.environ['ENVIRONMENT'] == 'local':
stores = configfile["stores"]
new_stores = add_local_s3_to_stores(stores) if os.environ['ENVIRONMENT'] == 'local' else stores
data_docs_sites = configfile["data_docs_sites"]
new_data_docs_sites = add_local_s3_to_data_docs(data_docs_sites) if os.environ[
'ENVIRONMENT'] == 'local' else data_docs_sites
config = DataContextConfig(config_version=configfile["config_version"], datasources=datasources,
stores=new_stores, data_docs_sites=new_data_docs_sites,
expectations_store_name=configfile["expectations_store_name"],
validations_store_name=configfile["validations_store_name"],
evaluation_parameter_store_name=configfile["evaluation_parameter_store_name"],
plugins_directory="/great_expectations/plugins",
validation_operators=configfile["validation_operators"],
config_variables_file_path=configfile["config_variables_file_path"],
anonymous_usage_statistics=configfile["anonymous_usage_statistics"],
store_backend_defaults=S3StoreBackendDefaults(
default_bucket_name=qa_bucket_name,
expectations_store_prefix=f"{qa_bucket_name}/great_expectations/expectations/",
validations_store_prefix=f"{qa_bucket_name}/great_expectations/uncommitted/validations/"))
else:
config = DataContextConfig(config_version=configfile["config_version"], datasources=datasources,
expectations_store_name=configfile["expectations_store_name"],
validations_store_name=configfile["validations_store_name"],
evaluation_parameter_store_name=configfile["evaluation_parameter_store_name"],
plugins_directory="/great_expectations/plugins",
validation_operators=configfile["validation_operators"],
config_variables_file_path=configfile["config_variables_file_path"],
anonymous_usage_statistics=configfile["anonymous_usage_statistics"],
store_backend_defaults=S3StoreBackendDefaults(
default_bucket_name=qa_bucket_name,
expectations_store_prefix=f"{qa_bucket_name}/great_expectations/expectations/",
validations_store_prefix=f"{qa_bucket_name}/great_expectations/uncommitted/validations/"))
return config


Expand Down

0 comments on commit a13def7

Please sign in to comment.