Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi folks, I'm making a custom visual in Python that uses over 150,000 rows, exceeding the tool's limitations. In order to circumvent this limitation, I use the input to provide the script with ID values that I then use to query a database for my large dataset using sqlalchemy. This works great on my personal computer and the visual displays exactly as I intended. However, since the online Python interpreter doesn't have sqlalchemy, I can't publish the report online and share the visual with my group.
Is there another way around the 150,000 row limit that is compatible with publishing? Is there a different python package that is included in the online interpreter which can query my database?
Hi @Anonymous,
Only the following libraries are currently supported in the service (source) :
To the best of my knowledge, this list hasn't been changed since its inception, and these libraries will typically recommend other libraries, such as sqlalchemy, pyodbc etc. for getting data externally. Unless one of the above libraries has native DB access capabilities then you might be stuck, unfortunately.
The constraints in the Service are specifically limited (as per the Security and execution constraints heading in the linked article) to ensure that fair use of resources is employed and keep the visual container sandboxed - this is the same constraint as any custom visual wirtten with TypeScript or R. The compute resource for Power BI Service is also capped, particularly for Pro; there's no such additional compute benefit for Python visuals in Premium at the moment.
The other possibility is to write your Python query via Power Query and use a data gateway, which should defer to the Python runtime hosted on your gateway machine. The Power Query approach is not as dynamic as doing the scripting in the visual however for things like filter context. If this is useful to you then you can read under the Python support in Power BI personal gateway heading in the above link also.
Probably not the answer you were after but might give you some ideas on how to approach from a different angle if working with the Power BI Service.
Good luck!
Daniel
If my post solves your challenge, then please consider accepting as a solution to help other forum members find the answer more quickly 🙂
Proud to be a Super User!
My course: Introduction to Developing Power BI Visuals
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)