-
-
Notifications
You must be signed in to change notification settings - Fork 371
Open
Description
The execution model says that the script files are wrapped in a package object – https://ammonite.io/#ExecutionModel
Otherwise, the source code for this script is then wrapped in a package/object wrapper, corresponding to the path to the script from the current script's enclosing folder. For example, a script at path foo/bar/baz/Qux.sc will be wrapped in:
package foo.bar.baz
object Qux{
// script code
}
Despite this, I am unable to access the package-private symbols from the same package:
// org/apache/spark/sql/Foo.sc
import org.apache.spark.sql.Dataset
def foo(): Unit = {
println(Dataset)
println("foo")
}
def bar(): Unit = {
println(Dataset)
}
almond jupyter kernel's cell:
import $file.org.apache.spark.sql.Foo
Foo.foo()
execution error:
Compiling /home/jovyan/shared/users/faucct/org/apache/spark/sql/Foo.sc
/home/jovyan/shared/users/faucct/org/apache/spark/sql/Foo.sc:4: object Dataset in package sql cannot be accessed in package org.apache.spark.sql
println(Dataset)
^
/home/jovyan/shared/users/faucct/org/apache/spark/sql/Foo.sc:9: not found: value Dataset
println(Dataset)
^
Compilation Failed
Though, I am not sure if the problem is on your side or Almond's.
Putting the file three directories higher also does not help.
Metadata
Metadata
Assignees
Labels
No labels