-
Notifications
You must be signed in to change notification settings - Fork 180
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] [1.3.2] tests on sources do not render #875
Comments
Hey @push2prod, great to see you around again! Hope you're doing well. Thank you for bringing this to our attention. It seems like you're encountering an issue with tests on sources not rendering when using Cosmos with the DBT Manifest File method. From the context provided, Cosmos uses multiple methods to render tests on sources, and one of them is loading from a DBT Manifest File. This method directly loads the DBT graph from the manifest file. However, it seems like this method might not be working as expected in your case. The process Cosmos follows to render tests on sources when using the DBT Manifest File method involves several steps, including loading the manifest file, parsing it to extract nodes, sources, and exposures, filtering nodes based on the selection and exclusion criteria, and updating nodes with test information. If the tests on sources are not rendering, it could be due to a variety of reasons. Here are a few things you could check:
If you've checked all of these and the issue persists, it would be helpful if you could provide more information about your setup and the exact steps you're following. This will help us better understand the issue and find a suitable solution. For reference, you can find more details about the DBT Manifest File method and the process Cosmos follows to render tests on sources in the cosmos/dbt/graph.py file and the tests/dbt/test_graph.py file. Sources
|
@push2prod Please, could you share a reproducible example of DAG of what you tried to do, what you saw, and confirm if you'd like to see the tests bundled in task groups, together with the sources, or rendered by the end of the TaskGroup/DAG? |
Re-Opening of PR #661 This PR features a new way of rendering source nodes: - Check freshness for sources with freshness checks - Source tests - Empty operators for nodes without tests or freshness. One of the main limitations I found while using the `custom_callback` functions on source nodes to check freshness is that nodes were being created on 100% of sources but not all of them required freshness checks, this made workers waste compute time. I'm adding a new variable into the DbtNode class called has_freshness which would be True for sources with freshness checks and False for any other resource type. If this feature is enabled with the option `ALL`: All sources with the has_freshness == False will be rendered as Empty Operators, to keep the dbt's behavior of showing sources as suggested in issue #630 <!-- Add a brief but complete description of the change. --> A new rendered template field is included too: `freshness` which is the sources.json generated by dbt when running `dbt source freshness` This adds a new node type (source), which changes some tests behavior. This PR also updates the dev dbt project jaffle_shop to include source nodes when enabled. ![image](https://github.com/user-attachments/assets/e972ac58-8741-4c13-9905-e78775f9cc80) As seen in the image, source nodes with freshness checks are rendered with a blue color, while the ones rendered as EmptyOperator show a white/light green color Closes: #630 Closes: #572 Closes: #875 <!-- If this PR closes an issue, you can use a keyword to auto-close. --> <!-- i.e. "closes #0000" --> This won't be a breaking change since the default behavior will still be ignoring this new feature. That can be changed with the new RenderConfig variable called `source_rendering_behavior`. Co-authored-by: Pankaj <pankaj.singh@astronomer.io> Co-authored-by: Pankaj Singh <98807258+pankajastro@users.noreply.github.com>
because sources are not natively rendered as models(only by using the experimental feature) i think tests on sources do not render as well.
I tried rendering the sources as dummy operators and trying the AFTER_ALL test behavior but nothing seemed to work.
it would be very convenient to test sources right before running to avoid any problems with dbt pipelines and would greatly appreciate a patch.
we're using local mode with manifest file without any selectors with airflow 2.5.2(if it matters).
The text was updated successfully, but these errors were encountered: