Giter VIP home page Giter VIP logo

Comments (1)

MikeWallis42 avatar MikeWallis42 commented on May 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.