Skip to content

Commit

Permalink
Fix after release
Browse files Browse the repository at this point in the history
  • Loading branch information
joke1196 committed Feb 3, 2025
1 parent fbb298d commit a819212
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion rules/S7195/python/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"quickfix": "unknown",
"code": {
"impacts": {
"MAINTAINABILITY": "MEDIUM",
"RELIABILITY": "MEDIUM"
},
"attribute": "CONVENTIONAL"
Expand Down
4 changes: 2 additions & 2 deletions rules/S7195/python/rule.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ This rule raises an issue when a column of a PySpark DataFrame is populated with

== Why is this an issue?

In PySpark, when populating a DataFrame columns with empty or null values, it is recommended to use `lit(None)`.
In PySpark, when populating a DataFrame column with empty or null values, it is recommended to use `lit(None)`.
Using literals such as `lit('')` as a placeholder for absent values can lead to data misinterpretation and inconsistencies.

The usage of `lit(None)` ensures clarity and consistency in the codebase, making it explicit that the column is intentionally populated with null values.
Using `lit(None)` also preserves the ability to use functions such as `isnull` or `isnotnull` to check for null values in the DataFrame.

== How to fix it

To fix this issue, replace `lit('')` with `lit(None)` when populating a DataFrame columns with empty/null values.
To fix this issue, replace `lit('')` with `lit(None)` when populating a DataFrame column with empty/null values.

=== Code examples

Expand Down

0 comments on commit a819212

Please sign in to comment.