ltutar opened a new issue #21392:
URL: https://github.com/apache/airflow/issues/21392
### Description
Hi,
It would be nice of the file `.airflowignore` also used 'glob' as
`.gitignore` for example. In my case when I used `*_test.py` instead of
`.*_test.py`, I could not see the dags and also got errors when I used `airflow
dags list`. The error message was not easy to understand. Without the help of
@potiuk, I was lost.
An example is shown below:
`
Traceback (most recent call last):
File "/usr/local/lib/python3.8/multiprocessing/process.py", line 315, in
_bootstrap
self.run()
File "/usr/local/lib/python3.8/multiprocessing/process.py", line 108, in
run
self._target(*self._args, **self._kwargs)
File
"/home/airflow/.local/lib/python3.8/site-packages/airflow/utils/dag_processing.py",
line 370, in _run_processor_manager
processor_manager.start()
File
"/home/airflow/.local/lib/python3.8/site-packages/airflow/utils/dag_processing.py",
line 610, in start
return self._run_parsing_loop()
File
"/home/airflow/.local/lib/python3.8/site-packages/airflow/utils/dag_processing.py",
line 620, in _run_parsing_loop
self._refresh_dag_dir()
File
"/home/airflow/.local/lib/python3.8/site-packages/airflow/utils/dag_processing.py",
line 755, in _refresh_dag_dir
self._file_paths = list_py_file_paths(self._dag_directory)
File
"/home/airflow/.local/lib/python3.8/site-packages/airflow/utils/file.py", line
169, in list_py_file_paths
file_paths.extend(find_dag_file_paths(directory, safe_mode))
File
"/home/airflow/.local/lib/python3.8/site-packages/airflow/utils/file.py", line
187, in find_dag_file_paths
for file_path in find_path_from_directory(str(directory),
".airflowignore"):
File
"/home/airflow/.local/lib/python3.8/site-packages/airflow/utils/file.py", line
115, in find_path_from_directory
patterns += [re.compile(line) for line in lines_no_comments if line]
File
"/home/airflow/.local/lib/python3.8/site-packages/airflow/utils/file.py", line
115, in <listcomp>
patterns += [re.compile(line) for line in lines_no_comments if line]
File "/usr/local/lib/python3.8/re.py", line 252, in compile
return _compile(pattern, flags)
File "/usr/local/lib/python3.8/re.py", line 304, in _compile
p = sre_compile.compile(pattern, flags)
File "/usr/local/lib/python3.8/sre_compile.py", line 764, in compile
p = sre_parse.parse(p, flags)
File "/usr/local/lib/python3.8/sre_parse.py", line 948, in parse
p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
File "/usr/local/lib/python3.8/sre_parse.py", line 443, in _parse_sub
itemsappend(_parse(source, state, verbose, nested + 1,
File "/usr/local/lib/python3.8/sre_parse.py", line 668, in _parse
raise source.error("nothing to repeat",
re.error: nothing to repeat at position 0
`
### Use case/motivation
_No response_
### Related issues
_No response_
### Are you willing to submit a PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
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]