rmanvar-indeed commented on issue #12776:
URL: https://github.com/apache/airflow/issues/12776#issuecomment-740323266
Thank for the MR!
I had written the alembic migrations, but couldn't figure a good way to add
tests.
Easiest way seemed to add a big dag exceeding 65Kb limit in example dags but
that didn't seem ideal.
Tried adding test case in test_dagcode on the lines of:
```
def test_storing_large_dag_file_in_db(self):
"""Test if large dag exceeding 65Kb size can be added to db"""
with TemporaryDirectory(prefix='airflow_dagcode_dir') as tmp_dir:
with NamedTemporaryFile(dir=tmp_dir, mode='w', suffix='.py') as
f:
f.write(get_large_test_dag())
f.flush()
f.close()
import os
os.listdir(tmp_dir)
dag_bag = DagBag(tmp_dir)
for dag in dag_bag.dags.values():
DagCode(dag.fileloc, get_large_test_dag()).sync_to_db()
dag.sync_to_db()
```
but this wasn't writing dag code to db as I had expected.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]