<@ULVA73B9P> I am having some issues with prefect-...
# ask-marvin
a
@Marvin I am having some issues with prefect-dbt The trigger_dbt_cli_command runs but the run_dbt_build command does not
Copy code
@flow(name="dbt flow")
def dbt_build_flow():
    trigger_dbt_cli_command(
        command="dbt deps", project_dir="dbt/snowflake",
    )
    run_dbt_build(
        project_dir="dbt/snowflake",
        create_summary_artifact = True,
        summary_artifact_key = "dbt-build-task-summary",
        extra_command_args=["--model", "my_model"],
    )


if __name__ == "__main__":
    dbt_build_flow()
m
Let's figure out what's going wrong with the
run_dbt_build
command in your flow. Could you please let me know which version of Prefect you are using? This will help in providing the most accurate guidance. Additionally, let me know if you can share any error messages or logs that appear when you try to run the flow.
a
@Marvin I am using prefect 3.0.7 and prefect-dbt 0.6.1 There are no error messages and it completes but the run_dbt_build task has not run
m
I couldn't find any relevant issues or documentation references specifically discussing the
run_dbt_build
task not executing for Prefect version 3.0.7 or prefect-dbt version 0.6.1. Here are a few things you might want to check or try: 1. Check Task Registration: Ensure that the
run_dbt_build
task is properly registered within your flow. There might be issues with how the task is being invoked or the order of execution. 2. Check Output of trigger_dbt_cli_command: Since
trigger_dbt_cli_command
runs first, verify if it is completing successfully and that it does not have output or side effects that might interfere with the
run_dbt_build
. Check the logs if there are any clues there. 3. Run the Task Manually: Try running the
run_dbt_build
with the same parameters separately to see if it's an issue with the task itself or the flow integration. 4. Ensure Correct Import: Double-check that you are importing
run_dbt_build
from the correct module. Sometimes naming or import paths might cause unexpected behavior. 5. Review Prefect Logs: Use Prefect's logging to add debug statements before and after the task to ensure it's being called. 6. Prefect Documentation: View Prefect's documentation on dbt integration to verify that the task definitions and configurations match the latest requirements. If these steps don't resolve the issue, consider opening an issue on the Prefect GitHub repository for prefect-dbt with detailed information to get further help from the community or maintainers.
a
@Marvin how can I set the logs to debug
m
To set the logs to debug level in Prefect 3.0.7, you can configure the logging settings as follows: 1. Configure Logging Level via Command Line: Use the
prefect config
command to set the logging level. For example, if you want to set the logging level for all flows to debug, you can use the following command:
Copy code
bash
   prefect config set PREFECT_LOGGING_LOGGERS_PREFECT="DEBUG"
2. Environment Variable: Alternatively, you can set an environment variable to change the logging level globally:
Copy code
bash
   export PREFECT_LOGGING_LOGGERS_PREFECT="DEBUG"
3. Python Script: If you prefer to set it within your Python script, you can import the
prefect
module and set the configuration programmatically:
Copy code
python
   from prefect import configuration
   configuration.update_profile({"logging.level": "DEBUG"})
These changes will adjust the logging level to DEBUG, allowing you to see more detailed logs that may help in troubleshooting the issue with the
run_dbt_build
task. For further details, you can refer to Prefect's official documentation on logging.