Merged in DAIP2-2162-fix-mapping-issue-program-product-not-mapping-to-lob (pull request #914)
DAIP2-2162 fix mapping issue program product not mapping to lob * fixed empty LOB * adding program-lob mapping when there is no client * code cleanup * code change refactored * code change refactored * additional test case removed * pipeline error fixed Approved-by: Katon Minhas
This commit is contained in:
committed by
Katon Minhas
parent
dd34c00303
commit
cbfbbc1257
@@ -463,6 +463,21 @@ def is_empty(value: str | list | pd.Series, pd_mask: bool = True) -> bool | pd.S
|
||||
if not value or value.isspace():
|
||||
return True
|
||||
lower_stripped = value.lower().strip()
|
||||
|
||||
# Treat serialized placeholder-only lists such as ['N/A'], ["N/A"], or [] as empty.
|
||||
if lower_stripped.startswith("[") and lower_stripped.endswith("]"):
|
||||
parsed_value = None
|
||||
try:
|
||||
parsed_value = json.loads(value)
|
||||
except (json.JSONDecodeError, TypeError, ValueError):
|
||||
try:
|
||||
parsed_value = ast.literal_eval(value)
|
||||
except (ValueError, SyntaxError):
|
||||
parsed_value = None
|
||||
|
||||
if isinstance(parsed_value, list):
|
||||
return not parsed_value or all(is_empty(item) for item in parsed_value)
|
||||
|
||||
if lower_stripped in [
|
||||
"n/a",
|
||||
"na",
|
||||
|
||||
Reference in New Issue
Block a user