Skip to content

Commit ed0ac90

Browse files
authored
Merge branch 'mindsdb:main' into java-sdk
2 parents 6784171 + b643430 commit ed0ac90

File tree

5 files changed

+36
-6
lines changed

5 files changed

+36
-6
lines changed

.github/workflows/cla.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: "MindsDB CLA Assistant"
2+
on:
3+
issue_comment:
4+
types: [created]
5+
pull_request_target:
6+
types: [opened,closed,synchronize]
7+
jobs:
8+
CLAssistant:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: "CLA Assistant"
12+
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
13+
uses: contributor-assistant/github-action@v2.6.1
14+
env:
15+
GITHUB_TOKEN: ${{ secrets.CLA_TOKEN }}
16+
PERSONAL_ACCESS_TOKEN : ${{ secrets.CLA_TOKEN }}
17+
with:
18+
path-to-signatures: 'assets/contributions-agreement/cla.json'
19+
# Add path to the CLA here
20+
path-to-document: 'https://github.com/mindsdb/mindsdb/blob/main/assets/contributions-agreement/individual-contributor.md'
21+
branch: 'cla'
22+
allowlist: bot*, ZoranPandovski, torrmal, Stpmax, mindsdbadmin, ea-rus, tmichaeldb, dusvyat, hamishfagg, MinuraPunchihewa, martyna-mindsdb, lucas-koontz

assets/contributions-agreement/cla.json

Whitespace-only changes.

minds/datasources/datasources.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def create(self, ds_config: DatabaseConfig, replace=False):
3838
if replace:
3939
try:
4040
self.get(name)
41-
self.drop(name)
41+
self.drop(name, force=True)
4242
except exc.ObjectNotFound:
4343
...
4444

@@ -76,11 +76,15 @@ def get(self, name: str) -> Datasource:
7676
raise exc.ObjectNotSupported(f'Wrong type of datasource: {name}')
7777
return Datasource(**data)
7878

79-
def drop(self, name: str):
79+
def drop(self, name: str, force=False):
8080
"""
8181
Drop datasource by name
8282
8383
:param name: name of datasource
84+
:param force: if True - remove from all minds, default: False
8485
"""
86+
data = None
87+
if force:
88+
data = {'cascade': True}
8589

86-
self.api.delete(f'/datasources/{name}')
90+
self.api.delete(f'/datasources/{name}', data=data)

minds/rest_api.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,12 @@ def get(self, url):
3737
_raise_for_status(resp)
3838
return resp
3939

40-
def delete(self, url):
41-
resp = requests.delete(self.base_url + url, headers=self._headers())
40+
def delete(self, url, data=None):
41+
resp = requests.delete(
42+
self.base_url + url,
43+
headers=self._headers(),
44+
json=data
45+
)
4246

4347
_raise_for_status(resp)
4448
return resp

tests/integration/test_base_flow.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def test_datasources():
3131

3232
# remove previous object
3333
try:
34-
client.datasources.drop(example_ds.name)
34+
client.datasources.drop(example_ds.name, force=True)
3535
except ObjectNotFound:
3636
...
3737

0 commit comments

Comments
 (0)