durgaprasadml opened a new pull request, #41916:
URL: https://github.com/apache/superset/pull/41916
### SUMMARY
This PR fixes the **Time-series Period Pivot** chart configuration issue
where the required **Metric** control was rendered in a non-interactive state,
preventing users from selecting a metric and causing chart execution to fail
with the error:
> Metric 'None' does not exist
### Root Cause
The `formDataOverrides` configuration in the TimePivot control panel
assigned the `shiftMetric` function itself instead of invoking it.
Before:
```ts
metric: getStandardizedControls().shiftMetric,
```
This stored a function reference as the metric value instead of the
transformed metric object expected by the control and query pipeline.
After:
```ts
metric: getStandardizedControls().shiftMetric(),
```
Invoking `shiftMetric()` correctly initializes the metric value, allowing
the Metric control to function as expected and ensuring a valid metric is
included in the generated query.
### Changes
- Invoke `shiftMetric()` in `TimePivot/controlPanel.ts` instead of assigning
the function reference.
- Add a regression test to verify:
- `shiftMetric()` is invoked.
- The returned metric is assigned to `formData`.
- Future regressions are detected during CI.
Fixes #41884
---
### BEFORE
- Metric field appears as required.
- Metric selector is disabled and cannot be interacted with.
- Users cannot add or select a metric.
- Running the query results in:
```
Metric 'None' does not exist
```
### AFTER
- Metric selector is interactive.
- Users can select a metric normally.
- A valid metric is included in the generated query.
- The Time-series Period Pivot chart renders successfully.
---
### TESTING INSTRUCTIONS
1. Start Superset locally.
2. Open **Explore**.
3. Select any dataset.
4. Choose the **Time-series Period Pivot** visualization.
5. Verify that the **Metric** control is enabled.
6. Select a metric.
7. Click **Run**.
8. Confirm that the chart renders successfully without the `Metric 'None'
does not exist` error.
9. Run the frontend test suite and verify that the new regression test
passes.
---
### ADDITIONAL INFORMATION
- [x] Has associated issue: Fixes #41884
- [ ] Required feature flags
- [x] Changes UI
- [ ] Includes DB Migration (follow approval process in SIP-59)
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
--
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]