Comments (4)
Could you provide any specific example to reproduce this issue, please? 🙏🏻
from thema.
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.
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.
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 theto
schema? (handwave handwave optional fields)
from thema.
Related Issues (20)
- Add a command to clean all txtar output HOT 4
- disallow if statements in schema definitions
- disallow comprehensions in schema definitions
- Emit embedded or inlined structs in Go to correspond with struct unifications in schemas HOT 2
- Bring validation error output in sync with lineage flattening
- feature request: improve error output with invalid `lens` configuration
- bug: inconsistently-shaped `instances` from `Translate` and `Validate` HOT 1
- feature request: add error return to `ValidateAny()` HOT 1
- Inconsistent lineage errors between thema cli and library HOT 1
- feature request: make the thema CLI go gettable
- feature request: thema version flag/subcommand/thingy
- Create standard error models for all thema operations HOT 2
- Generate something nicer than interfaces when we use disjunctions in Go models.
- Constraints break backward-compatibility check
- Translate() may return an invalid instance
- asdada
- Evaluate scalability of main Thema operations
- Set up Thema releases
- Enforce ordering of items in `schemas` and `lenses` during `BindLineage` HOT 2
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 thema.