Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dbt-core-sync] Not loading variables defined as Jinja in profiles.yml #279

Closed
mtrentz opened this issue Apr 10, 2024 · 1 comment · Fixed by #280
Closed

[dbt-core-sync] Not loading variables defined as Jinja in profiles.yml #279

mtrentz opened this issue Apr 10, 2024 · 1 comment · Fixed by #280

Comments

@mtrentz
Copy link
Contributor

mtrentz commented Apr 10, 2024

On 0.2.13, after the MetricFlow update, my environment vars (defined with Jinja) on my profiles.yml don't properly load when running superset-cli sync dbt-core ...

Here is my profiles yml:

much_dbt_warehouse:
  outputs:
    prod:
      dbname: "{{ env_var('DBT_DBNAME') }}"
      host: "{{ env_var('DBT_HOST') }}"
      user: "{{ env_var('DBT_USER') }}"
      pass: "{{ env_var('DBT_PASS') }}"
      port: "{{ env_var('DBT_PORT') | as_number }}"
      threads: "{{ env_var('DBT_THREADS') | as_number }}"
      type: "{{ env_var('DBT_TYPE') }}"
      schema: "{{ env_var('DBT_PROD_SCHEMA') }}"
      meta:
        superset:
          database_name: DWH
  target: prod

Here is the error msg:

Traceback (most recent call last):
  File "/usr/local/bin/superset-cli", line 8, in <module>
    sys.exit(superset_cli())
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.9/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/preset_cli/lib.py", line 148, in wrapper
    return function(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/preset_cli/cli/superset/sync/dbt/command.py", line 188, in dbt_core
    mf_dialect = MFSQLEngine(dialect.upper())
  File "/usr/local/lib/python3.9/enum.py", line 384, in __call__
    return cls.__new__(cls, value)
  File "/usr/local/lib/python3.9/enum.py", line 702, in __new__
    raise ve_exc
ValueError: "{{ ENV_VAR('DBT_TYPE') }}" is not a valid MFSQLEngine
@mtrentz
Copy link
Contributor Author

mtrentz commented Apr 10, 2024

Hopeful fix at #280 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant