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

[Bug] Skip SavedQuery node would cause dbt-core to error out on the node #10029

Closed
2 tasks done
ChenyuLInx opened this issue Apr 24, 2024 · 2 comments · Fixed by #10302
Closed
2 tasks done

[Bug] Skip SavedQuery node would cause dbt-core to error out on the node #10029

ChenyuLInx opened this issue Apr 24, 2024 · 2 comments · Fixed by #10302
Assignees
Labels
bug Something isn't working Impact: SL Medium Severity bug with minor impact that does not have resolution timeframe requirement

Comments

@ChenyuLInx
Copy link
Contributor

Is this a new bug in dbt-core?

  • I believe this is a new bug in dbt-core
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

When a node upstream of a SavedQuery node fails and lead to SavedQuery node being skipped(vs NO-OP), dbt-core will raise an error saying Exception on worker thread. 'SavedQuery' object has no attribute 'schema'.
Please see additional context section

Expected Behavior

SavedQuery node properly skipped

Steps To Reproduce

  1. use latest main branch of dbt-core
  2. use this jaffle shop at this branch: https://github.com/dbt-labs/jaffle-shop/tree/repro/saved-query-schema-error
  3. run dbt build

Relevant log output

22:40:22  49 of 52 SKIP test accepted_values_customers_customer_type__new__returning ..... [SKIP]
22:40:22  50 of 52 SKIP test dbt_utils_expression_is_true_customers_lifetime_spend_pretax_lifetime_tax_paid_lifetime_spend  [SKIP]
22:40:22  51 of 52 SKIP test not_null_customers_customer_id .............................. [SKIP]
22:40:22  52 of 52 SKIP test unique_customers_customer_id ................................ [SKIP]
22:40:22  
22:40:22  Finished running 6 view models, 7 table models, 3 unit tests, 6 seeds, 27 data tests, 3 saved queries in 0 hours 0 minutes and 29.53 seconds (29.53s).
22:40:22  
22:40:22  Completed with 4 errors and 0 warnings:
22:40:22  
22:40:22  Failure in unit_test test_supply_costs_sum_correctly (models/marts/order_items.yml)
22:40:22    

actual differs from expected:

@@ ,order_id,product_id,supply_cost
→  ,1       ,1         ,4.5→4.50
+++,2       ,2         ,Decimal('8.50')
+++,2       ,2         ,Decimal('8.50')
---,2       ,2         ,Decimal('8.5')
---,2       ,2         ,Decimal('8.5')


22:40:22  
22:40:22    compiled Code at target/compiled/jaffle_shop/models/marts/order_items.yml/models/marts/test_supply_costs_sum_correctly.sql
22:40:22  
22:40:22    Exception on worker thread. 'SavedQuery' object has no attribute 'schema'
22:40:22  
22:40:22    Exception on worker thread. 'SavedQuery' object has no attribute 'schema'
22:40:22  
22:40:22    Exception on worker thread. 'SavedQuery' object has no attribute 'schema'

Environment

- OS:mac os
- Python: 3.11
- dbt: 1.8.0b3(latest main

Which database adapter are you using with dbt?

No response

Additional Context

If you set a breakpoint at on_skip function, you will find that Saved Query node do not have Schema. I don't think we ever had that attribute on SavedQuery node.

@ChenyuLInx ChenyuLInx added bug Something isn't working triage and removed bug Something isn't working labels Apr 24, 2024
@ChenyuLInx
Copy link
Contributor Author

Internal thread

@graciegoheen graciegoheen added bug Something isn't working Medium Severity bug with minor impact that does not have resolution timeframe requirement and removed triage labels Apr 25, 2024
@ChenyuLInx
Copy link
Contributor Author

Check what the error message would be if on_skip when schema do not exists we just put a None.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Impact: SL Medium Severity bug with minor impact that does not have resolution timeframe requirement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants