1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15- from typing import Optional
15+ from typing import Literal , Optional
1616import warnings
1717
1818import bigframes
@@ -27,6 +27,7 @@ class ExperimentOptions:
2727 def __init__ (self ):
2828 self ._semantic_operators : bool = False
2929 self ._ai_operators : bool = False
30+ self ._sql_compiler : Literal ["legacy" , "stable" , "experimental" ] = "stable"
3031
3132 @property
3233 def semantic_operators (self ) -> bool :
@@ -55,6 +56,24 @@ def ai_operators(self, value: bool):
5556 warnings .warn (msg , category = bfe .PreviewWarning )
5657 self ._ai_operators = value
5758
59+ @property
60+ def sql_compiler (self ) -> Literal ["legacy" , "stable" , "experimental" ]:
61+ return self ._sql_compiler
62+
63+ @sql_compiler .setter
64+ def sql_compiler (self , value : Literal ["legacy" , "stable" , "experimental" ]):
65+ if value not in ["legacy" , "stable" , "experimental" ]:
66+ raise ValueError (
67+ "sql_compiler must be one of 'legacy', 'stable', or 'experimental'"
68+ )
69+ if value == "experimental" :
70+ msg = bfe .format_message (
71+ "The experimental SQL compiler is still under experiments, and is subject "
72+ "to change in the future."
73+ )
74+ warnings .warn (msg , category = FutureWarning )
75+ self ._sql_compiler = value
76+
5877 @property
5978 def blob (self ) -> bool :
6079 msg = bfe .format_message (
0 commit comments