arr-ai / arrai

The ultimate data engine.
http://arr.ai
Apache License 2.0
20 stars 15 forks source link

import does not allow to go up a directory #536

Open nofun97 opened 4 years ago

nofun97 commented 4 years ago

Please do not post any internal, closed source snippets on this public issue tracker!

Description

Arrai does not allow //{../test.arrai}

Expected behavior

Imports it

Actual behavior

@> //{../test.arrai}
2020-08-05T11:02:51.687905+10:00 error_message=failed to import https://./test.arrai - no such module, and Get "https://./test.arrai": Bad Gateway

.:1:5:
//{../test.arrai} INFO

Your Environment

$ arrai info
Version    : DIRTY-v0.107.0
Git commit : 9b0f4570f8bc49a89650907b806e02f014e887d6
Date       : 2020-07-31T01:21:18Z
OS/arch    : darwin/amd64
Go version : go1.14.4 darwin/amd64

Current workaround

You can do this as a workaround

//{./../test}
marcelocantos commented 4 years ago

This is intended behaviour. We don't want imports escaping into the wild. The correct approach is generally //{/module/relative/path/test.arrai}.

There may be an argument for allowing parent-directory imports as long as they remain within a module, but even then there are potential complications due to symlinks and increased confusion when code gets moved around.

marcelocantos commented 4 years ago

//{./../test} should be illegal. I raised #554