Comments (4)
Ok, so I've created a TYPE_ALLOWED setting in #87. I think it's a way to deal with these, and we could add something on top like asking Did you mean "model"?
if user entered "models". But don't think it's needed right now. I'll close the issue and we'll address this in future if that would be needed. Thanks for posting the feedback @omesser!
from gto.
Thanks!
- I've implemented
gto audit registrations
as you suggested, everything works now. I've also supported shortcuts and aliases, like:
class ALIASES:
REGISTER = ["reg", "registration", "registrations", "register"]
PROMOTE = ["prom", "promote", "promotion", "promotions"]
Do you think it's fine to support them? I mean, people will rely on them and if we decide to remove some of them in future, it can break user's workflow. On other hand in k8s you also have this kind of shortcuts and they are very helpful.
- In fact,
model
andmodels
may be different things. Maybe I have amodel
(models/my-model
) andmodels
(models/
). So not sure we need to assume it's a 100% typo. (This example also touches interleaved paths, but we can discuss it here #59).
I have few options in mind here:
A. Make a spell-check and warn you when you do that, so you can spot in and fix it before you commit this.
B. Allow to specify a whitelist of allowed values. Then if you make a typo, gto will throw an error.
C. Same as A, but if we think this may be a typo, we throw an error and ask you to use --force
flag.
WDYT?
from gto.
"Do you think it's fine to support them? I mean, people will rely on them and if we decide to remove some of them in future"
I believe it's a better experience to support the aliases. But we can still be consistent with the syntax in the docs (meaning always using "registrations" everywhere, and mention the aliases only once).
We will need to, indeed, not remove those in the future - or at least manage deprecations properly.
Another, "safer" route, is to explicitly mention in the docs that we only commit to a specific form of the arg = "registration", and not aliases like "reg" "registrations". I think both are valid approaches, but I think the aliases route has proved itself so convenient in some cases that it should be regarded as a production feature (just my personal 2 cents)
from gto.
"In fact, model and models may be different things...."
This is why i originally wrote that this is debatable, but I think pluralization of types shouldn't be so close to a possible typo (like model
and models
).
Type should always be singular, if we ever want to deal with a set of models as a distinct type, the new type can be called model-set
(or list? depends) - then you both accommodate for a collection of items but prevent easily made typos
from gto.
Related Issues (20)
- Tag increment doesn't calculated right
- pydantic 2.0 release has breaking changes - cli crash
- Make "v" in "v1.2.3" optional HOT 2
- Bug: gto irresponsive HOT 5
- Sweep (slow): bump pylint to the latest version HOT 1
- Sweep: Update pylint version in setup.py HOT 1
- Sweep: Fix failing tests after pylint update HOT 1
- Sweep: Update code to comply with new pylint rules HOT 1
- Sweep: Remove unnecessary pylint skip comments HOT 1
- update GTO to be in line with iterative/py-template standards HOT 4
- Allow uppercase letters HOT 5
- gto should not push on register without --push flag. HOT 3
- Stale secret deletion HOT 1
- Bug: `--bump-...` falgs don't work HOT 2
- Feature proposal: `gto show` settings controlled by `.gto` config HOT 2
- Improve tests
- `deprecate`: why depracate an entire model/artifact? HOT 1
- bug: gto does not work with ssh-based repository urls HOT 4
- `gto show` returns tag names with a `\n` newline at the end.
- Inconsistent behaviour of GTO in Studio vs. CLI
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 gto.