Authentication issue in HiveMetastore

Prajit0710
New Contributor II

Problem Statement:
When I execute the below code as a part of the notebook both manually and in workflow it works as expected
df.write.mode("overwrite") \
.format('delta') \
.option('path',ext_path) \
.saveAsTable("tbl_schema.Table_name")

but when I integrate the same code within the function and execute it still writs to the target but does not get recognised by HiveMetastore.