@@ -209,7 +209,7 @@ def _create_cluster(self) -> Any:
209209 port = self .config .PORT ,
210210 auth_provider = auth_provider ,
211211 protocol_version = self .config .PROTOCOL_VERSION ,
212- compression = True if self .config .COMPRESSION else False ,
212+ compression = bool ( self .config .COMPRESSION ) ,
213213 connect_timeout = self .config .CONNECT_TIMEOUT ,
214214 load_balancing_policy = load_balancing_policy ,
215215 default_retry_policy = retry_policy ,
@@ -405,7 +405,7 @@ def insert(self, table: str, data: dict[str, Any], ttl: int | None = None, if_no
405405 This prevents errors on duplicate primary keys but is slow
406406 """
407407 columns = ", " .join (data .keys ())
408- placeholders = ", " .join (["%s" for _ in data . keys () ])
408+ placeholders = ", " .join (["%s" for _ in data ])
409409 query = f"INSERT INTO { table } ({ columns } ) VALUES ({ placeholders } )"
410410
411411 if if_not_exists :
@@ -442,7 +442,7 @@ def select(
442442
443443 params = None
444444 if conditions :
445- where_clause = " AND " .join ([f"{ key } = %s" for key in conditions . keys () ])
445+ where_clause = " AND " .join ([f"{ key } = %s" for key in conditions ])
446446 query += f" WHERE { where_clause } "
447447 params = tuple (conditions .values ())
448448
@@ -463,8 +463,8 @@ def update(self, table: str, data: dict[str, Any], conditions: dict[str, Any], t
463463 conditions (dict[str, Any]): WHERE clause conditions as key-value pairs.
464464 ttl (int | None): Time to live in seconds. If None, data persists indefinitely.
465465 """
466- set_clause = ", " .join ([f"{ key } = %s" for key in data . keys () ])
467- where_clause = " AND " .join ([f"{ key } = %s" for key in conditions . keys () ])
466+ set_clause = ", " .join ([f"{ key } = %s" for key in data ])
467+ where_clause = " AND " .join ([f"{ key } = %s" for key in conditions ])
468468 query = f"UPDATE { table } "
469469
470470 if ttl is not None :
@@ -489,7 +489,7 @@ def delete(self, table: str, conditions: dict[str, Any]) -> None:
489489 table (str): The name of the table.
490490 conditions (dict[str, Any]): WHERE clause conditions as key-value pairs.
491491 """
492- where_clause = " AND " .join ([f"{ key } = %s" for key in conditions . keys () ])
492+ where_clause = " AND " .join ([f"{ key } = %s" for key in conditions ])
493493 query = f"DELETE FROM { table } WHERE { where_clause } "
494494
495495 try :
@@ -610,7 +610,7 @@ def count(self, table: str, conditions: dict[str, Any] | None = None) -> int:
610610
611611 params = None
612612 if conditions :
613- where_clause = " AND " .join ([f"{ key } = %s" for key in conditions . keys () ])
613+ where_clause = " AND " .join ([f"{ key } = %s" for key in conditions ])
614614 query += f" WHERE { where_clause } ALLOW FILTERING"
615615 params = tuple (conditions .values ())
616616
@@ -634,7 +634,7 @@ def exists(self, table: str, conditions: dict[str, Any]) -> bool:
634634 Returns:
635635 bool: True if at least one row exists, False otherwise.
636636 """
637- where_clause = " AND " .join ([f"{ key } = %s" for key in conditions . keys () ])
637+ where_clause = " AND " .join ([f"{ key } = %s" for key in conditions ])
638638 query = f"SELECT COUNT(*) FROM { table } WHERE { where_clause } LIMIT 1 ALLOW FILTERING"
639639
640640 try :
@@ -792,7 +792,7 @@ def _create_cluster(self) -> Any:
792792 port = self .config .PORT ,
793793 auth_provider = auth_provider ,
794794 protocol_version = self .config .PROTOCOL_VERSION ,
795- compression = True if self .config .COMPRESSION else False ,
795+ compression = bool ( self .config .COMPRESSION ) ,
796796 connect_timeout = self .config .CONNECT_TIMEOUT ,
797797 load_balancing_policy = load_balancing_policy ,
798798 default_retry_policy = retry_policy ,
@@ -1008,7 +1008,7 @@ async def insert(
10081008 This prevents errors on duplicate primary keys but is slow
10091009 """
10101010 columns = ", " .join (data .keys ())
1011- placeholders = ", " .join (["%s" for _ in data . keys () ])
1011+ placeholders = ", " .join (["%s" for _ in data ])
10121012 query = f"INSERT INTO { table } ({ columns } ) VALUES ({ placeholders } )"
10131013
10141014 if if_not_exists :
@@ -1045,7 +1045,7 @@ async def select(
10451045
10461046 params = None
10471047 if conditions :
1048- where_clause = " AND " .join ([f"{ key } = %s" for key in conditions . keys () ])
1048+ where_clause = " AND " .join ([f"{ key } = %s" for key in conditions ])
10491049 query += f" WHERE { where_clause } "
10501050 params = tuple (conditions .values ())
10511051
@@ -1072,8 +1072,8 @@ async def update(
10721072 conditions (dict[str, Any]): WHERE clause conditions as key-value pairs.
10731073 ttl (int | None): Time to live in seconds. If None, data persists indefinitely.
10741074 """
1075- set_clause = ", " .join ([f"{ key } = %s" for key in data . keys () ])
1076- where_clause = " AND " .join ([f"{ key } = %s" for key in conditions . keys () ])
1075+ set_clause = ", " .join ([f"{ key } = %s" for key in data ])
1076+ where_clause = " AND " .join ([f"{ key } = %s" for key in conditions ])
10771077 query = f"UPDATE { table } "
10781078
10791079 if ttl is not None :
@@ -1098,7 +1098,7 @@ async def delete(self, table: str, conditions: dict[str, Any]) -> None:
10981098 table (str): The name of the table.
10991099 conditions (dict[str, Any]): WHERE clause conditions as key-value pairs.
11001100 """
1101- where_clause = " AND " .join ([f"{ key } = %s" for key in conditions . keys () ])
1101+ where_clause = " AND " .join ([f"{ key } = %s" for key in conditions ])
11021102 query = f"DELETE FROM { table } WHERE { where_clause } "
11031103
11041104 try :
@@ -1225,7 +1225,7 @@ async def count(self, table: str, conditions: dict[str, Any] | None = None) -> i
12251225
12261226 params = None
12271227 if conditions :
1228- where_clause = " AND " .join ([f"{ key } = %s" for key in conditions . keys () ])
1228+ where_clause = " AND " .join ([f"{ key } = %s" for key in conditions ])
12291229 query += f" WHERE { where_clause } ALLOW FILTERING"
12301230 params = tuple (conditions .values ())
12311231
@@ -1249,7 +1249,7 @@ async def exists(self, table: str, conditions: dict[str, Any]) -> bool:
12491249 Returns:
12501250 bool: True if at least one row exists, False otherwise.
12511251 """
1252- where_clause = " AND " .join ([f"{ key } = %s" for key in conditions . keys () ])
1252+ where_clause = " AND " .join ([f"{ key } = %s" for key in conditions ])
12531253 query = f"SELECT COUNT(*) FROM { table } WHERE { where_clause } LIMIT 1 ALLOW FILTERING"
12541254
12551255 try :
0 commit comments