GithubHelp home page GithubHelp logo

Comments (4)

joanlopez avatar joanlopez commented on June 20, 2024

Could you provide any specific example to reproduce this issue, please? 🙏🏻

from thema.

mildwonkey avatar mildwonkey commented on June 20, 2024

I CAN NOW! https://github.com/mildwonkey/thema-examples/tree/main/translate

There's a repo full repo in there, but it's as simple as calling Translate on a schema version that doesn't exist

from thema.

mildwonkey avatar mildwonkey commented on June 20, 2024

Another case when Translate() panics is if there are no lenses defined:

panic: #Translate.out.steps._accum.1._lens: index out of range [0] with length 0:
    /github.com/grafana/thema/translate.cue:104:31

That specific issue is similar to what I referenced #152 (though when I opened that issue I wasn't getting a panic, just silent failure - I'm not sure what was different but I'll include a repro if it comes up again)

from thema.

sdboyer avatar sdboyer commented on June 20, 2024

if there are no lenses defined:

yup, it's another invariant that needs checking. "Lens completeness" is its whole own invariant area. I'm guessing we'll be able to write checkers in stages. From where we are now, the following two checks are clearly necessary (but not sufficient):

  • In lenses, there must exist exactly one lens for each expected pair of version numbers
  • In each lens result, there must exist at least one "assignment" for every field in the to schema? (handwave handwave optional fields)

from thema.

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.