Skip to content

Commit

Permalink
restore task
Browse files Browse the repository at this point in the history
  • Loading branch information
paxcema committed Sep 2, 2023
1 parent 17f39d9 commit 4b8a941
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mindsdb_sql/parser/dialects/mindsdb/create_predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def __init__(self,
using=None,
is_replace=False,
if_not_exists=False,
task=None,
*args, **kwargs):
super().__init__(*args, **kwargs)
self.name = name
Expand All @@ -33,6 +34,7 @@ def __init__(self,
self.using = using
self.is_replace = is_replace
self.if_not_exists = if_not_exists
self.task = task

def to_tree(self, *args, level=0, **kwargs):
ind = indent(level)
Expand Down Expand Up @@ -149,3 +151,4 @@ class CreateAnomalyDetectionModel(CreatePredictorBase):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._command = 'CREATE ANOMALY DETECTION MODEL'
self.task = Identifier('AnomalyDetection')
1 change: 1 addition & 0 deletions tests/test_parser/test_mindsdb/test_create_predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ def test_create_anomaly_detection_model(self):

expected_ast = CreateAnomalyDetectionModel(
name=Identifier('alert_model'),
task=Identifier('AnomalyDetection'),
integration_name=Identifier('integration_name'),
query_str='select * FROM table',
targets=[Identifier('alert')] if predict_clause else None,
Expand Down

0 comments on commit 4b8a941

Please sign in to comment.