uranusjr commented on code in PR #40949:
URL: https://github.com/apache/airflow/pull/40949#discussion_r1687473002
##########
airflow/example_dags/example_bash_decorator.py:
##########
@@ -99,9 +99,13 @@ def _get_files_in_cwd() -> list[str]:
@task.bash
def get_file_stats() -> str:
+ from shlex import quote
+
files = _get_files_in_cwd()
cmd = "stat "
- cmd += " ".join(files)
+
+ # sdanitizing the file names
Review Comment:
```suggestion
# Sanitizing the file names
```
By the way, Python 3.8 added `shlex.join` that makes this even easier
```python
shlex.join([stat, *files])
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]