From 408c0141e7b23195c617214d86523e15767069b9 Mon Sep 17 00:00:00 2001 From: Connor Hindle Date: Thu, 31 Oct 2024 13:21:23 +0000 Subject: [PATCH] rename platform_helper_config_file -> platform_helper_cache_file --- dbt_platform_helper/utils/files.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dbt_platform_helper/utils/files.py b/dbt_platform_helper/utils/files.py index 28db43912..da98d6fe4 100644 --- a/dbt_platform_helper/utils/files.py +++ b/dbt_platform_helper/utils/files.py @@ -9,7 +9,7 @@ from jinja2 import Environment from jinja2 import FileSystemLoader -platform_helper_config_file = ".platform-helper-config.yml" +platform_helper_cache_file = ".platform-helper-config.yml" def to_yaml(value): @@ -110,7 +110,7 @@ def combine_env_data(data): def read_supported_versions_from_cache(resource_name): - platform_helper_config = read_file_as_yaml(platform_helper_config_file) + platform_helper_config = read_file_as_yaml(platform_helper_cache_file) return platform_helper_config.get(resource_name).get("versions") @@ -119,8 +119,8 @@ def write_to_cache(resource_name, supported_versions): platform_helper_config = {} - if os.path.exists(platform_helper_config_file): - platform_helper_config = read_file_as_yaml(platform_helper_config_file) + if os.path.exists(platform_helper_cache_file): + platform_helper_config = read_file_as_yaml(platform_helper_cache_file) cache_dict = { resource_name: { @@ -131,7 +131,7 @@ def write_to_cache(resource_name, supported_versions): platform_helper_config.update(cache_dict) - with open(platform_helper_config_file, "w") as file: + with open(platform_helper_cache_file, "w") as file: file.write("# [!] This file is autogenerated via the platform-helper. Do not edit.\n") yaml.dump(platform_helper_config, file) @@ -147,10 +147,10 @@ def cache_refresh_required(resource_name) -> bool: 3. The date-retrieved value of the cached data is > than a time interval. In this case 1 day. """ - if not os.path.exists(platform_helper_config_file): + if not os.path.exists(platform_helper_cache_file): return True - platform_helper_config = read_file_as_yaml(platform_helper_config_file) + platform_helper_config = read_file_as_yaml(platform_helper_cache_file) if platform_helper_config.get(resource_name): return check_if_cached_datetime_is_greater_than_interval(