Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Vanna with CSV files #20

Open
zainhoda opened this issue Jul 22, 2023 · 6 comments
Open

Use Vanna with CSV files #20

zainhoda opened this issue Jul 22, 2023 · 6 comments
Labels
question Further information is requested

Comments

@zainhoda
Copy link
Contributor

Should we make a vn.use_df function that loads data into sqlite and connects to it so that you can run Vanna on dataframes that you might have brought in via CSV or some other method?

@zainhoda zainhoda added the question Further information is requested label Jul 22, 2023
@ashishsingal1
Copy link
Contributor

ashishsingal1 commented Jul 22, 2023

how would it work? can you write out the usage example? so it works something like this -

df = pd.read_csv('soccer_players.csv')
vn.use_df(df)
vn.ask('how many soccer players are there')

and behind the scenes, use_df creates a new sqlite db and sets that as the dataset? would we need to name the dataset like we do for other datasets?

@zainhoda
Copy link
Contributor Author

Actually now that I think about this, in order to fit our general pattern, this should actually be:

vn.connect_to_dataframes

so example usage would look like:

df1 = pd.read_csv('soccer_players.csv')
df2 = pd.read_csv('baseball_players.csv')

vn.set_dataset('my-sports-dataset')

vn.connect_to_dataframes(df1, df2)

vn.auto_train() # Whatever we decide to call this later. 

vn.ask('how many soccer players are also baseball players?')

That way the pattern looks similar to the rest and we're just handling loading into SQLite inside connect_to_dataframes

@ashishsingal1
Copy link
Contributor

vn.connect_to_dataframes(df1, df2)

what does this do in the background? it creates a sqlite db, puts those two dfs in there, and then connects vanna to the sqlite?

@zainhoda
Copy link
Contributor Author

what does this do in the background? it creates a sqlite db, puts those two dfs in there, and then connects vanna to the sqlite?

That's what I'm thinking

@zainhoda zainhoda changed the title Should we make a vn.use_df? Use Vanna with CSV files Jan 25, 2024
@pratikkotian04
Copy link

Is this implemented yet ?

@mukesh1811
Copy link

mukesh1811 commented Jun 25, 2024

what does this do in the background? it creates a sqlite db, puts those two dfs in there, and then connects vanna to the sqlite?

That's what I'm thinking

wouldn't creating a sqlite db be an overkill?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
Development

No branches or pull requests

4 participants