Skip to content

Commit

Permalink
fix create dataset bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zainhoda committed Jul 25, 2023
1 parent cc25d4e commit 0dc0daf
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 0dc0daf

Please sign in to comment.