awslabs / awslabs/python-deequ

Lambda arguments are not recognized (Sagemaker)

Abierto
#54 3 comentarios 0 reacciones 0 asignados Ver en GitHub
bug
Lenguaje dominante
Jupyter Notebook
Estrellas
826
Forks
158
Merge medio
9 d 22 h
PR fusionados (30 d)
3

Descripción

**Describe the bug**
When passing a lambda function for an assertion for hasSize, hasMin, or hasMax, it results in a "Can't execute the assertion" error.

**To Reproduce**
Steps to reproduce the behavior:
Use any constraint that requires a lambda function

I used the one listed in the GitHub tutorials:

from pyspark.sql import SparkSession, Row, DataFrame
import json
import pandas as pd
import sagemaker_pyspark
from pydeequ.checks import *
from pydeequ.verification import *
import pydeequ

classpath = ":".join(sagemaker_pyspark.classpath_jars())

df = spark.read.parquet("s3a://amazon-reviews-pds/parquet/product_category=Electronics/")
df.printSchema()

spark = (SparkSession
.builder
.config("spark.driver.extraClassPath", classpath)
.config("spark.jars.packages", pydeequ.deequ_maven_coord)
.config("spark.jars.excludes", pydeequ.f2j_maven_coord)
.getOrCreate())

check = Check(spark, CheckLevel.Warning, "Amazon Electronic Products Reviews")

checkResult = VerificationSuite(spark) \
.onData(df) \
.addCheck(
check.hasSize(lambda x: x >= 3000000) \
.hasMin("star_rating", lambda x: x == 1.0) \
.hasMax("star_rating", lambda x: x == 5.0)) \
.run()

print(f"Verification Run Status: {checkResult.status}")
checkResult_df = VerificationResult.checkResultsAsDataFrame(spark, checkResult, pandas=True)
checkResult_df

**Expected behavior**
The following table should get all success values.
![image](https://user-images.githubusercontent.com/76601107/125368581-7ed57180-e348-11eb-9de9-cb909b648516.png)

**Screenshots**
![image](https://user-images.githubusercontent.com/76601107/125369346-096aa080-e34a-11eb-9bb8-201cccc134f9.png)

The major issue is the value in the dataframe "Can't execute the assertion: An exception was raised by the Python Proxy. Return Message: null! "

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Empieza reproduciendo el fallo con las aserciones lambda hasSize, hasMin y hasMax mostradas en el issue; después, sigue cómo se pasan esas aserciones a la ejecución subyacente. Se considera terminado cuando el ejemplo proporcionado se completa sin el error Python Proxy y el dataframe resultante informa de valores de éxito.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
testing
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Tranquilo
Claridad
Bastante claro
Aptitud para principiantes
48/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.