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
Expand capabilities of Table.set
and better dropdown support,
#8005
Conversation
34bb5bf
to
88e6127
Compare
88e6127
to
acd1d5a
Compare
derive_value
and if
to the Table.Table.set
and better dropdown support,
ToDo
Follow up tickets
|
# Conflicts: # distribution/lib/Standard/Database/0.0.0-dev/src/Main.enso
Radosław Waśko reports a new STANDUP for yesterday (2023-10-12): Progress: Added missing parts and tests to derive columns. It should be finished by 2023-10-13. Next Day: Next day I will be working on the same task. Do some cleanup, verify widgets work. Create followup tasks. |
Filter_Condition.Is_In values -> Filter_Condition.Is_In (check_is_in_values "Is_In" values) | ||
Filter_Condition.Not_In values -> Filter_Condition.Not_In (check_is_in_values "Not_In" values) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this check that the values
do not contain a Column_Ref
, because IIRC we have agreed that there is no sense to provide a column selector widget for this case - as it can be confusing. So I guess there is neither sense to resolve the Column_Ref
s here.
(The confusion is that normally operations work row-by-row but Is_In, when provided a column will look if the values on the left are contained anywhere within the column on the right - so it's a different logic.)
So I guessed that since we do not resolve the Column_Ref
, we should not accept it either - otehrwise it would be compared by equality and just yield to unexpected results.
Column_Ref is not allowed in Is_In to avoid unexpected behavior. As opposed to other operations, which operate on a row-by-row basis when passed a column, Is_In looks at the whole contents of the passed collection - thus usually expecting a Vector. If you want to filter the elements checking if they are present anywhere in a passed column, you can pass a column by first getting it from the table using the
at
operator.
IMO it explains OK why by default this is not allowed and how the user can work around it if they know what they are doing (use at
).
Please note that in normal flow, the user should never see this error - the widget for Is_In
does not suggest selecting column references - it includes blank _
nodes instead waiting for input. The error will only show up if the user manually types in Column_Ref.Name "..."
for this argument.
from Standard.Base import all | ||
|
||
## Reference to a column in a table. | ||
type Column_Ref | ||
## Reference to a column by name in a table. | ||
Name name:Text | ||
|
||
## Reference to a column by index in a table. | ||
Index index:Integer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved Column_Ref
to a separate file, because I think it may be used in other contexts as well so it seemed sensible to have it in its own file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Radek this looks great.
from Standard.Base import all | ||
|
||
## Reference to a column in a table. | ||
type Column_Ref | ||
## Reference to a column by name in a table. | ||
Name name:Text | ||
|
||
## Reference to a column by index in a table. | ||
Index index:Integer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Radosław Waśko reports a new STANDUP for the provided date (2023-10-13): Progress: Created followup tasks. Cleanup; got the PR merged. Work on optimizing add row number. It should be finished by 2023-10-13. Next Day: Next day I will be working on the #8055 task. Add another benchmark and see potential reasons for slowness, summarize. Get the Problem handling refactor merged |
Pull Request Description
set
.Table.set
can take aColumn_Operation
, allowing for deriving of a new column based on other columns.Column_Ref
type to refer to a column infilter
.Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
./run ide build
.