https://prefect.io logo
Title
t

Toby Rahloff

02/17/2023, 9:48 AM
Hi, 2.8.1 is breaking the
from prefect.orion
import path and is therefore, unfortunately, not backwards compatible 😢
r

Ryan Peden

02/17/2023, 12:59 PM
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:
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

Justin Trautmann

02/17/2023, 1:25 PM
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

Zanie

02/17/2023, 4:15 PM
@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

Justin Trautmann

02/17/2023, 4:24 PM
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.
"""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
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

Zanie

02/17/2023, 4:42 PM
Great thanks let me see what I can do
I don’t have high hopes though
I tried this
but still get
************* Module example
example.py:4:0: E0401: Unable to import 'prefect.orion.schemas.filters' (import-error)