uwescience / raco

Compilation and rule-based optimization framework for relational algebra. Raco is the language, optimization, and query translation layer for the Myria project.
Other
72 stars 19 forks source link

`__repr__` is broken for logical operators #550

Open senderista opened 7 years ago

senderista commented 7 years ago

For physical operators, __repr__ persists all constructor args, so we can round-trip between repr() and eval() for physical plans. For logical plans, this doesn't work because the implementation of __repr__ for logical operators only persists the name of the class in the constructor call, with no args.

raco.myrial.myrial_test.MyrialTestCase.get_plan() always round-trips the generated plan through repr() and eval() to exercise this codepath, but that always fails for logical plans as described above. For now, I've disabled the round-tripping for logical plans (it still happens for physical plans).

The proper fix is to override __repr__ on all logical operators just as we do for physical operators.