Hello, when creating prefect deployment with Python per the the docs it is:
Copy code
from prefect import flow
my_flow = flow.from_source(
source="<https://github.com/PrefectHQ/prefect.git>",
entrypoint="flows/hello_world.py:hello"
)
if __name__ == "__main__":
my_flow()
What if my flow script is not in main branch but in a feature branch, is there a way to specify branch name? I know with prefect.yaml file, there is a way to specify this.
from prefect.runner.storage import GitRepository
from prefect.blocks.system import Secret
flow.from_source(
source=GitRepository(
url="<https://github.com/org/private-repo.git>",
branch="dev",
)
🙌 1
m
Moe
08/29/2024, 5:04 PM
Hey @Emil Christensen thanks!
🙌 1
k
Kamal
08/29/2024, 8:36 PM
we use to deploy using prefect.yaml file instead of configuring inside python code. which has flexibility of deploying different versions of code and different env for testing.
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.