[jira] [Commented] (TOREE-503) Cannot Use Scala Enumerations as Method Arguments

2019-09-09 Thread Kevin Bates (Jira)


[ 
https://issues.apache.org/jira/browse/TOREE-503?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16925958#comment-16925958
 ] 

Kevin Bates commented on TOREE-503:
---

Hi Alexander - I guess I'm inclined to close this issue because you can define 
the method in the same cell as its called.  Once you upgrade to Spark 2.4, that 
shouldn't be necessary.  In addition, my thought is that this is more about 
Spark than Toree since the same version of Toree produces different behaviors - 
depending on the version of Spark.

 

Just want to check with you first.

> Cannot Use Scala Enumerations as Method Arguments
> -
>
> Key: TOREE-503
> URL: https://issues.apache.org/jira/browse/TOREE-503
> Project: TOREE
>  Issue Type: Bug
>  Components: Kernel
>Affects Versions: 0.3.0
> Environment: Amazon EMR Release emr-5.10.0, JupyterLab 0.35.4
>Reporter: Alexander Gunter
>Priority: Major
>
> Under common circumstances, cells containing method calls where an argument 
> is an Enumeration will fail to compile when using the Toree kernel in 
> JupyterLab. The circumstances relate to the scoping between notebook cells. 
> The arrangement below will fail to compile, producing the shown output.
>  
> _CELL 1:_
> {code:java}
> object ExampleEnum extends Enumeration {
>    type ExampleEnum = Value
>    val A, B, C = Value
>  }{code}
> {code:java}
> defined object ExampleEnum
> {code}
>  
> _CELL 2:_
> {code:java}
> def exampleMethod(enum: ExampleEnum.Value): Unit = {
>   println(enum.toString)
> }
> exampleMethod(ExampleEnum.A){code}
> {code:java}
> exampleMethod: (enum: ExampleEnum.Value)Unit
> A
> {code}
>  
> _CELL 3:_
> {code:java}
> exampleMethod(ExampleEnum.A){code}
> {code:java}
> Name: Compile Error
> Message: :30: error: type mismatch;
>  found   : ExampleEnum.Value
>  required: ExampleEnum.Value
>exampleMethod(ExampleEnum.A)
>  ^
> StackTrace: 
> {code}
>  
> Note that exampleMethod() works as expected when called inside the same cell 
> as its definition (demo'd in Cell 2). It also works as expected in all cells 
> if it is instead defined in Cell 1 alongside ExampleEnum (i.e. if you merge 
> Cell1 and Cell 2).



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


[jira] [Commented] (TOREE-503) Cannot Use Scala Enumerations as Method Arguments

2019-09-09 Thread Alexander Gunter (Jira)


[ 
https://issues.apache.org/jira/browse/TOREE-503?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16925748#comment-16925748
 ] 

Alexander Gunter commented on TOREE-503:


Hi Kevin,

Sorry for the delayed response. Unfortunately I'm not able to swap to a 
different EMR version. I'm working in a dev environment that has to mirror our 
production environment.

I'm glad to hear that an upgrade would work around the issue, though.

> Cannot Use Scala Enumerations as Method Arguments
> -
>
> Key: TOREE-503
> URL: https://issues.apache.org/jira/browse/TOREE-503
> Project: TOREE
>  Issue Type: Bug
>  Components: Kernel
>Affects Versions: 0.3.0
> Environment: Amazon EMR Release emr-5.10.0, JupyterLab 0.35.4
>Reporter: Alexander Gunter
>Priority: Major
>
> Under common circumstances, cells containing method calls where an argument 
> is an Enumeration will fail to compile when using the Toree kernel in 
> JupyterLab. The circumstances relate to the scoping between notebook cells. 
> The arrangement below will fail to compile, producing the shown output.
>  
> _CELL 1:_
> {code:java}
> object ExampleEnum extends Enumeration {
>    type ExampleEnum = Value
>    val A, B, C = Value
>  }{code}
> {code:java}
> defined object ExampleEnum
> {code}
>  
> _CELL 2:_
> {code:java}
> def exampleMethod(enum: ExampleEnum.Value): Unit = {
>   println(enum.toString)
> }
> exampleMethod(ExampleEnum.A){code}
> {code:java}
> exampleMethod: (enum: ExampleEnum.Value)Unit
> A
> {code}
>  
> _CELL 3:_
> {code:java}
> exampleMethod(ExampleEnum.A){code}
> {code:java}
> Name: Compile Error
> Message: :30: error: type mismatch;
>  found   : ExampleEnum.Value
>  required: ExampleEnum.Value
>exampleMethod(ExampleEnum.A)
>  ^
> StackTrace: 
> {code}
>  
> Note that exampleMethod() works as expected when called inside the same cell 
> as its definition (demo'd in Cell 2). It also works as expected in all cells 
> if it is instead defined in Cell 1 alongside ExampleEnum (i.e. if you merge 
> Cell1 and Cell 2).



--
This message was sent by Atlassian Jira
(v8.3.2#803003)