From 4aa83c5ec1f221916bea9979a7d89467acb66366 Mon Sep 17 00:00:00 2001 From: Alif Be Date: Fri, 27 Oct 2023 15:00:47 +0200 Subject: [PATCH] Fix linting and mypy issue --- src/subscript/fmuobs/fmuobs.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/subscript/fmuobs/fmuobs.py b/src/subscript/fmuobs/fmuobs.py index 9835ea8ff..df9ebc95b 100644 --- a/src/subscript/fmuobs/fmuobs.py +++ b/src/subscript/fmuobs/fmuobs.py @@ -348,7 +348,7 @@ def fmuobs( # Trigger warning if user specify ERROR_MODE != ABS # in BLOCK_OBSERVATION and SUMMARY_OBSERVATION - if "ERROR_MODE" in dframe.columns: + if isinstance(dframe, pd.DataFrame) and "ERROR_MODE" in dframe.columns: error_mode = list( dframe[ (dframe["CLASS"].isin(["BLOCK_OBSERVATION", "SUMMARY_OBSERVATION"])) @@ -359,7 +359,8 @@ def fmuobs( ) if len(error_mode) > 0: logger.warn( - f"Unsupported ERROR_MODE : {', '.join(error_mode)}. Please verify the output file" + f"Unsupported ERROR_MODE : {', '.join(error_mode)}. " + "Please verify the output file" ) dump_results(dframe, csv, yml, resinsight, ertobs)