Skip to content

Commit

Permalink
List files in temporary directory
Browse files Browse the repository at this point in the history
  • Loading branch information
pankajkoti committed Dec 27, 2024
1 parent 861d3c1 commit c37eade
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions cosmos/operators/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,14 @@ def run_command(
self.store_compiled_sql(tmp_project_dir, context)
self.upload_compiled_sql(tmp_project_dir, context)
if self.callback:
dirlist = os.listdir(f"{tmp_project_dir}/target")
print("Before: Files and directories in '", tmp_project_dir, "' :")
print("\t", dirlist)
self.callback_args.update({"context": context})
self.callback(tmp_project_dir, **self.callback_args)
dirlist = os.listdir(f"{tmp_project_dir}/target")
print("After: Files and directories in '", tmp_project_dir, "' :")
print("\t", dirlist)
self.handle_exception(result)

return result
Expand Down Expand Up @@ -899,6 +905,9 @@ def upload_to_cloud_storage(self, project_dir: str, **kwargs: Any) -> None:
'Attempting to upload generated docs to S3 using S3Hook("%s")',
self.connection_id,
)
dirlist = os.listdir(f"{project_dir}/target")
print("Files and directories in '", project_dir, "' :")
print("\t", dirlist)

from airflow.providers.amazon.aws.hooks.s3 import S3Hook

Expand Down Expand Up @@ -965,6 +974,9 @@ def upload_to_cloud_storage(self, project_dir: str, **kwargs: Any) -> None:
'Attempting to upload generated docs to Azure Blob Storage using WasbHook(conn_id="%s")',
self.connection_id,
)
dirlist = os.listdir(f"{project_dir}/target")
print("Files and directories in '", project_dir, "' :")
print("\t", dirlist)

from airflow.providers.microsoft.azure.hooks.wasb import WasbHook

Expand Down Expand Up @@ -1009,6 +1021,9 @@ def upload_to_cloud_storage(self, project_dir: str, **kwargs: Any) -> None:
'Attempting to upload generated docs to Storage using GCSHook(conn_id="%s")',
self.connection_id,
)
dirlist = os.listdir(f"{project_dir}/target")
print("Files and directories in '", project_dir, "' :")
print("\t", dirlist)

from airflow.providers.google.cloud.hooks.gcs import GCSHook

Expand Down

0 comments on commit c37eade

Please sign in to comment.