Skip to content

Commit

Permalink
improve readability
Browse files Browse the repository at this point in the history
  • Loading branch information
ericvergnaud committed Oct 2, 2024
1 parent fe0f942 commit 51afb4d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/databricks/labs/ucx/source_code/linters/directfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,9 @@ def _check_str_arg(self, call_node: Call, arg_node: NodeNG, inferred: InferredVa
continue
# only capture calls originating from spark or dbutils
# because there is no other known way to manipulate data directly from file system
is_from_spark = False
is_from_db_utils = Tree(call_node).is_from_module("dbutils")
if not is_from_db_utils:
is_from_spark = Tree(call_node).is_from_module("spark")
if not is_from_db_utils and not is_from_spark:
is_from_spark = False if is_from_db_utils else Tree(call_node).is_from_module("spark")
if not (is_from_db_utils or is_from_spark):
return
# avoid duplicate advices that are reported by SparkSqlPyLinter
if self._prevent_spark_duplicates and is_from_spark:
Expand Down

0 comments on commit 51afb4d

Please sign in to comment.