Closed radeusgd closed 1 year ago
The method is an extension in the Database module.
When the IDE calls through it call with the type and module name correctly and gets passed onto Meta.get_annotation
but the methodFunction
cannot be resolved.
What is the program to test on? What shall I search for in that program? I tried to create something, but it doesn't work:
What is the program to test on? What shall I search for in that program? I tried to create something, but it doesn't work:
Looks like a typo in SQLite
- note the single L
.
Also note that the select_into_database_table
operation was added pretty recently, in #6925, so ensure that you've got a recent build.
Thank you for spotting the typo. I got over it. Now I cannot use Widgets
:
What's your import statement? I have no idea how you code works. I had to:
enso$ git diff
diff --git distribution/lib/Standard/Visualization/0.0.0-dev/src/Main.enso distribution/lib/Standard/Visualization/0.0.0-dev/src/Main.enso
index 7dbda46d96..ca56cf6f68 100644
--- distribution/lib/Standard/Visualization/0.0.0-dev/src/Main.enso
+++ distribution/lib/Standard/Visualization/0.0.0-dev/src/Main.enso
@@ -9,3 +9,6 @@ from project.File_Upload export file_uploading
export project.Id.Id
export project.Helpers
+import project.Widgets
+export project.Widgets
+
I wish bugreports had simple steps to reproduce. But I think I see the problem now.
Jaroslav Tulach reports a new STANDUP for yesterday (2023-06-07):
Progress: - failed to reproduce: https://github.com/enso-org/enso/issues/6955#issuecomment-1580055828
FunctionCallInfo
: https://github.com/enso-org/enso/issues/6957#issuecomment-1579887418Type
sharing violations: https://github.com/enso-org/enso/issues/6809#issuecomment-1581677238Next Day: Bugfixing & Runtime Type Checks
DiscordDiscord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
This is a dirty fix:
enso$ git diff engine/runtime/src/main/java/org/enso/interpreter/node/expression/builtin/meta/GetAnnotationNode.java
diff --git engine/runtime/src/main/java/org/enso/interpreter/node/expression/builtin/meta/GetAnnotationNode.java engine/runtime/src/main/java/org/enso/interpreter/node/expression/builtin/meta/GetAnnotationNode.java
index bbd28da286..efc90d9e26 100644
--- engine/runtime/src/main/java/org/enso/interpreter/node/expression/builtin/meta/GetAnnotationNode.java
+++ engine/runtime/src/main/java/org/enso/interpreter/node/expression/builtin/meta/GetAnnotationNode.java
@@ -1,7 +1,16 @@
package org.enso.interpreter.node.expression.builtin.meta;
+import com.oracle.truffle.api.CompilerDirectives;
+import com.oracle.truffle.api.Truffle;
+import com.oracle.truffle.api.dsl.Cached;
+import com.oracle.truffle.api.dsl.Specialization;
+import com.oracle.truffle.api.frame.FrameInstance;
+import com.oracle.truffle.api.frame.VirtualFrame;
+import com.oracle.truffle.api.library.CachedLibrary;
+import com.oracle.truffle.api.nodes.Node;
import org.enso.interpreter.dsl.BuiltinMethod;
import org.enso.interpreter.node.BaseNode;
+import org.enso.interpreter.node.EnsoRootNode;
import org.enso.interpreter.node.callable.thunk.ThunkExecutorNode;
import org.enso.interpreter.node.expression.builtin.text.util.ExpectStringNode;
import org.enso.interpreter.runtime.EnsoContext;
@@ -13,12 +22,6 @@ import org.enso.interpreter.runtime.library.dispatch.TypesLibrary;
import org.enso.interpreter.runtime.scope.ModuleScope;
import org.enso.interpreter.runtime.state.State;
-import com.oracle.truffle.api.CompilerDirectives;
-import com.oracle.truffle.api.dsl.Cached;
-import com.oracle.truffle.api.dsl.Specialization;
-import com.oracle.truffle.api.frame.VirtualFrame;
-import com.oracle.truffle.api.library.CachedLibrary;
-
@BuiltinMethod(
type = "Meta",
name = "get_annotation",
@@ -43,6 +46,15 @@ public abstract class GetAnnotationNode extends BaseNode {
Type targetType = types.getType(target);
ModuleScope scope = targetType.getDefinitionScope();
Function methodFunction = scope.lookupMethodDefinition(targetType, methodName);
+ if (methodFunction == null) {
+ methodFunction = Truffle.getRuntime().iterateFrames((FrameInstance fi) -> {
+ if (fi.getCallNode() instanceof Node call && call.getRootNode() instanceof EnsoRootNode ensoRoot) {
+ return ensoRoot.getModuleScope().lookupMethodDefinition(targetType, methodName);
+ } else {
+ return null;
+ }
+ });
+ }
if (methodFunction != null) {
String parameterName = expectStringNode.execute(parameter);
Annotation annotation = methodFunction.getSchema().getAnnotation(parameterName);
at least with this fix I get proper result from:
from Standard.Base import all
from Standard.Base.Data.Boolean import Boolean
from Standard.Base.Data.Text.Location import Location
from Standard.Database.Connection import Connection_Details
from Standard.Table import all
from Standard.Database import all
from Standard.AWS import all
from Standard.Visualization import Widgets
main =
operator17 = Database.connect (SQLite location=In_Memory)
operator18 = Table.new [ ["Y", ['a', 'b', 'c']] ]
operator19 = operator18.select_into_database_table operator17 temporary=Boolean.True
operator20 = Widgets.get_widget_json operator18 "select_into_database_table" [ "primary_key" ]
operator20
Jaroslav Tulach reports a new STANDUP for yesterday (2023-06-08):
Progress: - dirty "fix" found for https://github.com/enso-org/enso/issues/6955#issuecomment-1582365442
FrameDescriptor
merged: https://github.com/enso-org/enso/pull/6977Next Day: Bugfixing & Runtime Type Checks
DiscordDiscord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
Jaroslav Tulach reports a new STANDUP for yesterday (2023-06-09):
Progress: - test cases for Meta.get_annotation
: https://github.com/enso-org/enso/pull/7000
Meta.get_annotation
for Function
: https://github.com/enso-org/enso/pull/7000/commits/67fb5830cbc266a9a5bbe9e14f88130927b50d95sync/async
commands: https://github.com/enso-org/enso/pull/6998#discussion_r1223889748Next Day: Meta.get_annotations
GitHubWe currently have literal support for Number and Text. We have previously spoken about adding ``` (backtick) to be identified as an expression (so we can make it explicit rather than implied). Foll...
DiscordDiscord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
Jaroslav Tulach reports a new STANDUP for the last Saturday (2023-06-10):
Progress: - automatic conversions of arguments: https://github.com/enso-org/enso/pull/7009
Next Day: Meta.get_annotations
DiscordDiscord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
Jaroslav Tulach reports a new STANDUP for yesterday (2023-06-12):
Progress: - Meta.Function
proposal: https://github.com/enso-org/enso/pull/7000/commits/5d87c9c7d539cf17d068bbe2bc312f139976cdaf
Meta.is_checks
: https://github.com/enso-org/enso/pull/7000/commits/133ba8da13658fd5f9c866865d1a0bebabfbd668Next Day: Meta.get_annotations
Jaroslav Tulach reports a new 🔴 DELAY for yesterday (2023-06-14):
Summary: There is 7 days delay in implementation of the @widgets for extension functions of Table
may not be found (#6955) task.
It will cause 7 days delay for the delivery of this weekly plan.
Still investigating
Delay Cause: The issue crosscuts all the layers we have IDE, LS, compiler. I am still investigating what the proper solution should be. Design and discussion with owners of other parts of the system needed.
Possible solutions: The most promising solution right now seems to be to let IdExecutionInstrument
provide access to instrumented ModuleScope
to the visualization. Whether that can solve the problem remains to be seen.
Jaroslav Tulach reports a new STANDUP for yesterday (2023-06-18):
Progress: - Saturday & Sunday coding
Statistic
benchmark needs info: https://github.com/enso-org/enso/issues/5067Next Day: Meta.get_annotations
Jaroslav Tulach reports a new STANDUP for yesterday (2023-06-19):
Progress: - debugging QueryData::new
& request_widget
package-lock.json
fixed: https://github.com/enso-org/enso/pull/7053runtime-with-polyglot
Next Day: Meta.get_annotations
I am trying new approach to propagate the ModuleScope
via State
. It doesn't work, because of
The state is lost in Vector.newFromFunction
which is using InteropLibrary
to invoke a Function
and Function.java:190
is using emptyState()
instead of provided state in @ExportMessage
and Execute
message handler.
Jaroslav Tulach reports a new STANDUP for yesterday (2023-06-20):
Progress: - Vector.map
& State
: https://github.com/enso-org/enso/issues/6656#issuecomment-1598258539
get_annotation
PR & debugging: https://github.com/enso-org/enso/pull/7078Next Day: Meta.get_annotations
Google DocsSpring 2023 | 5th meeting: 3:15pm – 4pm, Join with Google Meet 4th meeting: June 13, 2023 3:15pm – 4pm, Join with Google Meet 3rd meeting: June 6, 2023 3:15pm – 4pm, Join with Google Meet 2nd meeting: May 30, 2023 ⋅ 3:15pm – 4pm, Join with Google Meet 1st meeting: May 24, 2023 ⋅ 3:15pm – 4...
Jaroslav Tulach reports a new 🔴 DELAY for yesterday (2023-06-21):
Summary: There is 7 days delay in implementation of the @widgets for extension functions of Table
may not be found (#6955) task.
It will cause 7 days delay for the delivery of this weekly plan.
Got it working somehow
Delay Cause: IdExecutionInstrument
can provide access to instrumented ModuleScope
to the visualization via State
- however different solution is requested.
Possible solutions: Take a shortcut, integrate what we have right now. Or investigate better fix. Let's investigate.
Jaroslav Tulach reports a new STANDUP for yesterday (2023-06-21):
Progress: - got get_annotation
working: https://github.com/enso-org/enso/pull/7078#issuecomment-1600267081
runtime/parser
project PR for review: https://github.com/enso-org/enso/pull/7096 It should be finished by 2023-06-27.Next Day: Meta.get_annotations
Jaroslav Tulach reports a new STANDUP for yesterday (2023-06-22):
Progress: - organisation issues: https://discord.com/channels/401396655599124480/1120986567570370651/1121456406915198976
Any.method
: https://github.com/enso-org/enso/pull/7033Next Day: Meta.get_annotations
DiscordDiscord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
Jaroslav Tulach reports a new STANDUP for yesterday (2023-06-23):
Progress: - breakthru in get_annotations
PR: https://github.com/enso-org/enso/pull/7115
runtime-parser
project, integrated: https://github.com/enso-org/enso/pull/7096Vector.map
& State
PR: https://github.com/enso-org/enso/pull/7078Any.spec_method
: https://github.com/enso-org/enso/pull/7033/files#r1239489978 It should be finished by 2023-06-27.Next Day: Get reviews and QA for Meta.get_annotations
and integrate
GitHubFixes #5612 and #6473. Fixes some static method invocations on Any, like Any == Boolean, or Any.to_text. Pull Request Description Previously, static method calls on Any have not worked as expected....
Jaroslav Tulach reports a new STANDUP for yesterday (2023-06-26):
Progress: - addressing Adam's & Pawel's comments: https://github.com/enso-org/enso/pull/7115/commits/15b9639dd5445e75464147b4e7f285161ccf4e70
State
: https://github.com/enso-org/enso/issues/7117#issuecomment-1606665237visualisation_module
changesNext Day: Finish Meta.get_annotations
and integrate
GitHubPull Request Description Added a special escape hatch in the searcher to run AI completions. Screencast was posted previously on discord. You'll need to export OPENAI_API_KEY to use the feature...
Jaroslav Tulach reports a new STANDUP for yesterday (2023-06-27):
Progress: - Merged: https://github.com/enso-org/enso/pull/7115
private
discussion: https://github.com/orgs/enso-org/discussions/7088#discussioncomment-6256722Next Day: Investigate performance of node changes
DiscordDiscord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
GitHubMotivation - encapsulation Currently, all the entities (modules, types, methods, constructors, fields) from a project/library can be imported and used, even the entities that are meant to be intern...
As experienced in #6925, the
primary_key
annotation onselect_into_database_table
operation seems to be not registered.Actual behaviour
The widget on
primary_key
is a Vector Editor but it only allows to add aNothing
, not the actual column names as expected. CheckingWidgets.get_widget_json
we can see that the annotation for@primary_key
seems to not be applied for some reason.Expected behaviour
The
"primary_key"
widget JSON should not benull
- it is defined to beWidget_Helpers.make_column_name_vector_selector
.The above should then allow the vector editor to display the proper column selector dropdown.
Context
We checked if this may be due to the fact that
select_into_database_table
was defined on renamed types:but we split the extensions file into separate versions for in-memory and Database Tables, allowing to get rid of the renames and the issue persisted, so it is probably something else.