adityajai119 opened a new pull request, #21830:
URL: https://github.com/apache/echarts/pull/21830

   <!-- Please fill in the following information to help us review your PR more 
efficiently. -->
   
   ## Brief Information
   
   This pull request is in the type of:
   
   - [x] bug fixing
   - [ ] new feature
   - [ ] others
   
   ### What does this PR do?
   
   Makes `transform.print` output the transform result after the upstream 
header and dimensions are inherited, so the printed data includes the header 
row and the printed dimensions are no longer `undefined`.
   
   ### Fixed issues
   
   - #15557: `print` output of a dataset transform does not include the first 
row of `dataset.source` and prints `undefined` dimensions
   
   ## Details
   
   ### Before: What was the problem?
   
   `applySingleDataTransform` printed the value returned by the transform 
before ECharts copies the upstream header rows into the result and inherits the 
upstream dimensions. For transforms that return only `data` (such as the 
built-in `filter` and `sort`), the printed data had no header row and the 
printed dimensions were `undefined`, although the series reads the header and 
the inherited dimensions.
   
   ### After: How does it behave after the fixing?
   
   The print now runs after the result sources are created and prints each 
result source's data and dimension names. With a header-detected source and a 
`filter` transform, the printed data starts with the header row and the printed 
dimensions are the header names. Only the dev-mode `print: true` path is 
affected.
   
   ## Document Info
   
   One of the following should be checked.
   
   - [x] This PR doesn't relate to document changes
   - [ ] The document should be updated later
   - [ ] The document changes have been made in apache/echarts-doc#xxx
   
   ## Misc
   
   ### Security Checking
   
   - [ ] This PR uses security-sensitive Web APIs.
   
   ### ZRender Changes
   
   - [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx).
   
   ### Related test cases or examples to use the new APIs
   
   Added `print_inherited_header_and_dimensions` to 
`test/ut/spec/data/dataTransform.test.ts`. It fails without the fix.
   
   Ran locally on this branch: the full unit suite (`npx jest --config 
test/ut/jest.config.cjs`, 26 suites / 195 tests pass), `eslint 
src/data/helper/transform.ts` and `tsc --noEmit`. The same commit also applies 
cleanly on `release` and passes `dataTransform.test.ts` there.
   
   ### Merging options
   
   - [ ] Please squash the commits into a single one when merging.
   
   ### Other information
   
   AI-assisted: drafted with an AI coding agent (see the `Generated-by` 
trailer, per the ASF generative tooling guidance); the tests above were run 
locally.
   


-- 
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]

Reply via email to