rusackas commented on code in PR #37625:
URL: https://github.com/apache/superset/pull/37625#discussion_r2770121943
##########
superset-frontend/src/explore/components/ExploreViewContainer/index.tsx:
##########
@@ -717,7 +829,10 @@ function ExploreViewContainer(props) {
.filter(control => control.validationErrors?.includes(message))
.map(control =>
typeof control.label === 'function'
- ? control.label(props.exploreState)
+ ? control.label(
+ props.exploreState as unknown as ControlPanelState,
+ control,
+ )
Review Comment:
The `control.label` function signature expects `ControlPanelState` as its
first argument, but `props.exploreState` has a different (broader) type. The
cast bridges this gap. Whether `exploreState` should actually BE a
`ControlPanelState` is an architectural question — the explore state contains
more than just control panel state (e.g., chart data, metadata). Typing it
directly as `ControlPanelState` would be inaccurate. The cast is the honest
approach for now.
##########
superset-frontend/src/explore/components/ExploreViewContainer/index.tsx:
##########
@@ -840,14 +980,15 @@ function ExploreViewContainer(props) {
/>
</span>
</div>
+ {/* eslint-disable @typescript-eslint/no-explicit-any --
DataSourcePanel uses narrower types that are compatible at runtime */}
<DataSourcePanel
formData={props.form_data}
- datasource={props.datasource}
- controls={props.controls}
- actions={props.actions}
+ datasource={props.datasource as any}
+ controls={props.controls as any}
+ actions={props.actions as any}
Review Comment:
Same situation — the `as any` casts on `datasource`, `controls`, and
`actions` exist because `DataSourcePanel` has narrower prop types than what the
parent component provides. The eslint-disable comment documents this. Proper
alignment would require updating `DataSourcePanel`'s prop types or the parent's
state types.
--
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]