This method is used in DagFileProcessor.process_file - it may be easier to migrate all it's internal calls instead of the whole method.
#
#
from __future__ import annotations
import inspect
import logging
import os
import pathlib