This is an automated email from the ASF dual-hosted git repository.

hainenber pushed a commit to branch 
chore/fix-oxlint-issue-with-optional-chaining
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 4fa71b9cb635a7f2a506e5285e58095cebab9b70
Author: hainenber <[email protected]>
AuthorDate: Thu Feb 19 23:26:34 2026 +0700

    chore: fix lint issue with `no-unsafe-optional-chaining` rule
    
    Signed-off-by: hainenber <[email protected]>
---
 .../test/MixedTimeseries/transformProps.test.ts                     | 2 +-
 .../plugin-chart-echarts/test/Timeseries/transformProps.test.ts     | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/superset-frontend/plugins/plugin-chart-echarts/test/MixedTimeseries/transformProps.test.ts
 
b/superset-frontend/plugins/plugin-chart-echarts/test/MixedTimeseries/transformProps.test.ts
index 76562999515..57b91f8330a 100644
--- 
a/superset-frontend/plugins/plugin-chart-echarts/test/MixedTimeseries/transformProps.test.ts
+++ 
b/superset-frontend/plugins/plugin-chart-echarts/test/MixedTimeseries/transformProps.test.ts
@@ -431,5 +431,5 @@ test('should add a formula annotation when X-axis column 
has dataset-level label
   expect(formulaSeries).toBeDefined();
   expect(formulaSeries?.data).toBeDefined();
   expect(Array.isArray(formulaSeries?.data)).toBe(true);
-  expect((formulaSeries?.data as unknown[]).length).toBeGreaterThan(0);
+  expect((formulaSeries?.data as unknown[])?.length).toBeGreaterThan(0);
 });
diff --git 
a/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformProps.test.ts
 
b/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformProps.test.ts
index 89303f7f1bb..f8384bfbe78 100644
--- 
a/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformProps.test.ts
+++ 
b/superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/transformProps.test.ts
@@ -304,8 +304,8 @@ describe('EchartsTimeseries transformProps', () => {
     expect(formulaSeries).toBeDefined();
     expect(formulaSeries?.data).toBeDefined();
     expect(Array.isArray(formulaSeries?.data)).toBe(true);
-    expect((formulaSeries?.data as unknown[]).length).toBeGreaterThan(0);
-    const firstDataPoint = (formulaSeries?.data as [number, number][])[0];
+    expect((formulaSeries?.data as unknown[])?.length).toBeGreaterThan(0);
+    const firstDataPoint = (formulaSeries?.data as [number, number][])?.[0];
     expect(firstDataPoint).toBeDefined();
     expect(firstDataPoint[1]).toBe(firstDataPoint[0] * 2);
   });
@@ -384,7 +384,7 @@ describe('EchartsTimeseries transformProps', () => {
       result.echartOptions.series as SeriesOption[] | undefined
     )?.find((s: SeriesOption) => s.name === 'My Formula');
     expect(formulaSeries).toBeDefined();
-    const firstDataPoint = (formulaSeries?.data as [number, number][])[0];
+    const firstDataPoint = (formulaSeries?.data as [number, number][])?.[0];
     expect(firstDataPoint).toBeDefined();
     expect(firstDataPoint[0]).toBe(firstDataPoint[1] * 2);
   });

Reply via email to