Comments (1)
🤖
Hello again @tatiana! It's great to see you contributing to the Cosmos project once more. Your insights are always appreciated!
Thank you for bringing this issue to our attention. It seems like the error is occurring because the _should_include_node
method in the selector.py
file is trying to access a node that doesn't exist in the nodes
dictionary. This happens when a dbt test doesn't have any node dependencies.
Here's a potential solution to this problem:
def _should_include_node(self, node_id: str, node: DbtNode) -> bool:
"Checks if a single node should be included. Only runs once per node with caching."
if node_id in self.visited_nodes:
return node_id in self.selected_nodes
self.visited_nodes.add(node_id)
if node.resource_type == DbtResourceType.TEST and node.depends_on:
node.tags = getattr(self.nodes.get(node.depends_on[0]), "tags", [])
if not self._is_tags_subset(node):
return False
node_config = {key: value for key, value in node.config.items() if key in SUPPORTED_CONFIG}
if not self._is_config_subset(node_config):
return False
config_copy = copy.deepcopy(self.config.config)
config_copy.pop("tags", None)
node_config.pop("tags", None)
if not (config_copy.items() <= node_config.items()):
return False
if self.config.paths and not self._is_path_matching(node):
return False
return True
In this modification, we added a check to see if node.depends_on
is not empty before trying to access its first element. This should prevent the "IndexError: list index out of range" error from occurring when a dbt test doesn't have any node dependencies.
Please try this solution and let us know if it resolves the issue. If you have any further questions or need additional assistance, feel free to ask.
For more information about the _should_include_node
method, you can refer to the cosmos/dbt/selector.py file in the Cosmos repository.
Best regards,
Dosu
Sources
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.
from astronomer-cosmos.
Related Issues (20)
- Community Support HOT 1
- Release Cosmos 1.5.0
- Bugs HOT 1
- New Features
- Support docs generated with `dbt docs generate --static`
- Test task is generated though it is not defined HOT 2
- Reduce task queueing latency when using Cosmos HOT 3
- Emit Airflow metrics to support analysing Cosmos performance HOT 1
- `LoadMode.AUTOMATIC` does not seem to work as documented HOT 4
- Using EMR transient cluster with Cosmos HOT 1
- AthenaAccessKeyProfileMapping does not work as expected locally HOT 3
- [Bug] cosmos 1.4.1 does not create virtualenv when using `ExecutionMode.VIRTUALENV` HOT 1
- Decouple `LoadMode.AUTOMATIC` from `load()` method in `DbtGraph`
- Cosmos tasks randomly getting marked as zombie tasks HOT 2
- Fix hard to read AirflowException error logs from dbt command HOT 2
- bug please help me this is my project (ubuntu) HOT 4
- Permission issue with Cosmos cache in some restricted environments HOT 1
- [Bug]: Trial Issue using Bug report template HOT 1
- This a new feature request using Feature request Issue template HOT 1
- Link to dbt docs from task
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from astronomer-cosmos.