You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by mi...@apache.org on 2023/12/11 16:29:03 UTC

(superset) branch 3.1 updated (d0961d0ed8 -> be81aaa31a)

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

michaelsmolina pushed a change to branch 3.1
in repository https://gitbox.apache.org/repos/asf/superset.git


    from d0961d0ed8 fix(plugin-chart-echarts): support truncated numeric x-axis (#26215)
     new 38b8b03f90 fix: Use page.locator in Playwright reports (#26224)
     new 463989dbc9 chore: Moves xAxisLabelRotation to shared controls (#26212)
     new 8185ac3e33 chore: lock the databend-sqlalchemy version (#26082)
     new be81aaa31a fix: bump pyarrow constraints (CVE-2023-47248) (#26187)

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 requirements/base.txt                              |  3 +-
 setup.py                                           |  3 +-
 .../plugin-chart-echarts/src/Bubble/constants.ts   |  3 +-
 .../src/Bubble/controlPanel.tsx                    | 35 ++++---------
 .../src/MixedTimeseries/controlPanel.tsx           | 29 +++-------
 .../src/Timeseries/Area/controlPanel.tsx           | 24 +--------
 .../src/Timeseries/Regular/Bar/controlPanel.tsx    | 19 ++-----
 .../src/Timeseries/Regular/Line/controlPanel.tsx   | 24 +--------
 .../Timeseries/Regular/Scatter/controlPanel.tsx    | 24 +--------
 .../Timeseries/Regular/SmoothLine/controlPanel.tsx | 24 +--------
 .../src/Timeseries/Step/controlPanel.tsx           | 24 +--------
 .../src/Timeseries/constants.ts                    |  3 +-
 .../plugins/plugin-chart-echarts/src/controls.tsx  | 19 +++++++
 .../plugins/plugin-chart-echarts/src/defaults.ts   |  5 ++
 superset/utils/webdriver.py                        | 61 ++++++++++------------
 superset/views/datasource/utils.py                 |  2 +-
 16 files changed, 89 insertions(+), 213 deletions(-)


(superset) 04/04: fix: bump pyarrow constraints (CVE-2023-47248) (#26187)

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

michaelsmolina pushed a commit to branch 3.1
in repository https://gitbox.apache.org/repos/asf/superset.git

commit be81aaa31aa15f5e6d166d1ebfdb73ecd4f1462e
Author: cwegener <cw...@users.noreply.github.com>
AuthorDate: Mon Dec 11 16:27:53 2023 +0000

    fix: bump pyarrow constraints (CVE-2023-47248) (#26187)
    
    (cherry picked from commit 2ac28927a326fee6431b5e01f7930e650c636c17)
---
 requirements/base.txt | 3 ++-
 setup.py              | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/requirements/base.txt b/requirements/base.txt
index e8b1b43f91..df8f3ea557 100644
--- a/requirements/base.txt
+++ b/requirements/base.txt
@@ -252,7 +252,7 @@ prison==0.2.1
     # via flask-appbuilder
 prompt-toolkit==3.0.38
     # via click-repl
-pyarrow==12.0.0
+pyarrow==14.0.1
     # via apache-superset
 pycparser==2.20
     # via cffi
@@ -371,6 +371,7 @@ werkzeug==2.3.3
     # via
     #   apache-superset
     #   flask
+    #   flask-appbuilder
     #   flask-jwt-extended
     #   flask-login
 wrapt==1.15.0
diff --git a/setup.py b/setup.py
index c3cc887bbf..18fb4dd1e6 100644
--- a/setup.py
+++ b/setup.py
@@ -113,7 +113,7 @@ setup(
         "python-dateutil",
         "python-dotenv",
         "python-geohash",
-        "pyarrow>=12.0.0, <13",
+        "pyarrow>=14.0.1, <15",
         "pyyaml>=6.0.0, <7.0.0",
         "PyJWT>=2.4.0, <3.0",
         "redis>=4.5.4, <5.0",


(superset) 02/04: chore: Moves xAxisLabelRotation to shared controls (#26212)

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

michaelsmolina pushed a commit to branch 3.1
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 463989dbc9ae6b5d659318fae7bdf45178bedb26
Author: Michael S. Molina <70...@users.noreply.github.com>
AuthorDate: Fri Dec 8 13:37:06 2023 -0300

    chore: Moves xAxisLabelRotation to shared controls (#26212)
    
    (cherry picked from commit 005cf5947b430543cef841f44f29a816ef884931)
---
 .../plugin-chart-echarts/src/Bubble/constants.ts   |  3 +-
 .../src/Bubble/controlPanel.tsx                    | 35 +++++++---------------
 .../src/MixedTimeseries/controlPanel.tsx           | 29 ++++--------------
 .../src/Timeseries/Area/controlPanel.tsx           | 24 ++-------------
 .../src/Timeseries/Regular/Bar/controlPanel.tsx    | 19 ++----------
 .../src/Timeseries/Regular/Line/controlPanel.tsx   | 24 ++-------------
 .../Timeseries/Regular/Scatter/controlPanel.tsx    | 24 ++-------------
 .../Timeseries/Regular/SmoothLine/controlPanel.tsx | 24 ++-------------
 .../src/Timeseries/Step/controlPanel.tsx           | 24 ++-------------
 .../src/Timeseries/constants.ts                    |  3 +-
 .../plugins/plugin-chart-echarts/src/controls.tsx  | 19 ++++++++++++
 .../plugins/plugin-chart-echarts/src/defaults.ts   |  5 ++++
 12 files changed, 57 insertions(+), 176 deletions(-)

diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Bubble/constants.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Bubble/constants.ts
index 9c157d33ac..89b03d5e90 100644
--- a/superset-frontend/plugins/plugin-chart-echarts/src/Bubble/constants.ts
+++ b/superset-frontend/plugins/plugin-chart-echarts/src/Bubble/constants.ts
@@ -17,6 +17,7 @@
  * under the License.
  */
 import { DEFAULT_LEGEND_FORM_DATA } from '../constants';
+import { defaultXAxis } from '../defaults';
 import { EchartsBubbleFormData } from './types';
 
 export const DEFAULT_FORM_DATA: Partial<EchartsBubbleFormData> = {
@@ -29,7 +30,7 @@ export const DEFAULT_FORM_DATA: Partial<EchartsBubbleFormData> = {
   truncateXAxis: false,
   truncateYAxis: false,
   yAxisBounds: [null, null],
-  xAxisLabelRotation: 0,
+  xAxisLabelRotation: defaultXAxis.xAxisLabelRotation,
   opacity: 0.6,
 };
 
diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Bubble/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Bubble/controlPanel.tsx
index 532888b485..521ae98130 100644
--- a/superset-frontend/plugins/plugin-chart-echarts/src/Bubble/controlPanel.tsx
+++ b/superset-frontend/plugins/plugin-chart-echarts/src/Bubble/controlPanel.tsx
@@ -26,10 +26,15 @@ import {
 } from '@superset-ui/chart-controls';
 
 import { DEFAULT_FORM_DATA } from './constants';
-import { legendSection, truncateXAxis, xAxisBounds } from '../controls';
+import {
+  legendSection,
+  truncateXAxis,
+  xAxisBounds,
+  xAxisLabelRotation,
+} from '../controls';
+import { defaultYAxis } from '../defaults';
 
-const { logAxis, truncateYAxis, yAxisBounds, xAxisLabelRotation, opacity } =
-  DEFAULT_FORM_DATA;
+const { logAxis, truncateYAxis, yAxisBounds, opacity } = DEFAULT_FORM_DATA;
 
 const config: ControlPanelConfig = {
   controlPanelSections: [
@@ -127,27 +132,7 @@ const config: ControlPanelConfig = {
             },
           },
         ],
-        [
-          {
-            name: 'xAxisLabelRotation',
-            config: {
-              type: 'SelectControl',
-              freeForm: true,
-              clearable: false,
-              label: t('Rotate x axis label'),
-              choices: [
-                [0, '0°'],
-                [45, '45°'],
-                [90, '90°'],
-              ],
-              default: xAxisLabelRotation,
-              renderTrigger: true,
-              description: t(
-                'Input field supports custom rotation. e.g. 30 for 30°',
-              ),
-            },
-          },
-        ],
+        [xAxisLabelRotation],
         [
           {
             name: 'x_axis_title_margin',
@@ -212,7 +197,7 @@ const config: ControlPanelConfig = {
                 [0, '0°'],
                 [45, '45°'],
               ],
-              default: xAxisLabelRotation,
+              default: defaultYAxis.yAxisLabelRotation,
               renderTrigger: true,
               description: t(
                 'Input field supports custom rotation. e.g. 30 for 30°',
diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/controlPanel.tsx
index ec2443bb60..f54b3d01dc 100644
--- a/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/controlPanel.tsx
+++ b/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/controlPanel.tsx
@@ -32,7 +32,11 @@ import {
 
 import { DEFAULT_FORM_DATA } from './types';
 import { EchartsTimeseriesSeriesType } from '../Timeseries/types';
-import { legendSection, richTooltipSection } from '../controls';
+import {
+  legendSection,
+  richTooltipSection,
+  xAxisLabelRotation,
+} from '../controls';
 
 const {
   area,
@@ -49,7 +53,6 @@ const {
   truncateYAxis,
   yAxisBounds,
   zoomable,
-  xAxisLabelRotation,
   yAxisIndex,
 } = DEFAULT_FORM_DATA;
 
@@ -314,27 +317,7 @@ const config: ControlPanelConfig = {
         ...legendSection,
         [<ControlSubSectionHeader>{t('X Axis')}</ControlSubSectionHeader>],
         ['x_axis_time_format'],
-        [
-          {
-            name: 'xAxisLabelRotation',
-            config: {
-              type: 'SelectControl',
-              freeForm: true,
-              clearable: false,
-              label: t('Rotate x axis label'),
-              choices: [
-                [0, '0°'],
-                [45, '45°'],
-                [90, '90°'],
-              ],
-              default: xAxisLabelRotation,
-              renderTrigger: true,
-              description: t(
-                'Input field supports custom rotation. e.g. 30 for 30°',
-              ),
-            },
-          },
-        ],
+        [xAxisLabelRotation],
         ...richTooltipSection,
         // eslint-disable-next-line react/jsx-key
         [<ControlSubSectionHeader>{t('Y Axis')}</ControlSubSectionHeader>],
diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Area/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Area/controlPanel.tsx
index 018038772c..1ca2805b2f 100644
--- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Area/controlPanel.tsx
+++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Area/controlPanel.tsx
@@ -37,6 +37,7 @@ import {
   richTooltipSection,
   seriesOrderSection,
   percentageThresholdControl,
+  xAxisLabelRotation,
   truncateXAxis,
   xAxisBounds,
 } from '../../controls';
@@ -53,7 +54,6 @@ const {
   truncateYAxis,
   yAxisBounds,
   zoomable,
-  xAxisLabelRotation,
 } = DEFAULT_FORM_DATA;
 const config: ControlPanelConfig = {
   controlPanelSections: [
@@ -193,27 +193,7 @@ const config: ControlPanelConfig = {
             },
           },
         ],
-        [
-          {
-            name: 'xAxisLabelRotation',
-            config: {
-              type: 'SelectControl',
-              freeForm: true,
-              clearable: false,
-              label: t('Rotate x axis label'),
-              choices: [
-                [0, '0°'],
-                [45, '45°'],
-                [90, '90°'],
-              ],
-              default: xAxisLabelRotation,
-              renderTrigger: true,
-              description: t(
-                'Input field supports custom rotation. e.g. 30 for 30°',
-              ),
-            },
-          },
-        ],
+        [xAxisLabelRotation],
         ...richTooltipSection,
         // eslint-disable-next-line react/jsx-key
         [<ControlSubSectionHeader>{t('Y Axis')}</ControlSubSectionHeader>],
diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx
index c3002a2498..1fecf64e6a 100644
--- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx
+++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx
@@ -37,6 +37,7 @@ import {
   showValueSection,
   truncateXAxis,
   xAxisBounds,
+  xAxisLabelRotation,
 } from '../../../controls';
 
 import { OrientationType } from '../../types';
@@ -51,7 +52,6 @@ const {
   truncateYAxis,
   yAxisBounds,
   zoomable,
-  xAxisLabelRotation,
   orientation,
 } = DEFAULT_FORM_DATA;
 
@@ -165,22 +165,9 @@ function createAxisControl(axis: 'x' | 'y'): ControlSetRow[] {
     ],
     [
       {
-        name: 'xAxisLabelRotation',
+        name: xAxisLabelRotation.name,
         config: {
-          type: 'SelectControl',
-          freeForm: true,
-          clearable: false,
-          label: t('Rotate axis label'),
-          choices: [
-            [0, '0°'],
-            [45, '45°'],
-            [90, '90°'],
-          ],
-          default: xAxisLabelRotation,
-          renderTrigger: true,
-          description: t(
-            'Input field supports custom rotation. e.g. 30 for 30°',
-          ),
+          ...xAxisLabelRotation.config,
           visibility: ({ controls }: ControlPanelsContainerProps) =>
             isXAxis ? isVertical(controls) : isHorizontal(controls),
         },
diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Line/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Line/controlPanel.tsx
index 5c5f7a0ab1..488dac0738 100644
--- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Line/controlPanel.tsx
+++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Line/controlPanel.tsx
@@ -40,6 +40,7 @@ import {
   showValueSection,
   truncateXAxis,
   xAxisBounds,
+  xAxisLabelRotation,
 } from '../../../controls';
 
 const {
@@ -54,7 +55,6 @@ const {
   truncateYAxis,
   yAxisBounds,
   zoomable,
-  xAxisLabelRotation,
 } = DEFAULT_FORM_DATA;
 const config: ControlPanelConfig = {
   controlPanelSections: [
@@ -181,27 +181,7 @@ const config: ControlPanelConfig = {
             },
           },
         ],
-        [
-          {
-            name: 'xAxisLabelRotation',
-            config: {
-              type: 'SelectControl',
-              freeForm: true,
-              clearable: false,
-              label: t('Rotate x axis label'),
-              choices: [
-                [0, '0°'],
-                [45, '45°'],
-                [90, '90°'],
-              ],
-              default: xAxisLabelRotation,
-              renderTrigger: true,
-              description: t(
-                'Input field supports custom rotation. e.g. 30 for 30°',
-              ),
-            },
-          },
-        ],
+        [xAxisLabelRotation],
         ...richTooltipSection,
         // eslint-disable-next-line react/jsx-key
         [<ControlSubSectionHeader>{t('Y Axis')}</ControlSubSectionHeader>],
diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/controlPanel.tsx
index 6701647694..436000c62d 100644
--- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/controlPanel.tsx
+++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/controlPanel.tsx
@@ -39,6 +39,7 @@ import {
   showValueSection,
   truncateXAxis,
   xAxisBounds,
+  xAxisLabelRotation,
 } from '../../../controls';
 
 const {
@@ -50,7 +51,6 @@ const {
   truncateYAxis,
   yAxisBounds,
   zoomable,
-  xAxisLabelRotation,
 } = DEFAULT_FORM_DATA;
 const config: ControlPanelConfig = {
   controlPanelSections: [
@@ -124,27 +124,7 @@ const config: ControlPanelConfig = {
             },
           },
         ],
-        [
-          {
-            name: 'xAxisLabelRotation',
-            config: {
-              type: 'SelectControl',
-              freeForm: true,
-              clearable: false,
-              label: t('Rotate x axis label'),
-              choices: [
-                [0, '0°'],
-                [45, '45°'],
-                [90, '90°'],
-              ],
-              default: xAxisLabelRotation,
-              renderTrigger: true,
-              description: t(
-                'Input field supports custom rotation. e.g. 30 for 30°',
-              ),
-            },
-          },
-        ],
+        [xAxisLabelRotation],
         // eslint-disable-next-line react/jsx-key
         ...richTooltipSection,
         // eslint-disable-next-line react/jsx-key
diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/controlPanel.tsx
index 0c6623f216..2e05ab8202 100644
--- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/controlPanel.tsx
+++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/controlPanel.tsx
@@ -39,6 +39,7 @@ import {
   showValueSectionWithoutStack,
   truncateXAxis,
   xAxisBounds,
+  xAxisLabelRotation,
 } from '../../../controls';
 
 const {
@@ -50,7 +51,6 @@ const {
   truncateYAxis,
   yAxisBounds,
   zoomable,
-  xAxisLabelRotation,
 } = DEFAULT_FORM_DATA;
 const config: ControlPanelConfig = {
   controlPanelSections: [
@@ -123,27 +123,7 @@ const config: ControlPanelConfig = {
             },
           },
         ],
-        [
-          {
-            name: 'xAxisLabelRotation',
-            config: {
-              type: 'SelectControl',
-              freeForm: true,
-              clearable: false,
-              label: t('Rotate x axis label'),
-              choices: [
-                [0, '0°'],
-                [45, '45°'],
-                [90, '90°'],
-              ],
-              default: xAxisLabelRotation,
-              renderTrigger: true,
-              description: t(
-                'Input field supports custom rotation. e.g. 30 for 30°',
-              ),
-            },
-          },
-        ],
+        [xAxisLabelRotation],
         // eslint-disable-next-line react/jsx-key
         ...richTooltipSection,
         // eslint-disable-next-line react/jsx-key
diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Step/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Step/controlPanel.tsx
index 021c306d05..311b85cac0 100644
--- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Step/controlPanel.tsx
+++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Step/controlPanel.tsx
@@ -37,6 +37,7 @@ import {
   showValueSection,
   truncateXAxis,
   xAxisBounds,
+  xAxisLabelRotation,
 } from '../../controls';
 
 const {
@@ -50,7 +51,6 @@ const {
   truncateYAxis,
   yAxisBounds,
   zoomable,
-  xAxisLabelRotation,
 } = DEFAULT_FORM_DATA;
 const config: ControlPanelConfig = {
   controlPanelSections: [
@@ -175,27 +175,7 @@ const config: ControlPanelConfig = {
             },
           },
         ],
-        [
-          {
-            name: 'xAxisLabelRotation',
-            config: {
-              type: 'SelectControl',
-              freeForm: true,
-              clearable: false,
-              label: t('Rotate x axis label'),
-              choices: [
-                [0, '0°'],
-                [45, '45°'],
-                [90, '90°'],
-              ],
-              default: xAxisLabelRotation,
-              renderTrigger: true,
-              description: t(
-                'Input field supports custom rotation. e.g. 30 for 30°',
-              ),
-            },
-          },
-        ],
+        [xAxisLabelRotation],
         ...richTooltipSection,
         // eslint-disable-next-line react/jsx-key
         [<ControlSubSectionHeader>{t('Y Axis')}</ControlSubSectionHeader>],
diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/constants.ts b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/constants.ts
index a95a14077d..215996ab12 100644
--- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/constants.ts
+++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/constants.ts
@@ -30,6 +30,7 @@ import {
   DEFAULT_LEGEND_FORM_DATA,
   DEFAULT_TITLE_FORM_DATA,
 } from '../constants';
+import { defaultXAxis } from '../defaults';
 
 // @ts-ignore
 export const DEFAULT_FORM_DATA: EchartsTimeseriesFormData = {
@@ -62,7 +63,7 @@ export const DEFAULT_FORM_DATA: EchartsTimeseriesFormData = {
   yAxisBounds: [null, null],
   zoomable: false,
   richTooltip: true,
-  xAxisLabelRotation: 0,
+  xAxisLabelRotation: defaultXAxis.xAxisLabelRotation,
   groupby: [],
   showValue: false,
   onlyTotal: false,
diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/controls.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/controls.tsx
index 093617446a..13fe754d99 100644
--- a/superset-frontend/plugins/plugin-chart-echarts/src/controls.tsx
+++ b/superset-frontend/plugins/plugin-chart-echarts/src/controls.tsx
@@ -29,6 +29,7 @@ import {
 } from '@superset-ui/chart-controls';
 import { DEFAULT_LEGEND_FORM_DATA, StackControlOptions } from './constants';
 import { DEFAULT_FORM_DATA } from './Timeseries/constants';
+import { defaultXAxis } from './defaults';
 
 const { legendMargin, legendOrientation, legendType, showLegend } =
   DEFAULT_LEGEND_FORM_DATA;
@@ -243,6 +244,24 @@ const sortSeriesAscending: ControlSetItem = {
   },
 };
 
+export const xAxisLabelRotation = {
+  name: 'xAxisLabelRotation',
+  config: {
+    type: 'SelectControl',
+    freeForm: true,
+    clearable: false,
+    label: t('Rotate x axis label'),
+    choices: [
+      [0, '0°'],
+      [45, '45°'],
+      [90, '90°'],
+    ],
+    default: defaultXAxis.xAxisLabelRotation,
+    renderTrigger: true,
+    description: t('Input field supports custom rotation. e.g. 30 for 30°'),
+  },
+};
+
 export const seriesOrderSection: ControlSetRow[] = [
   [<ControlSubSectionHeader>{t('Series Order')}</ControlSubSectionHeader>],
   [sortSeriesType],
diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/defaults.ts b/superset-frontend/plugins/plugin-chart-echarts/src/defaults.ts
index c5ada14932..be37d6fcbf 100644
--- a/superset-frontend/plugins/plugin-chart-echarts/src/defaults.ts
+++ b/superset-frontend/plugins/plugin-chart-echarts/src/defaults.ts
@@ -24,6 +24,11 @@ export const defaultGrid = {
 
 export const defaultYAxis = {
   scale: true,
+  yAxisLabelRotation: 0,
+};
+
+export const defaultXAxis = {
+  xAxisLabelRotation: 0,
 };
 
 export const defaultLegendPadding = {


(superset) 01/04: fix: Use page.locator in Playwright reports (#26224)

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

michaelsmolina pushed a commit to branch 3.1
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 38b8b03f90739d39549a25c10c9452f33f08f2c6
Author: Kamil Gabryjelski <ka...@gmail.com>
AuthorDate: Fri Dec 8 17:16:13 2023 +0100

    fix: Use page.locator in Playwright reports (#26224)
    
    (cherry picked from commit dbed64a2c6508fc3c7c9ef6813924feca538a8cd)
---
 superset/utils/webdriver.py        | 61 +++++++++++++++++---------------------
 superset/views/datasource/utils.py |  2 +-
 2 files changed, 28 insertions(+), 35 deletions(-)

diff --git a/superset/utils/webdriver.py b/superset/utils/webdriver.py
index 4353319072..f7814bfd3b 100644
--- a/superset/utils/webdriver.py
+++ b/superset/utils/webdriver.py
@@ -48,8 +48,8 @@ if TYPE_CHECKING:
 if feature_flag_manager.is_feature_enabled("PLAYWRIGHT_REPORTS_AND_THUMBNAILS"):
     from playwright.sync_api import (
         BrowserContext,
-        ElementHandle,
         Error as PlaywrightError,
+        Locator,
         Page,
         sync_playwright,
         TimeoutError as PlaywrightTimeout,
@@ -105,14 +105,7 @@ class WebDriverPlaywright(WebDriverProxy):
                 alert_div.get_by_role("button").click()
 
                 # wait for modal to show up
-                page.wait_for_selector(
-                    ".ant-modal-content",
-                    timeout=current_app.config[
-                        "SCREENSHOT_WAIT_FOR_ERROR_MODAL_VISIBLE"
-                    ]
-                    * 1000,
-                    state="visible",
-                )
+                page.locator(".ant-modal-content").wait_for(state="visible")
                 err_msg_div = page.locator(".ant-modal-content .ant-modal-body")
                 #
                 # # collect error message
@@ -125,14 +118,7 @@ class WebDriverPlaywright(WebDriverProxy):
                 page.locator(".ant-modal-content .ant-modal-close").click()
                 #
                 # # wait until the modal becomes invisible
-                page.wait_for_selector(
-                    ".ant-modal-content",
-                    timeout=current_app.config[
-                        "SCREENSHOT_WAIT_FOR_ERROR_MODAL_INVISIBLE"
-                    ]
-                    * 1000,
-                    state="detached",
-                )
+                page.locator(".ant-modal-content").wait_for(state="detached")
                 try:
                     # Even if some errors can't be updated in the screenshot,
                     # keep all the errors in the server log and do not fail the loop
@@ -147,7 +133,9 @@ class WebDriverPlaywright(WebDriverProxy):
 
         return error_messages
 
-    def get_screenshot(self, url: str, element_name: str, user: User) -> bytes | None:
+    def get_screenshot(  # pylint: disable=too-many-locals, too-many-statements
+        self, url: str, element_name: str, user: User
+    ) -> bytes | None:
         with sync_playwright() as playwright:
             browser = playwright.chromium.launch()
             pixel_density = current_app.config["WEBDRIVER_WINDOW"].get(
@@ -166,24 +154,31 @@ class WebDriverPlaywright(WebDriverProxy):
             )
             self.auth(user, context)
             page = context.new_page()
-            page.goto(
-                url, wait_until=current_app.config["SCREENSHOT_PLAYWRIGHT_WAIT_EVENT"]
-            )
+            try:
+                page.goto(
+                    url,
+                    wait_until=current_app.config["SCREENSHOT_PLAYWRIGHT_WAIT_EVENT"],
+                )
+            except PlaywrightTimeout:
+                logger.exception(
+                    "Web event %s not detected. Page %s might not have been fully loaded",
+                    current_app.config["SCREENSHOT_PLAYWRIGHT_WAIT_EVENT"],
+                    url,
+                )
+
             img: bytes | None = None
             selenium_headstart = current_app.config["SCREENSHOT_SELENIUM_HEADSTART"]
             logger.debug("Sleeping for %i seconds", selenium_headstart)
             page.wait_for_timeout(selenium_headstart * 1000)
-            element: ElementHandle
+            element: Locator
             try:
                 try:
                     # page didn't load
                     logger.debug(
                         "Wait for the presence of %s at url: %s", element_name, url
                     )
-                    element = page.wait_for_selector(
-                        f".{element_name}",
-                        timeout=self._screenshot_locate_wait * 1000,
-                    )
+                    element = page.locator(f".{element_name}")
+                    element.wait_for()
                 except PlaywrightTimeout as ex:
                     logger.exception("Timed out requesting url %s", url)
                     raise ex
@@ -191,9 +186,10 @@ class WebDriverPlaywright(WebDriverProxy):
                 try:
                     # chart containers didn't render
                     logger.debug("Wait for chart containers to draw at url: %s", url)
-                    page.wait_for_selector(
-                        ".slice_container", timeout=self._screenshot_locate_wait * 1000
-                    )
+                    slice_container_locator = page.locator(".slice_container")
+                    slice_container_locator.first.wait_for()
+                    for slice_container_elem in slice_container_locator.all():
+                        slice_container_elem.wait_for()
                 except PlaywrightTimeout as ex:
                     logger.exception(
                         "Timed out waiting for chart containers to draw at url %s",
@@ -205,11 +201,8 @@ class WebDriverPlaywright(WebDriverProxy):
                     logger.debug(
                         "Wait for loading element of charts to be gone at url: %s", url
                     )
-                    page.wait_for_selector(
-                        ".loading",
-                        timeout=self._screenshot_load_wait * 1000,
-                        state="detached",
-                    )
+                    for loading_element in page.locator(".loading").all():
+                        loading_element.wait_for(state="detached")
                 except PlaywrightTimeout as ex:
                     logger.exception(
                         "Timed out waiting for charts to load at url %s", url
diff --git a/superset/views/datasource/utils.py b/superset/views/datasource/utils.py
index 61b7cc85bc..b08d1ccc15 100644
--- a/superset/views/datasource/utils.py
+++ b/superset/views/datasource/utils.py
@@ -43,7 +43,7 @@ def get_limit_clause(page: Optional[int], per_page: Optional[int]) -> dict[str,
     return {"row_offset": offset, "row_limit": limit}
 
 
-def get_samples(  # pylint: disable=too-many-arguments,too-many-locals
+def get_samples(  # pylint: disable=too-many-arguments
     datasource_type: str,
     datasource_id: int,
     force: bool = False,


(superset) 03/04: chore: lock the databend-sqlalchemy version (#26082)

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

michaelsmolina pushed a commit to branch 3.1
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 8185ac3e331563dfecba4b3f801d87073080d65c
Author: Jeremy <ha...@outlook.com>
AuthorDate: Sat Dec 9 02:23:03 2023 +0800

    chore: lock the databend-sqlalchemy version (#26082)
    
    Co-authored-by: John Bodley <45...@users.noreply.github.com>
    (cherry picked from commit fca5b829df31cc7266211745ac70522a54ee23ba)
---
 setup.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/setup.py b/setup.py
index 735154720e..c3cc887bbf 100644
--- a/setup.py
+++ b/setup.py
@@ -146,6 +146,7 @@ setup(
         "cockroachdb": ["cockroachdb>=0.3.5, <0.4"],
         "cors": ["flask-cors>=2.0.0"],
         "crate": ["crate[sqlalchemy]>=0.26.0, <0.27"],
+        "databend": ["databend-sqlalchemy>=0.3.2, <1.0"],
         "databricks": [
             "databricks-sql-connector>=2.0.2, <3",
             "sqlalchemy-databricks>=0.2.0",