mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
chore(dao): Replace save/overwrite with create/update respectively (#24467)
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
# pylint: disable=arguments-renamed
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
@@ -54,18 +53,6 @@ class ChartDAO(BaseDAO[Slice]):
|
||||
db.session.rollback()
|
||||
raise ex
|
||||
|
||||
@staticmethod
|
||||
def save(slc: Slice, commit: bool = True) -> None:
|
||||
db.session.add(slc)
|
||||
if commit:
|
||||
db.session.commit()
|
||||
|
||||
@staticmethod
|
||||
def overwrite(slc: Slice, commit: bool = True) -> None:
|
||||
db.session.merge(slc)
|
||||
if commit:
|
||||
db.session.commit()
|
||||
|
||||
@staticmethod
|
||||
def favorited_ids(charts: list[Slice]) -> list[FavStar]:
|
||||
ids = [chart.id for chart in charts]
|
||||
|
||||
Reference in New Issue
Block a user