Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate all relative paths #2809

Merged
merged 2 commits into from
Apr 20, 2024
Merged

Conversation

RunDevelopment
Copy link
Member

Fixes #1612

This PR adds the RelativePathInput for relative paths. All file name inputs now use this input and get the same file path validation as folder name in Directory Go Into. This also means that all file name inputs now "officially" support relative paths. E.g.

image

This was allowed before already, so this doesn't change existing behavior, it just makes it more explicit.

One thing that did change are absolute file paths as names. E.g. the following was allowed before and created the model C:\foo\bar.pth:
image

This has now been fixed. Absolute paths are now an error.

If the user inputs invalid characters, they'll get this "error" and the character input won't go through. This makes it impossible to input invalid relative paths.

Kinda. Input validation currently only work on an input level. Users can trivially input invalid characters using a Text node. These invalid characters will cause an error at runtime, but there is no type error.

Example: I tried to type "foo*"
image
image


Other changes:

  • Removed create: bool from DirectoryInput. Since names are now officially relative paths, we can only know which directory to create after combining the directory and name (e.g. C:\a\b\c and ..\name). I also changed all relevant nodes to create the directory themselves.

@joeyballentine joeyballentine merged commit c7f7711 into chaiNNer-org:main Apr 20, 2024
17 checks passed
@RunDevelopment RunDevelopment deleted the issue1612 branch April 20, 2024 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validation around file paths
2 participants