Hi, 2.8.1 is breaking the `from prefect.orion` imp...
# prefect-community
t
Hi, 2.8.1 is breaking the
from prefect.orion
import path and is therefore, unfortunately, not backwards compatible 😢
r
Is an import failing for you at runtime? When I use imports from
prefect.orion
on 2.8.1, they work but display a deprecation warning:
Copy code
test.py:9: DeprecationWarning: The 'prefect.orion' module has been deprecated. It will not be available after Aug 2023. Use 'prefect.server' instead.
  from prefect.orion.services.loop_service import LoopService
Other things in
prefect.orion
should do the same thing, but if you encounter anything that's not working, please let us know so we can investigate.
j
hey Ryan, thanks for the input. It works indeed at runtime 🤯 but our CI that includes pylint checks and the IDE cannot resolve the deprecated imports, i guess because it is not actually evaluating the
__init__.py
. So this means that we either need to disable these checks in our CI or refactor immediately in order to unblock our pipelines? 🤔
🤯 1
z
@Justin Trautmann Is there a reproduction you could share? I’m happy to try to fix this, it’s just pretty tricky as-is to make all the import machinery work correctly for old modules.
j
sure. thank you for looking into it. i agree that the python import machinery can be tricky sometimes and i'm quite impressed by what you are doing in importtools.
Copy code
"""Docstring."""

from prefect import flow
from prefect.orion.schemas.filters import FlowFilter


@flow()
def main() -> None:
    """Docstring."""
    FlowFilter()


if __name__ == "__main__":
    main()
pylint on this code throws no errors with Prefect 2.8.0 but reports
Copy code
orion_import_flow.py:4:0: E0401: Unable to import 'prefect.orion.schemas.filters' (import-error)
orion_import_flow.py:4:0: E0611: No name 'orion' in module 'prefect' (no-name-in-module)
with Prefect 2.8.1 i'm using pylint 2.14.2
z
Great thanks let me see what I can do
I don’t have high hopes though
I tried this
but still get
Copy code
************* Module example
example.py:4:0: E0401: Unable to import 'prefect.orion.schemas.filters' (import-error)