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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Leandro
Advocate I
Advocate I

Python Validate Email Error

Hi everyone!

I found this very usefull tutorial on youtube talking about how validate emails with PBI by using a Python script, this i'm getting this error:

EMAIL.PNG

Do you guys knows how to solve this?

the script is very simple:


from validate_email import validate_email

dataset['Valid Email'] = dataset['Email'].apply(lambda x:validate_email(x))


Thanks!

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

Hi Leandro,

 

Couldn't reproduce your issue. The python script works well on my side. It seems like there's something with your data type, are they text type in your dataset?

2.PNGCapture.PNG 

 

Regards,

Jimmy Tao

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi everyone,

I followed the same tutorial but I get another error when running the script:

I used the same code as the tutorial but there he only has 1 column in his dataset and mine consists of multiple columns with multiple date types.

I tested the code and when I removed all other columns, it worked as expected.

Can someone help me out?

 

Thanks!

 

DataSource.Error: ADO.NET: Python script error.
<pi>sys:1: DtypeWarning: Columns (5,7,8,26,27) have mixed types.Specify dtype option on import or set low_memory=False.
TypeError: expected string or bytes-like object
</pi>
Details:
DataSourceKind=Python
DataSourcePath=Python
Message=Python script error.
<pi>sys:1: DtypeWarning: Columns (5,7,8,26,27) have mixed types.Specify dtype option on import or set low_memory=False.
TypeError: expected string or bytes-like object
</pi>
ErrorCode=-2147467259
ExceptionType=Microsoft.PowerBI.Scripting.Python.Exceptions.PythonScriptRuntimeException

SQUILES
Helper I
Helper I

HELP... 

I trying but PWBI get this error.. any help pleasepy error.JPG

 

v-yuta-msft
Community Support
Community Support

Hi Leandro,

 

Couldn't reproduce your issue. The python script works well on my side. It seems like there's something with your data type, are they text type in your dataset?

2.PNGCapture.PNG 

 

Regards,

Jimmy Tao

@v-yuta-msft

 

Thanks a lot for the atention.

 

After some time, i realized that the problem was really the type as you said.

 

Thanks! Best Regards!

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.