Comments (1)
I'm not overly familiar with how the scheduler heartbeat works but I assume that it executes the DAG Python file and then collects the contents of globals to understand the shape of the DAG. After that I expect that the file closes.
If that is the case then I don't think we can use any internal memoization techniques like functools lru_cache, please correct me if I'm wrong as I don't have a deep understanding.
That leaves us with either implementing an external cache e.g. memcached or writing the contents to file.
Perhaps we could use PyYaml with a classmethod of to_yaml and from_yaml on the operators.
If we compute a single deterministic hash of the things that should trigger a change (such as the cosmos library version, dag files, relevant dbt directories) and use that to determine if we should re-process everything.
If we need to re-process then we use the standard constructor to initialize and then write out to file, otherwise we use the classmethod to read from file.
Either way we'd need to profile the current implementation and the cost/benefit of such an approach for a small, medium and large project. The expectation being that for smaller projects it's much simpler to use the current approach.
There is also always the option to look at threading to speed up the rendering of the project, but that's not really addressing the waste of processing, only trying to ensure that it can happen within the DAG heartbeat interval for larger projects.
from astronomer-cosmos.
Related Issues (20)
- Make store_compiled_sql Optional HOT 1
- Add support for dbt-sqlserver
- Using normal dbt profiles instead of airflow connections HOT 2
- Bug: `render_project` logs errors for dbt sources as missing model dependencies
- Documentation for dbt-spark HOT 4
- on_failure_callback to alert during test failure HOT 9
- tilt up not working for local development HOT 6
- upgrading from 0.4.2 to 0.7.3 -> profile.yml cannot be created HOT 8
- GCP BigQuery service account json not supported in v0.7 HOT 16
- dbt test_behavior="after_all" fails since it couldnt find profile_args HOT 3
- Slimming down tmp_dir to just the --target-dir HOT 1
- Rendered SQL does not show temp table logic HOT 1
- Cosmos does not parse BigQuery connections correctly HOT 2
- Support generic tests
- Rendered SQL is not available for failed runs.
- cosmos library does not recognize on Airflow kubernetes
- convert literals to enums
- Unify `dbt_project_name` and `dbt_root_path`
- Import path to DbtTaskGroup in quickstart no longer accurate HOT 1
- Resolve MyPy ignore comments for Cosmos pre-commit
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.