-
Notifications
You must be signed in to change notification settings - Fork 326
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
Refactor Table problem handling to a more robust and hopefully cleaner approach #7879
Conversation
…ciated with _operations_ performed on tables, not the data itself
|
First small piece done: I managed to remove All tests are still passing so no regressions. We can continue this way, moving stuff piece by piece to the new approach. |
public void reportColumnAggregatedProblem(ColumnAggregatedProblem problem) { | ||
for (ColumnAggregatedProblem p : aggregatedProblemList) { | ||
if (p.merge(problem)) { | ||
// The problem was merged with an existing one. | ||
return; | ||
} | ||
} | ||
|
||
aggregatedProblemList.add(problem); | ||
} |
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.
ColumnAggregatedProblemAggregator
is a bit of a remnant of the old logic.
We would probably have done it slightly differently with this new system. I think we could streamline its internal implementation in the future a little bit - to make it slightly more efficient.
But it currently works well and fits OK into the current architecture, so I thought there is no need to over-engineer this at this point, as I don't think it is a bottleneck by any means - if we find out it is, we can roll more specialized solutions to aggregate the ColumnAggregatedProblem
more efficiently.
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.
Amazing to see so many classes replaced by a single unified approach!
...table/src/main/java/org/enso/table/data/column/operation/map/MapOperationProblemBuilder.java
Outdated
Show resolved
Hide resolved
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.
Couple of minor nits buts looks much cleaner albeit with a lot of passing aggregators round a lot more :)
Java_Problems.unpack_value_with_aggregated_problems on_problems problem_mapping=(Parse_Values_Helper.translate_parsing_problem type) <| | ||
parser.parseIndependentValue text | ||
Java_Problems.with_problem_aggregator on_problems java_problem_aggregator-> | ||
related_column_name = Nothing |
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.
assume this is just for clarity?
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.
Yes - I like to pass named arguments, but Java interop does not allow named args IIRC, so this is a way to show 'which' argument this Null is for.
std-bits/table/src/main/java/org/enso/table/parsing/TypeInferringParser.java
Outdated
Show resolved
Hide resolved
std-bits/table/src/main/java/org/enso/table/parsing/problems/InvalidFormat.java
Outdated
Show resolved
Hide resolved
# Conflicts: # distribution/lib/Standard/Table/0.0.0-dev/src/Excel/Excel_Workbook.enso # std-bits/table/src/main/java/org/enso/table/data/column/builder/Builder.java # test/Table_Tests/src/In_Memory/Builders_Spec.enso
Pull Request Description
Closes #7514
Important Notes
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
.