SEPURI-SAI-KRISHNA commented on code in PR #43225:
URL: https://github.com/apache/superset/pull/43225#discussion_r3789701307
##########
superset/charts/schemas.py:
##########
@@ -528,17 +526,15 @@ class
ChartDataRollingOptionsSchema(ChartDataPostProcessingOperationOptionsSchem
Rolling operation config.
"""
- columns = (
- fields.Dict(
- metadata={
- "description": "columns on which to perform rolling, mapping
source "
- "column to target column. For instance, `{'y': 'y'}` will
replace the "
- "column `y` with the rolling value in `y`, while `{'y': 'y2'}`
will add " # noqa: E501
- "a column `y2` based on rolling values calculated from `y`,
leaving the " # noqa: E501
- "original column `y` unchanged.",
- "example": {"weekly_rolling_sales": "sales"},
- },
- ),
+ columns = fields.Dict(
+ metadata={
+ "description": "columns on which to perform rolling, mapping
source "
+ "column to target column. For instance, `{'y': 'y'}` will replace
the "
+ "column `y` with the rolling value in `y`, while `{'y': 'y2'}`
will add "
+ "a column `y2` based on rolling values calculated from `y`,
leaving the "
+ "original column `y` unchanged.",
+ "example": {"weekly_rolling_sales": "sales"},
+ },
)
Review Comment:
Accurate, but pre-existing and out of scope here. This PR only unwraps the
declaration from the tuple that was hiding it, the `fields.Dict` and its value
typing are unchanged from what was already written.
More to the point, tightening it here wouldn't enforce anything.
`ChartDataPostProcessingOperationSchema.options` is a bare `fields.Dict`, so
the per-operation schemas are documentation for the OpenAPI spec and nothing
validates against them; a client can send any dict regardless of what this
field declares. Making the dispatch reject malformed options with a 400 rather
than a `TypeError` is a separate change to `exec_post_processing`.
--
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]