SEPURI-SAI-KRISHNA commented on PR #44953:
URL: https://github.com/apache/superset/pull/44953#issuecomment-6038927764
Fair point, and bito raised the same thing earlier in the thread, so I have
restructured rather than argued it.
The handling now lives inside `QueryObject.exec_post_processing`'s loop
instead of at the two call sites. The loop already distinguishes a built-in
operation from one registered through `EXTRA_PANDAS_POSTPROCESSING_OPS`, so a
failure inside operator-owned code is left for the error handler and stays a
500:
```python
except (AttributeError, DataError, KeyError, TypeError, ValueError) as ex:
if not is_builtin:
raise
...
raise InvalidPostProcessingError(...) from ex
```
Three things fell out of it:
- The `KeyError` message can name the operation, so the "missing column"
wording is only used where it is accurate. That was the other half of your
comment, and it was the case I flagged as unfixable in the previous description
because the operation name was not in scope there.
- Both call sites go back to master untouched. The duplicated block is gone,
which was the duplication that got these two sites fixed eleven days apart to
begin with.
- Two tests now pin the exclusions: a custom operation's `ValueError`
propagates, and so does an `ImportError`.
The PR is 3 files instead of 5, and the suites run clean at 881 passed.
One thing I did not change: #44502's call-site handler for `TypeError` and
`pandas.errors.DataError` is still there, so those two types from a custom
operation remain a 400. Built-in operations no longer rely on it. Removing it
would make custom operations consistently 500, but it changes what #44502
decided and needs its tests edited, so I have left it as a follow-up rather
than folding it in here. Happy to do it in this PR if a maintainer would rather
see it settled in one go.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]