korbit-ai[bot] commented on code in PR #31747:
URL: https://github.com/apache/superset/pull/31747#discussion_r1907993536


##########
superset/examples/energy.py:
##########
@@ -61,7 +64,7 @@ def load_energy(
                 method="multi",
             )
 
-    print("Creating table [wb_health_population] reference")
+    logger.debug("Creating table [wb_health_population] reference")

Review Comment:
   ### Incorrect Table Name in Log Message <sub>![category 
Functionality](https://img.shields.io/badge/Functionality-0284c7)</sub>
   
   <details>
     <summary>Tell me more</summary>
   
   ###### What is the issue?
   The log message references 'wb_health_population' table but the code is 
actually working with the 'energy_usage' table.
   
   ###### Why this matters
   This incorrect log message could mislead developers during debugging or 
monitoring, making it harder to track issues related to the energy_usage table.
   
   ###### Suggested change
   ```python
   logger.debug("Creating table [energy_usage] reference")
   ```
   
   
   </details>
   
   ###### Chat with Korbit by mentioning @korbit-ai, and give a 👍 or 👎 to help 
Korbit improve your reviews.
   
   <!--- korbi internal id:e9524dee-5712-4b81-8844-2af5630de56c -->
   



##########
superset/utils/encrypt.py:
##########
@@ -22,7 +22,12 @@
 from flask_babel import lazy_gettext as _
 from sqlalchemy import text, TypeDecorator
 from sqlalchemy.engine import Connection, Dialect, Row
-from sqlalchemy_utils import EncryptedType
+from sqlalchemy_utils import EncryptedType as SqlaEncryptedType
+
+
+class EncryptedType(SqlaEncryptedType):
+    cache_ok = True

Review Comment:
   ### Unsafe Caching Configuration for Encrypted Type <sub>![category 
Functionality](https://img.shields.io/badge/Functionality-0284c7)</sub>
   
   <details>
     <summary>Tell me more</summary>
   
   ###### What is the issue?
   Setting cache_ok = True globally for EncryptedType might lead to incorrect 
caching of encrypted values in SQLAlchemy's type system.
   
   ###### Why this matters
   SQLAlchemy's type caching mechanism may reuse the same type instance across 
different columns, potentially causing encrypted data to be cached incorrectly 
and leading to security vulnerabilities or data corruption.
   
   ###### Suggested change
   Remove the cache_ok override or set it to False to prevent potential caching 
issues with encrypted data:
   ```python
   class EncryptedType(SqlaEncryptedType):
       cache_ok = False
   ```
   
   
   </details>
   
   ###### Chat with Korbit by mentioning @korbit-ai, and give a 👍 or 👎 to help 
Korbit improve your reviews.
   
   <!--- korbi internal id:4f538900-7608-4c26-86ca-710e7dd93cd2 -->
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to