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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.