Warn users if we can't find config.yaml but found config.yml#2284
Warn users if we can't find config.yaml but found config.yml#2284
Conversation
ndeepak-baseten
left a comment
There was a problem hiding this comment.
Looks good, thanks for the tests as well!
| resolved_path = path.resolve() | ||
| stem = resolved_path.stem | ||
| alternative_path = resolved_path.parent / f'{stem}.yml' | ||
| if os.path.isfile(alternative_path): |
There was a problem hiding this comment.
This looks good and we can merge now, but maybe we can be more lenient, and actually accept config.yml as well. Right now, we tell the user "hey can you rename", while we could equally just be more accepting. Maybe a follow-up, will likely need alignment!
There was a problem hiding this comment.
That's what I wanted to do originally but I decided against it because it could get confusing if somehow you end up with both a config.yml and a config.yaml in the same directory. In that case we'd always default to config.yaml which could cause much bigger headaches down the line
There was a problem hiding this comment.
Ah, good thinking thanks! But then we could throw a warning! "Warning: Found config.yaml and config.yml, using config.yaml"
i.e. if there's only one file, err towards automation. But if two files, show a warning and have a precedence order (or raise ValueError in that case, give control back to user).
There was a problem hiding this comment.
(Chatted in person but basically changing this would mean modifying a couple dozens mentions of config.yml that are hardcoded throughout the codebase. Seems like the juice isn't worth the squeeze)
There was a problem hiding this comment.
Agreed, yeah this would be easier if it was a property, for example. Thank you for the research!
|
Q: Did the docs.baseten.co docs not mention .yaml is required? |
they mention that but nowadays people don't really read docs 😅 |
🚀 What
Got kind of confused trying to create a model locally because I created a
config.ymlinstead ofconfig.yaml.💻 How
This PR should be pretty low-impact as the code only runs when we can't find
config.yamland it just checks forconfig.ymland prints a warning if it finds it.🔬 Testing
Added unit tests