Skip to content

Commit edbf451

Browse files
committed
Merge branch 'main' into feat-ml-188
2 parents 97470eb + 2be5709 commit edbf451

File tree

17 files changed

+66
-707
lines changed

17 files changed

+66
-707
lines changed

LICENSE

Lines changed: 21 additions & 674 deletions
Large diffs are not rendered by default.

mindsdb_sdk/__about__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
__title__ = 'mindsdb_sdk'
22
__package_name__ = 'mindsdb_sdk'
3-
__version__ = '3.1.6'
3+
__version__ = '3.2.0'
44
__description__ = "MindsDB Python SDK, provides an SDK to use a remote mindsdb instance"
55
__email__ = "[email protected]"
66
__author__ = 'MindsDB Inc'
77
__github__ = 'https://github.com/mindsdb/mindsdb_python_sdk'
88
__pypi__ = 'https://pypi.org/project/mindsdb-sdk/'
9-
__license__ = 'GPL-3.0'
9+
__license__ = 'MIT'
1010
__copyright__ = 'Copyright 2020- mindsdb'

mindsdb_sdk/agents.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,7 @@ def update(self, name: str, updated_agent: Agent):
514514
self.project.name,
515515
name,
516516
updated_agent.name,
517+
updated_agent.provider,
517518
updated_agent.model_name,
518519
list(skills_to_add),
519520
list(skills_to_remove),

mindsdb_sdk/connect.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ def connect(
1212
password: str = None,
1313
api_key: str = None,
1414
is_managed: bool = False,
15+
cookies=None,
1516
headers=None) -> Server:
1617
"""
1718
Create connection to mindsdb server
@@ -21,6 +22,7 @@ def connect(
2122
:param password: user password to login (for cloud version)
2223
:param api_key: API key to authenticate (for cloud version)
2324
:param is_managed: whether or not the URL points to a managed instance
25+
:param cookies: addtional cookies to send with the connection, optional
2426
:param headers: addtional headers to send with the connection, optional
2527
:return: Server object
2628
@@ -51,6 +53,7 @@ def connect(
5153
# is local
5254
url = DEFAULT_LOCAL_API_URL
5355

54-
api = RestAPI(url, login, password, api_key, is_managed, headers=headers)
56+
api = RestAPI(url, login, password, api_key, is_managed,
57+
cookies=cookies, headers=headers)
5558

5659
return Server(api)

mindsdb_sdk/connectors/rest_api.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ def _raise_for_status(response):
3737

3838

3939
class RestAPI:
40-
def __init__(self, url=None, login=None, password=None, api_key=None, is_managed=False, headers=None):
40+
def __init__(self, url=None, login=None, password=None, api_key=None, is_managed=False,
41+
cookies=None, headers=None):
4142

4243
self.url = url
4344
self.username = login
@@ -46,6 +47,9 @@ def __init__(self, url=None, login=None, password=None, api_key=None, is_managed
4647
self.is_managed = is_managed
4748
self.session = requests.Session()
4849

50+
if cookies is not None:
51+
self.session.cookies.update(cookies)
52+
4953
self.session.headers['User-Agent'] = f'python-sdk/{__about__.__version__}'
5054
if headers is not None:
5155
self.session.headers.update(headers)
@@ -309,6 +313,7 @@ def update_agent(
309313
project: str,
310314
name: str,
311315
updated_name: str,
316+
updated_provider: str,
312317
updated_model: str,
313318
skills_to_add: List[str],
314319
skills_to_remove: List[str],
@@ -321,6 +326,7 @@ def update_agent(
321326
'agent': {
322327
'name': updated_name,
323328
'model_name': updated_model,
329+
'provider': updated_provider,
324330
'skills_to_add': skills_to_add,
325331
'skills_to_remove': skills_to_remove,
326332
'params': updated_params

mindsdb_sdk/databases.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from typing import List, Union
22

3-
from mindsdb_sql.parser.dialects.mindsdb import CreateDatabase
4-
from mindsdb_sql.parser.ast import DropDatabase, Identifier
3+
from mindsdb_sql_parser.ast.mindsdb import CreateDatabase
4+
from mindsdb_sql_parser.ast import DropDatabase, Identifier
55

66
from mindsdb_sdk.utils.objects_collection import CollectionBase
77

mindsdb_sdk/handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import dataclasses
33
from typing import List
44

5-
from mindsdb_sql.parser.ast import Show, Identifier, BinaryOperation, Constant
5+
from mindsdb_sql_parser.ast import Show, Identifier, BinaryOperation, Constant
66

77
from mindsdb_sdk.utils.objects_collection import CollectionBase
88

mindsdb_sdk/jobs.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import datetime as dt
22
from typing import Union, List
33

4-
54
import pandas as pd
65

7-
from mindsdb_sql.parser.dialects.mindsdb import CreateJob, DropJob
8-
from mindsdb_sql.parser.ast import Identifier, Star, Select
6+
from mindsdb_sql_parser.ast.mindsdb import CreateJob, DropJob
7+
from mindsdb_sql_parser.ast import Identifier, Star, Select
98

109
from mindsdb_sdk.query import Query
1110
from mindsdb_sdk.utils.sql import dict_to_binary_op

mindsdb_sdk/knowledge_bases.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
import pandas as pd
66

7-
from mindsdb_sql.parser.dialects.mindsdb import CreateKnowledgeBase, DropKnowledgeBase
8-
from mindsdb_sql.parser.ast import Identifier, Star, Select, BinaryOperation, Constant, Insert
7+
from mindsdb_sql_parser.ast.mindsdb import CreateKnowledgeBase, DropKnowledgeBase
8+
from mindsdb_sql_parser.ast import Identifier, Star, Select, BinaryOperation, Constant, Insert
99

1010
from mindsdb_sdk.utils.sql import dict_to_binary_op, query_to_native_query
1111
from mindsdb_sdk.utils.objects_collection import CollectionBase

mindsdb_sdk/ml_engines.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from dataclasses import dataclass
22
from typing import List, Union
33

4-
from mindsdb_sql.parser.ast import Show, Identifier
5-
from mindsdb_sql.parser.dialects.mindsdb import CreateMLEngine, DropMLEngine
4+
from mindsdb_sql_parser.ast import Show, Identifier
5+
from mindsdb_sql_parser.ast.mindsdb import CreateMLEngine, DropMLEngine
66

77
from mindsdb_sdk.utils.objects_collection import CollectionBase
88

0 commit comments

Comments
 (0)