This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 025c2236a57 Using env for file path in find command (#46809)
025c2236a57 is described below
commit 025c2236a57bb918e7e7bc4f307256fc81eb4ad3
Author: Vincent Yang <[email protected]>
AuthorDate: Mon Feb 17 03:45:21 2025 +0800
Using env for file path in find command (#46809)
---
providers/docker/tests/system/docker/example_docker_copy_data.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/providers/docker/tests/system/docker/example_docker_copy_data.py
b/providers/docker/tests/system/docker/example_docker_copy_data.py
index d668fab6bdc..ccd7e226782 100644
--- a/providers/docker/tests/system/docker/example_docker_copy_data.py
+++ b/providers/docker/tests/system/docker/example_docker_copy_data.py
@@ -27,7 +27,6 @@ your environment & enable the code.
from __future__ import annotations
import os
-import shlex
from datetime import datetime
from docker.types import Mount
@@ -49,7 +48,7 @@ with models.DAG(
) as dag:
locate_file_cmd = f"""
sleep 10
- find {shlex.quote("{{ params.source_location }}")} -type f -printf
"%f\\n" | head -1
+ find $LOCATION -type f -printf "%f\\n" | head -1
"""
t_view = BashOperator(
@@ -57,6 +56,7 @@ with models.DAG(
bash_command=locate_file_cmd,
do_xcom_push=True,
params={"source_location": "/your/input_dir/path"},
+ env={"LOCATION": "{{ params.source_location }}"},
dag=dag,
)