Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
harrame
Frequent Visitor

Working Around The Python Visual Limitations

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?

1 REPLY 1
dm-p
Super User
Super User

Hi @harrame,

Only the following libraries are currently supported in the service (source) :

  • matplotlib
  • numpy
  • pandas
  • scikit-learn
  • scipy
  • seaborn
  • statsmodels

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 🙂





Did I answer your question? Mark my post as a solution!

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)




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.