pavansai1997 commented on code in PR #76230: URL: https://github.com/apache/airflow/pull/76230#discussion_r4438891423
########## providers/common/ai/docs/operators/llm_sql.rst: ########## @@ -178,6 +178,38 @@ By default, the operator validates generated SQL using an allowlist approach: You can disable validation with ``validate_sql=False`` or customize the allowed statement types with ``allowed_sql_types``. +Restricting the tables a query may reference +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +``table_names`` only selects the schemas shown to the LLM; it does not stop the +generated SQL from reading other tables. Set ``allowed_tables`` to reject any query +that references a table outside the list: + +.. code-block:: python Review Comment: Moved it to `example_llm_sql.py` as `example_llm_sql_allowed_tables`, included through `exampleinclude`. It also shows `allowed_functions`. -- 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]
