From d71719d079e5d8da3279c6f55e78b9319ab8e283 Mon Sep 17 00:00:00 2001 From: Yasset Perez-Riverol Date: Wed, 28 Feb 2024 13:58:18 +0000 Subject: [PATCH] PythonBlack changed --- sdrf_pipelines/sdrf/sdrf_schema.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sdrf_pipelines/sdrf/sdrf_schema.py b/sdrf_pipelines/sdrf/sdrf_schema.py index 0eab7be..d37fa84 100644 --- a/sdrf_pipelines/sdrf/sdrf_schema.py +++ b/sdrf_pipelines/sdrf/sdrf_schema.py @@ -1,5 +1,6 @@ import logging import re +import sys import typing from typing import Any @@ -325,8 +326,12 @@ def validate_empty_cells(self, panda_sdrf): def validate_string(cell_value): return cell_value is not None and cell_value != "nan" and len(cell_value.strip()) > 0 - # Apply the validation function element-wise - validation_results = panda_sdrf.map(validate_string) + if sys.version_info <= (3, 8): + # Use map for Python versions less than 3.8 + validation_results = panda_sdrf.map(validate_string) + else: + # Use applymap for Python versions 3.8 and above + validation_results = panda_sdrf.applymap(validate_string) # Get the indices where the validation fails failed_indices = [