Created
January 17, 2024 17:59
-
-
Save jonaslsl/097746cc8e2dd81c705739ecfb084e46 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from prefect.flows import Flow | |
class AbstractClassBasedFlow: | |
""" | |
An example abstract class that shows how you can dynamically create prefect | |
flows. | |
""" | |
@classmethod | |
def run_config(cls): | |
... | |
@classmethod | |
def to_prefect_flow(cls): | |
""" | |
dynamically creates a prefect flow for us! | |
""" | |
return Flow( | |
fn=cls.run_config, | |
name=cls.__name__, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment