@@ -30,6 +30,23 @@ def test_spark_dynamic_sql(empty_index) -> None:
30
30
sqf = SparkTableNamePyLinter (ftf , empty_index , session_state )
31
31
assert not list (sqf .lint (source ))
32
32
33
+ def test_dbfs_stuff (empty_index ) -> None :
34
+ source = """
35
+ # Databricks notebook source
36
+ # MAGIC %run ./_param_connexion_formation
37
+
38
+ # COMMAND ----------
39
+
40
+ from pyspark.sql import functions as F
41
+
42
+ # COMMAND ----------
43
+
44
+ path_dossierLIZZY = searchPathRecent('/mnt/mnt_datalake_smartCompetencies/', repLIZZY)
45
+ """
46
+ session_state = CurrentSessionState ()
47
+ ftf = FromTableSqlLinter (empty_index , session_state )
48
+ sqf = SparkTableNamePyLinter (ftf , empty_index , session_state )
49
+ assert not list (sqf .lint (source ))
33
50
34
51
def test_linter_context_python_linter_lints_table_pending_migration_with_empty_index (empty_index ) -> None :
35
52
source_code = """
@@ -526,6 +543,20 @@ def test_from_table_sql_py_linter_fixes_migrated_table(migration_index) -> None:
526
543
)
527
544
],
528
545
),
546
+ # Test for mount calls inside a function
547
+ (
548
+ """variable = searchPath('/mnt/something/', some_variable)""" ,
549
+ [
550
+ Deprecation (
551
+ code = 'direct-filesystem-access' ,
552
+ message = "The use of direct filesystem references is deprecated: /mnt/something/" ,
553
+ start_line = 0 ,
554
+ start_col = 0 ,
555
+ end_line = 0 ,
556
+ end_col = 41 ,
557
+ )
558
+ ],
559
+ ),
529
560
],
530
561
)
531
562
def test_spark_cloud_direct_access (empty_index , code , expected ) -> None :
@@ -656,3 +687,4 @@ def test_spark_collect_tables_ignores_dfsas(source_code, expected, migration_ind
656
687
for used_table in used_tables :
657
688
actual = (used_table .catalog_name , used_table .schema_name , used_table .table_name )
658
689
assert actual in expected
690
+
0 commit comments