Eric Aggrey
08/02/2025, 3:20 AMMarvin
08/02/2025, 3:20 AMMarvin
08/02/2025, 3:20 AMGitRepository
storage method
2. The pandas installation needs to be handled differently
Here's the corrected version of your code:
python
from prefect import flow
@flow
def flow1():
import pandas as pd
# your flow code here
# Deploy the flow directly from GitHub
flow1.from_source(
source="<https://github.com/sabiagents/flows.git>",
entrypoint="flow2.py:flow1",
).deploy(
name="flow1",
work_pool_name="default",
job_variables={
"env": {
"EXTRA_PIP_PACKAGES": "pandas"
}
}
)
Key changes made:
1. Removed the deprecated GitRepository
and Secret
imports
2. Simplified the GitHub source specification to use a direct URL
3. Maintained your pandas installation through EXTRA_PIP_PACKAGES
Additionally, you might want to consider creating a requirements.txt
file in your repository with your dependencies listed. This is often a more maintainable approach. Your requirements.txt
would look like:
pandas
Then you could modify your deployment to use this file:
python
flow1.from_source(
source="<https://github.com/sabiagents/flows.git>",
entrypoint="flow2.py:flow1",
).deploy(
name="flow1",
work_pool_name="default",
job_variables={
"env": {
"EXTRA_PIP_PACKAGES": "-r requirements.txt"
}
}
)
This approach is more scalable as you can manage all your dependencies in one file.
Let me know if you need any clarification or run into other issues!