chore: enforce more ruff rules (#31447)

Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>
This commit is contained in:
Maxime Beauchemin
2024-12-18 17:41:34 -08:00
committed by GitHub
parent 9da65d6bfd
commit e51b95ffa8
375 changed files with 1821 additions and 1718 deletions

View File

@@ -214,7 +214,7 @@ def _find_columns_to_sanitize(cursor: Any) -> list[PlacedSanitizeFunc]:
:param cursor: the result set cursor
:returns: the list of tuples consisting of the column index and sanitization function
"""
""" # noqa: E501
return [
PlacedSanitizeFunc(i, _sanitized_ocient_type_codes[cursor.description[i][1]])
for i in range(len(cursor.description))
@@ -317,9 +317,7 @@ class OcientEngineSpec(BaseEngineSpec):
rows: list[tuple[Any, ...]] = super().fetch_data(cursor, limit)
except Exception:
with OcientEngineSpec.query_id_mapping_lock:
del OcientEngineSpec.query_id_mapping[
getattr(cursor, "superset_query_id")
]
del OcientEngineSpec.query_id_mapping[cursor.superset_query_id]
raise
# TODO: Unsure if we need to verify that we are receiving rows:
@@ -376,7 +374,7 @@ class OcientEngineSpec(BaseEngineSpec):
OcientEngineSpec.query_id_mapping[query.id] = cursor.query_id
# Add the query id to the cursor
setattr(cursor, "superset_query_id", query.id)
cursor.superset_query_id = query.id
return super().handle_cursor(cursor, query)
@classmethod