[Chore/Refactor] Switch from MyPy to Basedpyright for type checking (#25047)

Signed-off-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
-LAN-
2025-09-03 11:52:26 +08:00
committed by GitHub
parent 1fff4620e6
commit 9d5956cef8
84 changed files with 2380 additions and 2351 deletions

View File

@@ -84,7 +84,7 @@ class VolumePermissionManager:
logger.warning("Unknown volume type: %s", self._volume_type)
return False
except Exception as e:
except Exception:
logger.exception("Permission check failed")
return False
@@ -119,7 +119,7 @@ class VolumePermissionManager:
)
return False
except Exception as e:
except Exception:
logger.exception("User Volume permission check failed")
# For User Volume, if permission check fails, it might be a configuration issue, provide friendlier error message
logger.info("User Volume permission check failed, but permission checking is disabled in this version")
@@ -158,7 +158,7 @@ class VolumePermissionManager:
return has_permission
except Exception as e:
except Exception:
logger.exception("Table volume permission check failed for %s", table_name)
return False
@@ -216,7 +216,7 @@ class VolumePermissionManager:
return has_permission
except Exception as e:
except Exception:
logger.exception("External volume permission check failed for %s", self._volume_name)
logger.info("External Volume permission check failed, but permission checking is disabled in this version")
return False
@@ -292,7 +292,7 @@ class VolumePermissionManager:
if result:
self._current_username = result[0]
return str(self._current_username)
except Exception as e:
except Exception:
logger.exception("Failed to get current username")
return "unknown"
@@ -316,7 +316,7 @@ class VolumePermissionManager:
for grant in grants:
if len(grant) >= 3: # Typical format: (privilege, object_type, object_name, ...)
privilege = grant[0].upper()
object_type = grant[1].upper() if len(grant) > 1 else ""
_ = grant[1].upper() if len(grant) > 1 else ""
# Collect all relevant permissions
if privilege in ["SELECT", "INSERT", "UPDATE", "DELETE", "ALL"]:
@@ -521,7 +521,7 @@ class VolumePermissionManager:
logger.warning("Unknown volume type for permission inheritance: %s", self._volume_type)
return False
except Exception as e:
except Exception:
logger.exception("Permission inheritance check failed")
return False