Open gerileka opened 1 year ago
@NeerajMalhotra-QB @jaskaransinghsidana any idea on why the check name for custom registered check isn't showing up in the validation report?
I could reproduce it and could only glance at it for now. I believe for some reason schema.check.error
is coming null at link
def format_generic_error_message(
parent_schema,
check,
) -> str:
"""Construct an error message when a check validator fails.
:param parent_schema: class of schema being validated.
:param check: check that generated error.
"""
return f"{parent_schema} failed validation " f"{check.error}"
which is invoked from: link
def run_check(
self,
check_obj,
schema,
check,
check_index: int,
*args,
) -> bool:
check_result = check(check_obj, *args)
if not check_result.check_passed:
# encode scalar False values explicitly
failure_cases = scalar_failure_case(check_result.check_passed)
error_msg = format_generic_error_message(schema, check)
@jaskaransinghsidana, do you remember on top of your mind what could be causing this?
@NeerajMalhotra-QB Don't remember it at top of my head, I need to take a look at the flow a bit.
Took a look at this, it is coming from how the check is registered, when a base check is registered it has a attribute from BaseClass called error which holds the error information
class BaseCheck(metaclass=MetaCheck):
"""Check base class."""
def __init__(
self,
name: Optional[str] = None,
error: Optional[str] = None,
statistics: Optional[Dict[str, Any]] = None,
):
self.name = name
self.error = error
self.statistics = statistics
However, when a custom check is registered this attribute error for some reason it is None. @NeerajMalhotra-QB since this comes from api would you be able to take a look at it? @cosmicBboy I am not familiar with the register_check_method code, need some time, meanwhile can you tell me what's the expected difference between registering a builtin check vs custom ?
Question about pandera
Hello, still new to Pandera and especially interested on the new Pyspark implementation. I am creating some new register_check_method for regex but I am having trouble naming the checks. As you can see, in both instances the check is set at None.
Below you can find the code on how I achieve this result. Maybe I am missing something in the documentation.
Am I missing something on the naming ?