Nevermind, the query_csv function works now.
Turns out that I had to correctly install the influxdb-client[ciso] package with Visual C++ build tools instead of just influxdb-client.
Also, I wanted to know if there is a limit on how much data it can fetch at a time?
Thanks again for your prompt response