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
17:02:46.645 | INFO | prefect.agent - Submitting flow run '7fd49764-045f-4c68-a071-2470a1cf2070' | |
17:02:46.835 | INFO | prefect.infrastructure.docker-container - Creating Docker container 'zircon-ant'... | |
17:02:46.906 | INFO | prefect.infrastructure.docker-container - Docker container 'zircon-ant' has status 'created' | |
17:02:47.230 | INFO | prefect.agent - Completed submission of flow run '7fd49764-045f-4c68-a071-2470a1cf2070' | |
17:02:47.286 | INFO | prefect.infrastructure.docker-container - Docker container 'zircon-ant' has status 'running' | |
22:03:16.533 | ERROR | prefect.engine - Engine execution of flow run '7fd49764-045f-4c68-a071-2470a1cf2070' exited with unexpected exception | |
Traceback (most recent call last): | |
File "/usr/local/lib/python3.9/site-packages/prefect/client.py", line 1516, in read_flow_run | |
response = await self._client.get(f"/flow_runs/{flow_run_id}") | |
File "/usr/local/lib/python3.9/site-packages/httpx/_client.py", line 1751, in get |
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 sqlalchemy import create_engine | |
engine = create_engine( | |
f"postgresql://{connection.user}:{connection.password}@{connection.host}/{connection.database}", | |
) | |
df.to_sql(name=name, con=engine, if_exists="replace", index=False) |
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 sqlalchemy import create_engine | |
engine = create_engine( | |
f"postgresql://{connection.user}:{connection.password}@{connection.host}/{connection.database}", | |
) | |
query = f'SELECT * FROM "{name}"' | |
df = pd.read_sql(query, con=engine) |
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
# This is Prefect 2.0b9 | |
import asyncio | |
from prefect import flow, task | |
@task | |
async def shout(number): | |
asyncio.sleep(1) |
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 pathlib import Path | |
from prefect.deployments import Deployment, FlowScript | |
Deployment( | |
flow=FlowScript( | |
path=Path(__file__).parent / "train_model.py" | |
), | |
tags=["dev"], | |
) |
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
Traceback (most recent call last): | |
File "/Users/khuyen/prefect2-mlops-demo/venv/lib/python3.9/site-packages/alembic/script/base.py", line 233, in _catch_revision_errors | |
yield | |
File "/Users/khuyen/prefect2-mlops-demo/venv/lib/python3.9/site-packages/alembic/script/base.py", line 443, in _upgrade_revs | |
for script in reversed(list(revs)) | |
File "/Users/khuyen/prefect2-mlops-demo/venv/lib/python3.9/site-packages/alembic/script/revision.py", line 799, in iterate_revisions | |
revisions, heads = fn( | |
File "/Users/khuyen/prefect2-mlops-demo/venv/lib/python3.9/site-packages/alembic/script/revision.py", line 1454, in _collect_upgrade_revisions | |
current_revisions = self.get_revisions(lower) | |
File "/Users/khuyen/prefect2-mlops-demo/venv/lib/python3.9/site-packages/alembic/script/revision.py", line 527, in get_revisions |
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 datetime import timedelta | |
import pendulum | |
from prefect.deployments import DeploymentSpec | |
from prefect.flow_runners import SubprocessFlowRunner | |
from prefect.orion.schemas.schedules import IntervalSchedule | |
schedule = IntervalSchedule( | |
interval=timedelta(days=1), | |
anchor_date=pendulum.datetime(2022, 6, 26, 22, 0, 0, tz="America/Chicago"), |
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 get_data import get_data | |
from prefect import flow | |
from process_data import process_data | |
@flow | |
def get_and_process_data(language: str = "Python"): | |
get_data() | |
process_data(language=language) |
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
import pandas as pd | |
import streamlit as st | |
from Visualize import get_all_topics, load_config, load_data | |
def get_unique_topic_selection(topics: list): | |
return list(set(topics)) | |
def filter_based_on_topics(topics: list, data: pd.DataFrame): |
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 collections import Counter | |
import matplotlib.pyplot as plt | |
import pandas as pd | |
import plotly.express as px | |
import streamlit as st | |
from hydra import compose, initialize | |
from omegaconf import DictConfig | |
from pydash import py_ | |
from wordcloud import WordCloud |