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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
HadasSpier
Helper I
Helper I

Unpickle from column with python

Hi everyone,
I connected my Power BI report to my SQL DB. I have in my DB a column that contains Pickle files. I need to unpickle that column in Power BI.
I tried to do so with python (Run Python Script option):
import pickle

dataset['value'] = pickle.load(open(dataset['value'], 'rb'))

 

['value'] is the column that contains the pickles.

I got Error: TypeError: expected str, bytes or os.PathLike object, not Series.

 

I didn't find any way to resolve my problem.

Thank you!

4 REPLIES 4
v-robertq-msft
Community Support
Community Support

Hi, @HadasSpier 

According to your error message, I think the error happens because you are passing Series and the error message says you can't do that. And the error occurs in your Python code. You can refer to these links for help:

https://stackoverflow.com/questions/61575159/typeerror-expected-str-bytes-or-os-pathlike-object-not-...

https://stackoverflow.com/questions/51098103/how-to-fix-this-errror-builtins-typeerror-expected-str-...

https://stackoverflow.com/questions/51615227/failed-to-upload-file-with-the-typeerror-expected-str-b...

https://stackoverflow.com/questions/60962474/typeerror-expected-str-bytes-or-os-pathlike-object-not-...

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for your reply.
Yes, I understood the error, but I need to Unpickle the column, and I didn't find any other way to do so.
Do you have any other ideas?

Hi, @HadasSpier 

According to your description, if you want to unpickle the column in the Power BI, I think you can try to use the “Extract” function in the Power query.

v-robertq-msft_0-1617763741156.png

 

You can follow this document to check if it can help you to achieve your requirement:

https://www.sqlshack.com/extract-column-information-using-the-extract-function-in-power-bi/

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

It will not work in my case, unfortunately,

thanks for the help anyway!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.