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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

Python script returning Nulls where there should be data

I have imported data from a MSSQL data source, and I can review it in the query editor just fine. but I'd like to transform it in a fairly complex way, so I'd like to run a python script. However the data isn't coming out right and I'd like some help with it if possible:

As I understand it, the python script receives the data in the form of a pandas dataframe, and when it complets, all pandas daatframes in memory will be returned as datasets. Thus, if I leave the python script empty, I should get a dataframe called "dataset", which is identical to the MSSQL query result used as it's input. This mostly works, however some of the data is coming out as "Null", where there is data in the MSSQL query. 

I tried running this with different python runtime environements and it doesn't seem to help. Does anyone have any ideas?

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Could you show example data which is not null in MSSQL data source?

Do you meet the same scenario as thread1 and thread2?

 

Best Regards
Maggie

 

Anonymous
Not applicable

Hi. No, my problem is unlike those that you linked. it isn't that specific entries are being imported incorrectly - entire rows of ~40 entries each are gone. The missing entries are all kinds of data types, including integers, floats, character strings and datetimes. It's always an entire row that disappears, never parts of a row.

Unfortunately I'm having trouble replicating the problem for a demonstration dataset, but it persists in the data that I have for the model. I cannot share our data due to company policy. 

Fortunately, I have managed to perform the modifications I needed in pure SQL - so I was able to avoid python scripting altogether. I am still not sure what caused it.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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