Skip to content

Commit

Permalink
set up own poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
alice-yin committed Apr 19, 2024
1 parent 7b92a41 commit 6d80eff
Show file tree
Hide file tree
Showing 9 changed files with 984 additions and 295 deletions.
4 changes: 2 additions & 2 deletions cloud_export_to_parquet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

This is an example workflow to convert exported file from proto to parquet file. The workflow is an hourly schedule.

For this sample, the optional `cloud_export_to_parquet` dependency group must be included. To include, run:
Please make sure your python is 3.9 above. For this sample, run:

poetry install --with cloud_export_to_parquet
poetry install

Before you start, please modify workflow input in `create_schedule.py` with your s3 bucket and namespace. Also make sure you've the right AWS permission set up in your environment to allow this workflow read and write to your s3 bucket.

Expand Down
Empty file.
4 changes: 1 addition & 3 deletions cloud_export_to_parquet/create_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
ScheduleSpec,
WorkflowFailureError,
)
from workflows import ProtoToParquet

from cloud_export_to_parquet.workflows import ProtoToParquetWorkflowInput
from workflows import ProtoToParquet, ProtoToParquetWorkflowInput


async def main() -> None:
Expand Down
960 changes: 960 additions & 0 deletions cloud_export_to_parquet/poetry.lock

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions cloud_export_to_parquet/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[tool.poetry]
name = "cloud-export-to-parquet"
version = "0.1.0"
description = ""
authors = ["alice.yin <[email protected]>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.9"
pandas = "^2.2.2"
pyarrow = "^15.0.2"
aioboto3 = "^12.4.0"
temporalio = "^1.5.1"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
6 changes: 1 addition & 5 deletions cloud_export_to_parquet/run_worker.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import asyncio

from data_trans_activities import data_trans_and_land, get_object_keys
from temporalio.client import Client
from temporalio.worker import Worker
from temporalio.worker.workflow_sandbox import (
Expand All @@ -8,11 +9,6 @@
)
from workflows import ProtoToParquet

from cloud_export_to_parquet.data_trans_activities import (
data_trans_and_land,
get_object_keys,
)


async def main() -> None:
"""Main worker function."""
Expand Down
2 changes: 1 addition & 1 deletion cloud_export_to_parquet/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from temporalio.exceptions import ActivityError

with workflow.unsafe.imports_passed_through():
from cloud_export_to_parquet.data_trans_activities import (
from data_trans_activities import (
DataTransAndLandActivityInput,
data_trans_and_land,
get_object_keys,
Expand Down
278 changes: 1 addition & 277 deletions poetry.lock

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ packages = [
[tool.poetry.dependencies]
python = "^3.8"
temporalio = "^1.5.0"
pandas = "^2.0.0"
pyarrow = "^15.0.2"
aioboto3 = "^12.4.0"

[tool.poetry.dev-dependencies]
black = "^22.3.0"
Expand Down Expand Up @@ -55,10 +52,6 @@ fastapi = "^0.105.0"
tqdm = "^4.62.0"
uvicorn = { version = "^0.24.0.post1", extras = ["standard"]}

[tool.poetry.group.cloud_export_to_parquet]
optional = true
dependencies = { pyarrow = "^15.0.2", pandas = "^2.0.0", aioboto3 = "^12.4.0"}

[tool.poetry.group.open_telemetry]
optional = true
[tool.poetry.group.open_telemetry.dependencies]
Expand Down

0 comments on commit 6d80eff

Please sign in to comment.