Git Product home page Git Product logo

Comments (3)

mahmoud avatar mahmoud commented on May 21, 2024

Hey there! Glad you like ashes. This isn't possible with the library right this second, but I've got some ideas. Most revolve around this line here.

Would a log statement work? Or are you trying to raise a full-blown error?

from ashes.

ysangkok avatar ysangkok commented on May 21, 2024

I mainly just want to use it for testing, I want to make sure that my dataclasses have the right fields, which I turn into dictionaries and pass into ashes. So it could be a boolean, or it could be a logging context-manager that I could inspect for warnings (and get a bool). Or it could be an optional kwarg. I don't mind too much, as long as I can make my test fail if the dataclass doesn't match the template.

from ashes.

jvanasco avatar jvanasco commented on May 21, 2024

Years ago, I started work on extending ashes to track the utilized fields. I never got it to recurse correctly though.

The use-case for me was to build a model of what ashes used in the template. This would allow us to write tests where we could ensure we pass the correct data into ashes, but also optimize the data structure. Our app renders the templates in the cloud with ashes, or in a browser/app with JavaScript; being able to strip unused fields from the JavaScript payload was a big goal.

from ashes.

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.