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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
hamed_digaleh
New Member

overwriting data type in python wrapper for visualization

Hi everyone,

I’ve problem in reading .csv in wrapper header file and it detect data type wrong. I originally imported moth_year column as text in data transform and here I do want to have “dataset” data from all column as text but it converts this column automatically to number format.  Do you have any idea how can I overwrite these autogenerate wrapper??

 

# Prolog - Auto Generated #

pandas.read_csv('input_df_79f27d2d-28f8-4512-9a2f-308cf041f073.csv')

 

 

what I tried till now:

  • Turning off auto type detection in setting
  • Changing data type via transform data -> Transform -> Data Type -> Text

Thanks and kind Regards

6 REPLIES 6
amitchandak
Super User
Super User

@hamed_digaleh , In Edit query mode , right click on table and open advance editor, You will see the column name with data types. You can change it(Data type) there.

 

Keep backup of file.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I already changed data type power query editor, and the type of column in the model is text. but by running python visualize it redetect data type and it cause missdetection (in this case detect text column as number)

@hamed_digaleh - Ah, I understand now. So, no. I have run into this with R visuals because it wipes out the duplicates, which is problematic if you are trying to generate a word cloud via R code! 😕

 

You will need to convert it back to a date within the Python code I imagine.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler  yes, but it is easier to fix the problem in read_csv part if it could be overwritten to add data type as pre setting as str.

Greg_Deckler
Community Champion
Community Champion

@hamed_digaleh - So you have a source step where you import the data, why doesn't a subsequent step of transforming the column to text? Are you getting an error?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

In Source step data are read as text and in the write format (e.g. in this case MONTH_YEARS column as "02.2020"), but the problem rise when it tries to run the python wrapper and it conver these text in auto generate part to number (e.g. MONTH_YEARS reads as 22.02 which is wrong). 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors