Skip to content

Commit

Permalink
Merge pull request #45 from vanna-ai/create-dataset-bug
Browse files Browse the repository at this point in the history
fix create dataset bug
  • Loading branch information
zainhoda authored Jul 25, 2023
2 parents cc25d4e + 0dc0daf commit 9c4c50f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/vanna/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ def create_dataset(dataset: str, db_type: str) -> bool:

status = Status(**d['result'])

if status.success:
__org = dataset

return status.success

def add_user_to_dataset(dataset: str, email: str, is_admin: bool) -> bool:
Expand Down
9 changes: 8 additions & 1 deletion tests/test_vanna.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,4 +199,11 @@ def test_remove_training_data():
rv = vn.remove_training_data(row['id'])
assert rv == True

assert vn.get_training_data().shape[0] == 2-index
assert vn.get_training_data().shape[0] == 2-index

def test_create_dataset_and_add_user():
created = vn.create_dataset('test_org2', 'Snowflake')
assert created == True

added = vn.add_user_to_dataset(dataset='test_org2', email="[email protected]", is_admin=False)
assert added == True

0 comments on commit 9c4c50f

Please sign in to comment.