{% macro load_secrets_command(secret_scope) -%}
secret_key_list = dbutils.secrets.list("{{ secret_scope }}")
for secret_key in secret_key_list:
    if 'astro_sdk_' in secret_key.key:
        key_name = secret_key.key.replace("astro_sdk_","")
        # We are using print here as we have yet to find a way to make logs surface in the databricks UI
        print(f"setting {key_name}")
        sc._jsc.hadoopConfiguration().set(key_name, dbutils.secrets.get("{{ secret_scope }}", secret_key.key))
{%- endmacro -%}
