tableQA icon indicating copy to clipboard operation
tableQA copied to clipboard

* Support more dataframes

Open abhijithneilabraham opened this issue 4 years ago • 25 comments

-Currently the feature supports csv files only. However, integrating more dataframes is easy. Go through the get_dataframe() method in data_utils.py and include support to detect the incoming file and parse the dataframe from it.

abhijithneilabraham avatar Sep 25 '20 14:09 abhijithneilabraham

It'd be good to just be able to do something like:

agent = Agent(df)

rhamnett avatar Sep 26 '20 09:09 rhamnett

It'd be good to just be able to do something like:

agent = Agent(df)

Sure. We will update it asap.

abhijithneilabraham avatar Sep 26 '20 09:09 abhijithneilabraham

@abhijithneilabraham keep up the great work, looking forward to contributing

rhamnett avatar Sep 26 '20 09:09 rhamnett

Thanks! @rhamnett The repo is updated with the changes you suggested, kindly go through the readme and examples and report any bugs.

abhijithneilabraham avatar Sep 26 '20 18:09 abhijithneilabraham

Hello @abhijithneilabraham! That's great! I gave it a quick test on a sample dataset i created from my own columns and the basic functionality seems to work!

Some support for date types etc - datetime64 etc would be really good and then getting the model to understand what today/yesterday/this week/last week means from the current date.

agent.query_db("how many website visits were there in the last week?") agent.query_db("how many orders have I had today?") agent.query_db("how many orders have I had for the week beginning 31st August 2020?")

This kind of thing 👍

rhamnett avatar Sep 27 '20 10:09 rhamnett

Makes sense. In fact, I was already building something like that, but the issue is to map the natural language to datetime without approaching it in a rule based way. Let me think about this and will update asap.

abhijithneilabraham avatar Sep 27 '20 10:09 abhijithneilabraham

Makes sense. In fact, I was already building something like that, but the issue is to map the natural language to datetime without approaching it in a rule based way. Let me think about this and will update asap.

Yes, that's whats going to make it interesting :)

rhamnett avatar Sep 27 '20 11:09 rhamnett

Hi, What will be the df when use MySQL db (have multiple table)?

TheurgicDuke771 avatar Dec 15 '20 11:12 TheurgicDuke771

Haven't implemeted multi-table support yet. We need to join tables in that case, it seems. Will plan that for future. Thanks 😊 .

abhijithneilabraham avatar Dec 15 '20 11:12 abhijithneilabraham

thanks for the quick reply. Then df should be select * from table, right?

TheurgicDuke771 avatar Dec 15 '20 11:12 TheurgicDuke771

That's correct. Download a table as a dataframe and pass it to this.

You could also contribute a feature if you can enable something like agent=Agent(db_url, table_name). Refer agent.py,data_utils.py

abhijithneilabraham avatar Dec 15 '20 11:12 abhijithneilabraham

Sure, will check that. And send you a pr if get anything solid.

TheurgicDuke771 avatar Dec 15 '20 11:12 TheurgicDuke771

Thanks!

abhijithneilabraham avatar Dec 15 '20 11:12 abhijithneilabraham

Hello @abhijithneilabraham! That's great! I gave it a quick test on a sample dataset i created from my own columns and the basic functionality seems to work!

Some support for date types etc - datetime64 etc would be really good and then getting the model to understand what today/yesterday/this week/last week means from the current date.

agent.query_db("how many website visits were there in the last week?") agent.query_db("how many orders have I had today?") agent.query_db("how many orders have I had for the week beginning 31st August 2020?")

This kind of thing 👍

This has been done too! We have a Date class in column_types.py

abhijithneilabraham avatar Dec 19 '20 08:12 abhijithneilabraham

Hi Abhijit Have used this tool, it is an excellent tool. Have tested some of my scenarios, they are working fine. Have one query, do joins works in this tool like left join or right join

dharmesh2002 avatar Apr 18 '22 15:04 dharmesh2002

Hi @dharmesh2002 , Can you be more specific where you have tested a scenario with SQL joins?

abhijithneilabraham avatar Apr 18 '22 16:04 abhijithneilabraham

Hi @abhijithneilabraham , i haven't tested sql queries, what i need is, to connect sql and than to join with tables. So that's why i was checking with you whether that is feasible?

dharmesh2002 avatar Apr 19 '22 05:04 dharmesh2002

@abhijithneilabraham - is it possible to add new functions like group by or having clause?

dharmesh2002 avatar Apr 21 '22 02:04 dharmesh2002

Yes. Can you add support for them?

On Thu, Apr 21, 2022, 7:48 AM dharmesh2002 @.***> wrote:

@abhijithneilabraham https://github.com/abhijithneilabraham - is it possible to add new functions like group by or having clause?

— Reply to this email directly, view it on GitHub https://github.com/abhijithneilabraham/tableQA/issues/23#issuecomment-1104637670, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIOHO46G666EDB72L7LWKMDVGC3FTANCNFSM4RZTADAQ . You are receiving this because you were mentioned.Message ID: @.***>

abhijithneilabraham avatar Apr 21 '22 03:04 abhijithneilabraham

@abhijithneilabraham sorry I didn’t understood, can u pls help me where to add group by function, I tried adding but it didn’t work

dharmesh2002 avatar Apr 21 '22 05:04 dharmesh2002

@dharmesh2002 Can you make a pull request with your code and tag it here?

abhijithneilabraham avatar Apr 21 '22 05:04 abhijithneilabraham

@dharmesh2002 Can you make a pull request with your code and tag it here? hi, @abhijithneilabraham https://github.com/abhijithneilabraham/tableQA/pull/61

snehithakrishna2 avatar Apr 21 '22 07:04 snehithakrishna2

@abhijithneilabraham please if you can have a look on pool request we shared above

dharmesh2002 avatar Apr 22 '22 15:04 dharmesh2002

Hi, I reviewed the code. Have you tried testing it on an actual database and see if the results suit your needs in a natural language query?

On Fri, Apr 22, 2022, 9:27 PM dharmesh2002 @.***> wrote:

@abhijithneilabraham https://github.com/abhijithneilabraham please if you can have a look on pool request we shared above

— Reply to this email directly, view it on GitHub https://github.com/abhijithneilabraham/tableQA/issues/23#issuecomment-1106649895, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIOHO44IC3HVSCJZKISVCWTVGLD6XANCNFSM4RZTADAQ . You are receiving this because you were mentioned.Message ID: @.***>

abhijithneilabraham avatar Apr 22 '22 16:04 abhijithneilabraham

Sure, will check that. And send you a pr if get anything solid. @TheurgicDuke771 , I am working on a similar use case of connecting the Agent with Postgresql db. Are you able to crack anything for making a connection with db?

shubhamrangate2413 avatar Feb 14 '24 07:02 shubhamrangate2413