This is an automated email from the ASF dual-hosted git repository.
beto pushed a commit to branch sc_74253
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/sc_74253 by this push:
new 441648282b Rename column
441648282b is described below
commit 441648282b135bf2c1cb74124a098fbf9aeeba68
Author: Beto Dealmeida <[email protected]>
AuthorDate: Tue Sep 5 21:21:36 2023 -0700
Rename column
---
superset-frontend/src/dashboard/actions/hydrate.js | 2 +-
superset-frontend/src/dashboard/components/gridComponents/Chart.jsx | 5 ++---
superset-frontend/src/explore/actions/saveModalActions.js | 2 +-
.../src/explore/components/ExploreChartPanel/index.jsx | 4 ++--
superset-frontend/src/types/Chart.ts | 2 +-
superset/charts/api.py | 4 ++--
superset/charts/schemas.py | 4 ++--
superset/explore/schemas.py | 2 +-
...023-09-05_16-44_122965576ebd_add_force_save_column_to_charts.py} | 6 +++---
superset/models/slice.py | 4 ++--
10 files changed, 17 insertions(+), 18 deletions(-)
diff --git a/superset-frontend/src/dashboard/actions/hydrate.js
b/superset-frontend/src/dashboard/actions/hydrate.js
index 5a8ac3a036..04ffb37408 100644
--- a/superset-frontend/src/dashboard/actions/hydrate.js
+++ b/superset-frontend/src/dashboard/actions/hydrate.js
@@ -152,7 +152,7 @@ export const hydrateDashboard =
owners: slice.owners,
modified: slice.modified,
changed_on: new Date(slice.changed_on).getTime(),
- outdated: slice.outdated,
+ force_save: slice.force_save,
};
sliceIds.add(key);
diff --git
a/superset-frontend/src/dashboard/components/gridComponents/Chart.jsx
b/superset-frontend/src/dashboard/components/gridComponents/Chart.jsx
index 8b797356fa..a6e09f21d3 100644
--- a/superset-frontend/src/dashboard/components/gridComponents/Chart.jsx
+++ b/superset-frontend/src/dashboard/components/gridComponents/Chart.jsx
@@ -221,7 +221,7 @@ class Chart extends React.Component {
this.setState({ descriptionHeight });
}
- if (this.props.slice.outdated) {
+ if (this.props.slice.force_save) {
const { slice, updateSlices } = this.props;
SupersetClient.put({
endpoint: `/api/v1/chart/${slice.slice_id}`,
@@ -229,7 +229,7 @@ class Chart extends React.Component {
body: JSON.stringify({
query_context: slice.query_context,
params: JSON.stringify(slice.form_data),
- outdated: false,
+ force_save: false,
}),
}).then(response =>
updateSlices({
@@ -391,7 +391,6 @@ class Chart extends React.Component {
}
render() {
- console.log(this.props.slice.outdated);
const {
id,
componentId,
diff --git a/superset-frontend/src/explore/actions/saveModalActions.js
b/superset-frontend/src/explore/actions/saveModalActions.js
index 0b87ce78d2..67b23df530 100644
--- a/superset-frontend/src/explore/actions/saveModalActions.js
+++ b/superset-frontend/src/explore/actions/saveModalActions.js
@@ -114,7 +114,7 @@ export const getSlicePayload = (
ownState: null,
}),
),
- outdated: false,
+ force_save: false,
};
return payload;
};
diff --git
a/superset-frontend/src/explore/components/ExploreChartPanel/index.jsx
b/superset-frontend/src/explore/components/ExploreChartPanel/index.jsx
index f2e9fcfdda..4357d99e86 100644
--- a/superset-frontend/src/explore/components/ExploreChartPanel/index.jsx
+++ b/superset-frontend/src/explore/components/ExploreChartPanel/index.jsx
@@ -173,11 +173,11 @@ const ExploreChartPanel = ({
ensureIsArray(chart.queriesResponse).length > 0;
/* When feature flags are toggled we might need to resave the chart to
update all
- * required parameters. This can be done by setting `Slice.outdated` to
false in a
+ * required parameters. This can be done by setting `Slice.force_save` to
false in a
* migration or manually. */
const updateChart = useCallback(
async function overwriteChart() {
- if (slice.outdated) {
+ if (slice.force_save) {
await actions.updateSlice(slice, slice.slice_name);
// TODO (betodealmeida): better refresh logic
window.location.reload();
diff --git a/superset-frontend/src/types/Chart.ts
b/superset-frontend/src/types/Chart.ts
index 649de90a4d..d9563477fc 100644
--- a/superset-frontend/src/types/Chart.ts
+++ b/superset-frontend/src/types/Chart.ts
@@ -74,7 +74,7 @@ export type Slice = {
query_context?: object;
is_managed_externally: boolean;
owners?: number[];
- outdated?: boolean;
+ force_save?: boolean;
};
export default Chart;
diff --git a/superset/charts/api.py b/superset/charts/api.py
index 3d7633a401..36473fd1f2 100644
--- a/superset/charts/api.py
+++ b/superset/charts/api.py
@@ -146,7 +146,7 @@ class ChartRestApi(BaseSupersetModelRestApi):
"viz_type",
"query_context",
"is_managed_externally",
- "outdated",
+ "force_save",
"tags.id",
"tags.name",
"tags.type",
@@ -195,7 +195,7 @@ class ChartRestApi(BaseSupersetModelRestApi):
"thumbnail_url",
"url",
"viz_type",
- "outdated",
+ "force_save",
"tags.id",
"tags.name",
"tags.type",
diff --git a/superset/charts/schemas.py b/superset/charts/schemas.py
index c83ea057d5..dabf7fcc0c 100644
--- a/superset/charts/schemas.py
+++ b/superset/charts/schemas.py
@@ -162,7 +162,7 @@ class ChartEntityResponseSchema(Schema):
description_markeddown = fields.String(
metadata={"description": description_markeddown_description}
)
- outdated = fields.Boolean(
+ force_save = fields.Boolean(
metadata={
"description": "Does the chart need to be re-saved to update
metadata?"
}
@@ -290,7 +290,7 @@ class ChartPutSchema(Schema):
is_managed_externally = fields.Boolean(allow_none=True, dump_default=False)
external_url = fields.String(allow_none=True)
tags = fields.Nested(TagSchema, many=True)
- outdated = fields.Boolean(
+ force_save = fields.Boolean(
metadata={
"description": "Does the chart need to be re-saved to update
metadata?"
}
diff --git a/superset/explore/schemas.py b/superset/explore/schemas.py
index 421bebcd92..e6131a797d 100644
--- a/superset/explore/schemas.py
+++ b/superset/explore/schemas.py
@@ -147,7 +147,7 @@ class SliceSchema(Schema):
slice_id = fields.Integer(metadata={"description": "The slice ID."})
slice_name = fields.String(metadata={"description": "The slice name."})
slice_url = fields.String(metadata={"description": "The slice URL."})
- oudated = fields.Boolean(
+ force_save = fields.Boolean(
metadata={
"description": "Does the chart need to be re-saved to update
metadata?"
}
diff --git
a/superset/migrations/versions/2023-09-05_16-44_122965576ebd_add_outdated_column_to_charts.py
b/superset/migrations/versions/2023-09-05_16-44_122965576ebd_add_force_save_column_to_charts.py
similarity index 87%
rename from
superset/migrations/versions/2023-09-05_16-44_122965576ebd_add_outdated_column_to_charts.py
rename to
superset/migrations/versions/2023-09-05_16-44_122965576ebd_add_force_save_column_to_charts.py
index e31d536d00..30a1157868 100644
---
a/superset/migrations/versions/2023-09-05_16-44_122965576ebd_add_outdated_column_to_charts.py
+++
b/superset/migrations/versions/2023-09-05_16-44_122965576ebd_add_force_save_column_to_charts.py
@@ -14,7 +14,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-"""Add outdated column to charts
+"""Add force_save column to charts
Revision ID: 122965576ebd
Revises: ec54aca4c8a2
@@ -33,9 +33,9 @@ down_revision = "ec54aca4c8a2"
def upgrade():
op.add_column(
"slices",
- sa.Column("outdated", sa.Boolean(), nullable=True, default=False),
+ sa.Column("force_save", sa.Boolean(), nullable=True, default=False),
)
def downgrade():
- op.drop_column("slices", "outdated")
+ op.drop_column("slices", "force_save")
diff --git a/superset/models/slice.py b/superset/models/slice.py
index 6b42b917c4..a3111c1b90 100644
--- a/superset/models/slice.py
+++ b/superset/models/slice.py
@@ -120,7 +120,7 @@ class Slice( # pylint: disable=too-many-public-methods
# force the chart to re-save itself; this is useful when the backend has
missing
# information that can only be computed by the frontend
- outdated = Column(Boolean, nullable=True, default=False)
+ force_save = Column(Boolean, nullable=True, default=False)
token = ""
@@ -251,7 +251,7 @@ class Slice( # pylint: disable=too-many-public-methods
"certified_by": self.certified_by,
"certification_details": self.certification_details,
"is_managed_externally": self.is_managed_externally,
- "outdated": self.outdated,
+ "force_save": self.force_save,
}
@property