Skip to content

Commit 0869911

Browse files
style: sort feedback from sonarcloud analysis
1 parent 499e718 commit 0869911

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

src/dve/core_engine/backends/implementations/duckdb/contract.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def apply_data_contract(
175175

176176
self.logger.info(f"Data contract found {msg_count} issues in {entity_name}")
177177

178-
if not RECORD_INDEX_COLUMN_NAME in relation.columns:
178+
if RECORD_INDEX_COLUMN_NAME not in relation.columns:
179179
relation = self.add_record_index(relation)
180180

181181
casting_statements = [

src/dve/core_engine/backends/implementations/duckdb/readers/csv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def read_to_relation( # pylint: disable=unused-argument
176176
pl_exprs = [
177177
pl.col(c).str.strip_chars().replace("", None)
178178
for c in df.columns
179-
if not c == RECORD_INDEX_COLUMN_NAME
179+
if c != RECORD_INDEX_COLUMN_NAME
180180
] + [pl.col(RECORD_INDEX_COLUMN_NAME)]
181181
df = df.select(pl_exprs)
182182

src/dve/core_engine/backends/implementations/spark/contract.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def apply_data_contract(
111111
[], schema=spark_schema
112112
)
113113
continue
114-
if not RECORD_INDEX_COLUMN_NAME in record_df.columns:
114+
if RECORD_INDEX_COLUMN_NAME not in record_df.columns:
115115
record_df = self.add_record_index(record_df)
116116

117117
if self.debug:

src/dve/core_engine/backends/implementations/spark/spark_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ def _add_spark_record_index(self, entity: DataFrame) -> DataFrame: # pylint: di
429429

430430
def _drop_spark_record_index(self, entity: DataFrame) -> DataFrame: # pylint: disable=W0613
431431
"""Drop record index from spark dataframe"""
432-
if not RECORD_INDEX_COLUMN_NAME in entity.columns:
432+
if RECORD_INDEX_COLUMN_NAME not in entity.columns:
433433
return entity
434434
return entity.drop(RECORD_INDEX_COLUMN_NAME)
435435

src/dve/core_engine/backends/utilities.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def _add_polars_record_index(self, entity: pl.LazyFrame) -> pl.LazyFrame: # pyl
187187

188188
def _drop_polars_record_index(self, entity: pl.LazyFrame) -> pl.LazyFrame: # pylint: disable=W0613
189189
"""Drop record index from polars dataframe"""
190-
if not RECORD_INDEX_COLUMN_NAME in entity.columns:
190+
if RECORD_INDEX_COLUMN_NAME not in entity.columns:
191191
return entity
192192
return entity.drop(RECORD_INDEX_COLUMN_NAME)
193193

0 commit comments

Comments
 (0)