potiuk commented on PR #43610: URL: https://github.com/apache/airflow/pull/43610#issuecomment-2473308599
> Yeah have ran basic python operator but that is on 3.9 versions. now that MethPathFinder not supported in 3.11 and 3.12, so will check if we can do anything :) Maybe we can come back (@ashb ?) to the old ways of doing it - we had implemented deprecation utils in v1-> v2 migration that we can apply again: https://github.com/apache/airflow/blob/v2-10-test/airflow/operators/__init__.py - they did the job, the only problem was that the old "package" will have remain there - with an `__init__.py` with all the deprecation dicts. Which is "slightly" annoying, but also has the benefit of it being pretty explicit, as opposed to MetaPath thing. You know where you should look for it at least. And it will not suffer from the 3.11+ bug of importing packages that are loaded from a different path - because those are "real" packages and real modules not "linked" modules. Also - I think such `__init__.py` file can be easily generated from checked out `v2-10-test` branch - we could have a simple script that will import all the "airflow.operators", "airflow.hooks" etc and produce it in fully automated way, this way we will not have to verify it (and since we will never be changing it, we can generate it now and re-generate just before we release Airflow 3, to acount for potential Airflow 2.11 changes. This was following PEP 562 `__getattr__` https://peps.python.org/pep-0562/ and has been working 100% reliably so far. WDYT @gopidesupavan @ashb -> I think while the MetaPath was a nice idea, but it's a bit too risky. -- 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]
