-
Notifications
You must be signed in to change notification settings - Fork 177
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 ls fails on "Error" string in stdout #642
Comments
Hi @adammarples, I'm sorry you're facing this issue. I fully agree we need to improve this. This was introduced because the Would you like to contribute to improving this part of Cosmos? |
I would love to help, it sounds like an issue with dbt-core primarily though. Do you have any info about when these errors occur without adequate returncodes or why you started searching for the "Error" string in the first place? Thanks |
@adammarples, I agree that, ideally, this would be resolved in dbt itself. The dbt documentation states the exit code would be 0 only if the dbt invocation is completed without error: However, it seems there was a decision to have dbt ls always return 0, which is not compatible with the documentation: I remember two scenarios when we needed to capture errors raised while running
|
@jtcohen6 curious if you have any thoughts here - running |
As a workaround, I wonder if something like if returncode or "Error" in stdout.replace("WarnErrorOptions", ""): Would be acceptable because I suspect that WarnErrorOptions is going to turn up a lot |
@adammarples yes, I believe this would be a valid workaround - would you like to make this contribution to Cosmos? |
would be happy to |
Ignore `WarnErrorOptions` string in stdout from dbt-core, do not treat it as a failure Closes: astronomer#642
@adammarples Since we've released the workaround in 1.2.5 and don't have a better solution now, I'm closing this ticket. Please, feel free to reopen or open a new one if you have any suggestions of how we could better handle this. |
@tatiana actually I think I have a very simple workaround for this if it isn't fixed in dbt-core. We can force specific warnings to become errors for the For example, to raise an error for the issue that dbt-core were initially trying to fix, no nodes selected on dbt ls, we could catch that warning and turn it into an error when running ls. dbt --warn-error-options '{"include": ["NoNodesForSelectionCriteria"]}' ls For the issues you mentioned:
I tested 2 and it actually already returns an error code 2. I'm not sure what 1 exactly is, but it seems to be the same env_vars issue? |
Ignore `WarnErrorOptions` string in stdout from dbt-core, do not treat it as a failure Closes: astronomer#642
This error check https://github.com/astronomer/astronomer-cosmos/blob/635fb7badfd1fea560923d3f959ab7d021dba83d/cosmos/dbt/graph.py#L253C1-L255C111
Causes a failure when stdout includes (in my example)
Specifically "Error" is being found in the last line here
This check is overly broad and doesn' allow people to have ie. directories, model names, tags, schemas etc. with "Error" in them.
The text was updated successfully, but these errors were encountered: