You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way to get the return value of the macro I've defined in my dbt project called in dagster_dbt.run_operation? I will be needing to get the results and pass it as a variable to my dbt run. Is there a neat way to do it?
@op(required_resource_keys={"dbt"})
def run_op_get_latest_timestamp(context):
res = context.resources.dbt.run_operation("test__get_latest_timestamp")
logger = get_dagster_logger()
logger.info(res.raw_output)
This is my macro:
{% macro test__get_latest_timestamp() %}
{% set results = run_query("SELECT MAX(ts) FROM dbt_database.table") %}
{{ return (results.columns[0].values()[0].strftime('%Y-%m-%d')) }}
{% endmacro %}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Is there a way to get the return value of the macro I've defined in my dbt project called in dagster_dbt.run_operation? I will be needing to get the results and pass it as a variable to my dbt run. Is there a neat way to do it?
This is my macro:
Beta Was this translation helpful? Give feedback.
All reactions