kaxil commented on PR #67519: URL: https://github.com/apache/airflow/pull/67519#issuecomment-4548349352
Hi @Codingaditya17, thank you for the focused work here -- the engineering on this PR is clean. I'm closing this along with the other PRs targeting #67515 after thinking through the actual savings more carefully. Full reasoning here: https://github.com/apache/airflow/issues/67515#issuecomment-4548272652 Short version: an Operator imports a Hook which imports the SDK, so moving the SDK import inside a method mostly shifts *when* the import happens rather than saving it -- workers running the task pay the same cost. It also loses the parse-time `import_error` surface that today reports install/version issues to users. PEP 810 (lazy imports, Python 3.15) is the cleaner path and the polyfill works alongside it without source-level refactors. Genuinely sorry for the wasted cycles -- on us for not flagging the strategy concern before contributors started shipping. Two areas that *are* worth the work if you want something else to pick up: 1. `TYPE_CHECKING` guards on type-only imports across providers. Pure win, no trade-off. 2. Lazy-loading conditionally-used heavy deps (e.g. `pandas_gbq` inside `BigQueryHook.get_pandas_df` rather than at module level) -- the fail-fast loss is scoped to methods users may never call. Thanks again. -- 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]
