From 4e50943b51c086058e378a8e52e623089bd9120e Mon Sep 17 00:00:00 2001 From: Alex Happy <1223408988@qq.com> Date: Thu, 28 May 2026 17:01:35 +0800 Subject: [PATCH] cancel call GET /rows/:row_id/ API --- dtable_events/automations/general_actions.py | 9 +++++---- dtable_events/dtable_io/__init__.py | 17 ++++++++++++++--- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/dtable_events/automations/general_actions.py b/dtable_events/automations/general_actions.py index 304cf305..9eafd031 100644 --- a/dtable_events/automations/general_actions.py +++ b/dtable_events/automations/general_actions.py @@ -244,14 +244,15 @@ def get_converted_row(self, table_id, row_id): if not table: logger.error('dtable: %s table: %s not found', self.dtable_uuid, table_id) return None + sql = f"SELECT * FROM `{table['name']}` WHERE _id='{row_id}'" try: - converted_row = self.dtable_server_api.get_row(table['name'], row_id, convert_link_id=True) - if not converted_row: - logger.error('dtable: %s table: %s row: %s not found or parse error', self.dtable_uuid, table_id, row_id) - return None + rows = self.dtable_db_api.query(sql, convert=True, server_only=True)[0] except Exception as e: logger.error('dtable: %s table: %s row: %s error: %s', self.dtable_uuid, table_id, row_id, e) return None + if not rows: + return None + converted_row = rows[0] return converted_row def get_sql_row(self, table_id, row_id): diff --git a/dtable_events/dtable_io/__init__.py b/dtable_events/dtable_io/__init__.py index 74cb5180..d3fb1c52 100644 --- a/dtable_events/dtable_io/__init__.py +++ b/dtable_events/dtable_io/__init__.py @@ -13,7 +13,7 @@ from seaserv import seafile_api -from dtable_events.app.config import DTABLE_WEB_SERVICE_URL, INNER_DTABLE_SERVER_URL +from dtable_events.app.config import DTABLE_WEB_SERVICE_URL, INNER_DTABLE_SERVER_URL, INNER_DTABLE_DB_URL from dtable_events.dtable_io.big_data import import_excel_to_db, update_excel_to_db, export_big_data_to_excel, \ export_app_table_page_to_excel from dtable_events.dtable_io.utils import import_archive_from_src_dtable, post_big_data_screen_app_zip_file, \ @@ -36,6 +36,7 @@ from dtable_events.statistics.db import save_email_sending_records, batch_save_email_sending_records from dtable_events.data_sync.data_sync_utils import run_sync_emails from dtable_events.utils import is_valid_email, uuid_str_to_36_chars, gen_file_upload_url, uuid_str_to_32_chars +from dtable_events.utils.dtable_db_api import DTableDBAPI from dtable_events.utils.dtable_server_api import DTableServerAPI, BaseExceedsException from dtable_events.utils.dtable_web_api import DTableWebAPI from dtable_events.utils.exception import ExcelFormatError @@ -861,7 +862,12 @@ def send_notification_msg(emails, user_col_key, msg, dtable_uuid, username, tabl if not table: return - target_row = dtable_server_api.get_row(table['name'], row_id) + sql = f"SELECT * FROM `{table['name']}` WHERE _id='{row_id}'" + dtable_db_api = DTableDBAPI(username, dtable_uuid, INNER_DTABLE_DB_URL) + rows = dtable_db_api.query(sql, convert=True, server_only=True)[0] + if not rows: + return + target_row = rows[0] sending_list = emails if user_col_key: @@ -1173,7 +1179,12 @@ def plugin_email_send_email(context): dtable_server_api = DTableServerAPI(username, dtable_uuid, INNER_DTABLE_SERVER_URL, dtable_web_service_url=DTABLE_WEB_SERVICE_URL, repo_id=repo_id, workspace_id=workspace_id) - replied_email_row = dtable_server_api.get_row(email_table_name, email_row_id) + sql = f"SELECT * FROM `{email_table_name}` WHERE _id='{email_row_id}'" + dtable_db_api = DTableDBAPI(username, dtable_uuid, INNER_DTABLE_DB_URL) + rows = dtable_db_api.query(sql, convert=True, server_only=True)[0] + if not rows: + return + replied_email_row = rows[0] thread_id = replied_email_row.get('Thread ID')