kaxil commented on code in PR #73381:
URL: https://github.com/apache/airflow/pull/73381#discussion_r4056849028


##########
providers/common/ai/src/airflow/providers/common/ai/toolsets/sql.py:
##########
@@ -171,9 +171,10 @@ class SQLToolset(AbstractToolset[Any]):
 
     :param db_conn_id: Airflow connection ID for the database.
     :param allowed_tables: Restrict the agent to a fixed set of tables. 
``None``
-        (default) exposes every table in ``schema``. Entries may be 
schema-qualified
-        (``"SCHEMA.TABLE"``) to span multiple schemas in one database -- 
common on
-        warehouses such as Snowflake. ``list_tables`` introspects each 
referenced
+        (default) exposes every table in ``schema``; an empty list raises
+        ``ValueError`` rather than silently exposing every table. Entries may 
be

Review Comment:
   `docs/toolsets.rst` carries the same parameter list (line 207) and still 
says only that `None` exposes all tables. Could the empty-list clause go there 
too? That page is where people land for this toolset, and the two descriptions 
have otherwise stayed in sync.



##########
providers/common/ai/src/airflow/providers/common/ai/toolsets/sql.py:
##########
@@ -246,6 +247,11 @@ def __init__(
         max_rows: int = 50,
         max_result_bytes: int = DEFAULT_MAX_RESULT_BYTES,
     ) -> None:
+        if allowed_tables is not None and not allowed_tables:

Review Comment:
   `allowed_tables=[]` is accepted by 0.8.0 and 0.9.0 (I checked both tags), so 
this turns a construction that worked into a Dag import error on upgrade. The 
NOTE TO CONTRIBUTORS at the top of `docs/changelog.rst` asks for a note just 
under the `Changelog` header when that happens, and #72156 added one for a 
change of the same shape. A couple of lines telling people to pass `None` 
explicitly if they did mean allow-all would cover it.



-- 
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]

Reply via email to