-
Notifications
You must be signed in to change notification settings - Fork 323
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
Autoscoping for Table aggregate #9614
Comments
The IDE doesn't render autoscoped constructor arguments in To reproduce unzip TableAggregateAutoConstructor.zip and either inspect it in the IDE or rather execute as from Standard.Base import all
from Standard.Table import all
from Standard.Database import all
from Standard.AWS import all
from Standard.Google_Api import all
import Standard.Visualization
collapsed operator16985 =
operator58114 = operator16985.aggregate ['Organisation'] columns=[(..Count), ..Sum]
operator35300 = operator16985.aggregate ['Organisation'] columns=[(Aggregate_Column.Count), Aggregate_Column.Sum]
operator58114 and the output of running the program with IDE's instrumentation is:
The UUID Clearly the autoscoped constructor case gives IDE less information. Now we need to find out what is the important missing information that IDE needs to render the constructor arguments? CCing @4e6 and @farmaazon. |
I think the issue is that the autoscope constructors are not resolved inside vector from Standard.Base import all
type T
A
main =
test [..A]
test t:(Vector T) = t Result
Expected
|
No, that's not the cause. Autoscope constructors are resolved, if one requests that. Just modify your
that's actually something I had to do in #9630 in 2c4b2c3 commit. The new test verifies that both The problem must be in differences in instrumentation between |
Also, enso/distribution/lib/Standard/Table/0.0.0-dev/src/Table.enso Lines 782 to 783 in 5038582
|
There's also a different result for
Result
ExpectedWith
|
the example with --- a/distribution/lib/Standard/Table/0.0.0-dev/src/Table.enso
+++ b/distribution/lib/Standard/Table/0.0.0-dev/src/Table.enso
@@ -780,7 +780,8 @@ type Table
@group_by Widget_Helpers.make_column_name_vector_selector
@columns Widget_Helpers.make_aggregate_column_vector_selector
aggregate : Vector (Integer | Text | Regex | Aggregate_Column) | Text | Integer | Regex -> Vector Aggregate_Column -> Boolean -> Problem_Behavior -> Table ! No_Output_Columns | Invalid_Aggregate_Column | Invalid_Column_Names | Duplicate_Output_Column_Names | Floating_Point_Equality | Invalid_Aggregation | Unquoted_Delimiter | Additional_Warnings
- aggregate self group_by=[] columns=[] (error_on_missing_columns=False) (on_problems=Report_Warning) =
+ aggregate self group_by=[] columns_raw=[] (error_on_missing_columns=False) (on_problems=Report_Warning) =
+ columns = columns_raw.map(e -> e:Aggregate_Column)
normalized_group_by = Vector.unify_vector_or_element group_by
if normalized_group_by.is_empty && columns.is_empty then Error.throw (No_Output_Columns.Error "At least one column must be specified.") else
validated = Aggregate_Column_Helper.prepare_aggregate_columns self.column_naming_helper normalized_group_by columns self error_on_missing_columns=error_on_missing_columns |
There was a different result. That's why I created |
I made a runtime test checking the instrumentation of autoscope constructors inside vector Lines 1078 to 1087 in a83eb58
In case of the |
The test is wrong. It doesn't even deliver |
It does. If you replace the autoscope call with |
Running: from Standard.Base import all
type T
A
main =
a = test [..A]
a
test t:(Vector T) = t yields from Standard.Base import all
type T
A
main =
a = test [..A]
a == [T.A]
test t:(Vector T) = t #.map(e-> e:T) yields |
The question is not what the right answer is, but how Now it is clear that for Then, in the case of |
I wonder if this will fix the instrumentation of --- a/distribution/lib/Standard/Table/0.0.0-dev/src/Table.enso
+++ b/distribution/lib/Standard/Table/0.0.0-dev/src/Table.enso
@@ -778,9 +778,10 @@ type Table
table.aggregate ["Key"] [Aggregate_Column.Count]
@group_by Widget_Helpers.make_column_name_vector_selector
- @columns Widget_Helpers.make_aggregate_column_vector_selector
+ @columns_raw Widget_Helpers.make_aggregate_column_vector_selector
aggregate : Vector (Integer | Text | Regex | Aggregate_Column) | Text | Integer | Regex -> Vector Agg
regate_Column -> Boolean -> Problem_Behavior -> Table ! No_Output_Columns | Invalid_Aggregate_Column | Inv
alid_Column_Names | Duplicate_Output_Column_Names | Floating_Point_Equality | Invalid_Aggregation | Unquoted_Delimiter | Additional_Warnings
- aggregate self group_by=[] columns=[] (error_on_missing_columns=False) (on_problems=Report_Warning) =
+ aggregate self group_by=[] columns_raw=[] (error_on_missing_columns=False) (on_problems=Report_Warning) =
+ columns = columns_raw.map(e-> e:Aggregate_Column)
normalized_group_by = Vector.unify_vector_or_element group_by
if normalized_group_by.is_empty && columns.is_empty then Error.throw (No_Output_Columns.Error "At least one column must be specified.") else
validated = Aggregate_Column_Helper.prepare_aggregate_columns self.column_naming_helper normalized_group_by columns self error_on_missing_columns=error_on_missing_columns |
It is consumed by 5f9aa25 - it has to be consumed, otherwise the two |
Does it mean 5f9aa25 fixes the issue? |
It does "fix" the issue in runtime. But the IDE isn't fixed yet. @kazcw reported to address the necessary changes on the IDE side. As @farmaazon puts it:
|
Jaroslav Tulach reports a new STANDUP for yesterday (2024-04-05): Progress: -
Next Day: |
Jaroslav Tulach reports a new STANDUP for yesterday (2024-04-08): Progress: - emails, reviews: #9642 (review)
Next Day: Table.join & co.
|
|
I decided to reopen issue #9635 as I don't see the drop down with column selection for |
Will be fixed once #9916 (review) gets in. |
Once #9277 works we need to get
Table.aggregate
columns
working in the IDE.The text was updated successfully, but these errors were encountered: