uranusjr commented on code in PR #23592:
URL: https://github.com/apache/airflow/pull/23592#discussion_r964103714
##########
airflow/models/dagbag.py:
##########
@@ -306,6 +314,8 @@ def _load_modules_from_file(self, filepath, safe_mode):
if mod_name in sys.modules:
del sys.modules[mod_name]
+ DagContext.current_autoregister_module_name = mod_name
Review Comment:
This in-place operation feels a bit weird to me… Perhaps a context manager
would be easier to understand and maintain? Something like
```python
with DagContext.enable_autoregister(mod_name):
parse(...)
```
--
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]