rusackas commented on code in PR #43345:
URL: https://github.com/apache/superset/pull/43345#discussion_r3879414172
##########
superset/charts/schemas.py:
##########
@@ -978,14 +977,7 @@ class ChartDataPostProcessingOperationSchema(Schema):
"example": "aggregate",
},
required=True,
- validate=validate.OneOf(
- choices=[
- name
- for name, value in inspect.getmembers(
- pandas_postprocessing, inspect.isfunction
- )
- ]
- ),
+ validate=validate.OneOf(choices=pandas_postprocessing.OPERATIONS),
Review Comment:
Good catch. Reworked it to a method-level check instead of the field-level
OneOf. Built-ins validate straight off `pandas_postprocessing.OPERATIONS`, and
anything else falls back to `EXTRA_PANDAS_POSTPROCESSING_OPS` before rejecting,
so the extension point still works.
##########
superset/charts/schemas.py:
##########
@@ -978,14 +977,7 @@ class ChartDataPostProcessingOperationSchema(Schema):
"example": "aggregate",
},
required=True,
- validate=validate.OneOf(
- choices=[
- name
- for name, value in inspect.getmembers(
- pandas_postprocessing, inspect.isfunction
- )
- ]
- ),
+ validate=validate.OneOf(choices=pandas_postprocessing.OPERATIONS),
Review Comment:
Fixed. Removed the stale escape_separator/unescape_separator entries from
the checked-in openapi.json so it matches what the schema actually accepts now.
--
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]