Skip to content

Commit eac263c

Browse files
committed
Add preview tag to Fusion SQL schedule jobs command
1 parent c8806f5 commit eac263c

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

singlestoredb/fusion/handler.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import re
66
import sys
77
import textwrap
8+
import warnings
89
from collections.abc import Iterable
910
from typing import Any
1011
from typing import Callable
@@ -21,6 +22,7 @@
2122

2223
from . import result
2324
from ..connection import Connection
25+
from ..warnings import PreviewFeatureWarning
2426

2527
CORE_GRAMMAR = r'''
2628
ws = ~r"(\s+|(\s*/\*.*\*/\s*)+)"
@@ -580,6 +582,7 @@ class SQLHandler(NodeVisitor):
580582
_grammar: str = CORE_GRAMMAR
581583
_is_compiled: bool = False
582584
_enabled: bool = True
585+
_preview: bool = False
583586

584587
def __init__(self, connection: Connection):
585588
self.connection = connection
@@ -654,6 +657,13 @@ def execute(self, sql: str) -> result.FusionSQLResult:
654657
DummySQLResult
655658
656659
"""
660+
if type(self)._preview:
661+
warnings.warn(
662+
'This is a preview Fusion SQL command. '
663+
'The options and syntax may change in the future.',
664+
PreviewFeatureWarning, stacklevel=2,
665+
)
666+
657667
type(self).compile()
658668
self._handled = set()
659669
try:

singlestoredb/fusion/handlers/job.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ class ScheduleJobHandler(SQLHandler):
122122
;
123123
"""
124124

125+
_preview = True
126+
125127
def run(self, params: Dict[str, Any]) -> Optional[FusionSQLResult]:
126128
res = FusionSQLResult()
127129
res.add_field('JobID', result.STRING)

singlestoredb/management/workspace.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ def upload_folder(
226226
include_root : bool, optional
227227
Should the local root folder itself be uploaded as the top folder?
228228
ignore : Path or str or List[Path] or List[str], optional
229-
Glob patterns of files to ignore, for example, '**/*.pyc` will
230-
ignore all '*.pyc' files in the directory tree
229+
Glob patterns of files to ignore, for example, ``**/*.pyc`` will
230+
ignore all ``*.pyc`` files in the directory tree
231231
232232
"""
233233
if not os.path.isdir(local_path):

singlestoredb/warnings.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env python
2+
3+
class PreviewFeatureWarning(UserWarning):
4+
"""Warning for experimental preview features."""
5+
pass

0 commit comments

Comments
 (0)