-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Port view to C++ #452
Port view to C++ #452
Conversation
the python binding needs a lot of work before it can be fully usable, in the mean time so long as the tests pass feel free to comment out as needed and i'll reimplement later |
@@ -280,6 +312,137 @@ filter_op_to_str(t_filter_op op) { | |||
return ""; | |||
} | |||
|
|||
t_filter_op | |||
str_to_filter_op(std::string str) { | |||
if (str == "<") { |
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.
don't like switch statements?
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.
You can’t switch on a string in C++, so it was this or write another enum that gets mapped to the original enum.
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.
you can do some stuff, but I think what you've done here is more readable and fine.
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.
Fixed via commit
Move pivot table operations to C++ move set_depth calls into emscripten.cpp rebase on cpp-subproject move agg + filter to_string methods into base.cpp
Move aggregate and filter parsing to C++ Move aggregate parsing to c++
Construct the View in C++ Fix column pivot issues Make sure that filters work with typed-in dates Fix column-only
Thanks for the PR! This looks great and really improves the JS and C++ API code. I've added a few additional cleanup bits and gone ahead and removed the @timkpaine Thanks for the review. Fully agreed on all fronts - we'll definitely need to address these. |
This PR ports the view class to C++ in order to enhance portability and allow for more flexible language bindings.
JS Changes
table.prototype.view
refactored to pass the config into C++psp_okey
for column-only views now useview.column_only
internal.js
has been marked skip due to change in how we handle incorrect arity aggregates - reenable?C++ changes
View
class holds aggregates, pivots, filters, sorts, and at_config
objectt_config
has new constructors and members oriented towards view creationmake_context
is no longer exposed to emscriptenget_aggspecs
,get_fterms
,get_sortspec
now handle the parsing of config optionsbase.h
Python tests do not pass at the moment because function bindings in
binding.h
have been changed. I'm starting the PR as a place where we can review + talk about these changes in the codebase.