tirkarthi commented on issue #23343: URL: https://github.com/apache/airflow/issues/23343#issuecomment-1113211324
I am unable to reproduce this with below test case and adding the file to my
dags folder is able to load it though owner is set as empty.
```python
def test_process_file_unhashable_owner(self):
"""Loading a DAG with owner as list"""
dagbag = models.DagBag(dag_folder=self.empty_dir,
include_examples=False)
def create_dag():
from airflow.decorators import dag
@dag(default_args={'owners': ['owner1']})
def my_flow_1():
pass
my_dag = my_flow_1()
source_lines = [line[12:] for line in
inspect.getsource(create_dag).splitlines(keepends=True)[1:]]
with NamedTemporaryFile("w+", encoding="utf8") as tf_1:
tf_1.writelines(source_lines)
tf_1.flush()
found_1 = dagbag.process_file(tf_1.name)
found_1[0].sync_to_db()
assert len(found_1) == 1 and found_1[0].dag_id == "my_flow_1"
assert dagbag.import_errors == {}
assert dagbag.dags['my_flow_1'] == found_1[0]
with create_session() as session:
dag_db = session.query(DagModel).filter(DagModel.dag_id ==
'my_flow_1').first()
assert dag_db is not None
```
--
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]
