Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
edublancas committed Sep 18, 2024
1 parent 9e80b60 commit efbd706
Show file tree
Hide file tree
Showing 21 changed files with 40 additions and 20 deletions.
1 change: 1 addition & 0 deletions src/soopervisor/abc.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Abstract classes that define the protocol for all exporters
"""

import click
import abc
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions src/soopervisor/airflow/export.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Export a Ploomber DAG to Airflow
"""

import json
import os
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions src/soopervisor/argo/export.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Export to Argo Workflows
"""

from pathlib import Path

import click
Expand Down
40 changes: 20 additions & 20 deletions src/soopervisor/assets/aws-lambda/app.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import json
# import json

import pandas as pd
from ploomber import OnlineModel
# import pandas as pd
# from ploomber import OnlineModel

import {{package_name}}
# import {{package_name}}

model = OnlineModel({{package_name}})
# model = OnlineModel({{package_name}})


def handler(event, context):
body = json.loads(event['body'])
# def handler(event, context):
# body = json.loads(event['body'])

raise NotImplementedError('Missing implementation '
'in {{package_name}}/app.py. '
'Add input parsing logic.')
# raise NotImplementedError('Missing implementation '
# 'in {{package_name}}/app.py. '
# 'Add input parsing logic.')

# NOTE: example implementation for a pipeline that expects a data frame
# in a "get" task input
df = pd.DataFrame(body, index=[0])
prediction = int(model.predict(get=df)[0])
# # NOTE: example implementation for a pipeline that expects a data frame
# # in a "get" task input
# df = pd.DataFrame(body, index=[0])
# prediction = int(model.predict(get=df)[0])

return {
"statusCode": 200,
"body": json.dumps({
"prediction": prediction
}),
}
# return {
# "statusCode": 200,
# "body": json.dumps({
# "prediction": prediction
# }),
# }
1 change: 1 addition & 0 deletions src/soopervisor/aws/batch.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Running pipelines on AWS Batch
"""

import re
from uuid import uuid4
import os
Expand Down
1 change: 1 addition & 0 deletions src/soopervisor/aws/lambda_.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Online DAG deployment using AWS Lambda
"""

from pathlib import Path
from ploomber.util import default
from ploomber.io._commander import Commander
Expand Down
1 change: 1 addition & 0 deletions src/soopervisor/commons/dag.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Loading dags
"""

from pathlib import Path

from ploomber.constants import TaskStatus
Expand Down
1 change: 1 addition & 0 deletions src/soopervisor/kubeflow/export.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Export a Ploomber DAG to Kubeflow
"""

import os
from pathlib import Path

Expand Down
1 change: 1 addition & 0 deletions tasks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Setup tasks (requires invoke: pip install invoke)
"""

import shutil
import sys
import platform
Expand Down
1 change: 1 addition & 0 deletions tests/assets/multiple_requirements_project/clean_one.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Clean raw data
"""

import pandas as pd

# + tags=["parameters"]
Expand Down
1 change: 1 addition & 0 deletions tests/assets/multiple_requirements_project/clean_two.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Clean raw data
"""

import pandas as pd

# + tags=["parameters"]
Expand Down
1 change: 1 addition & 0 deletions tests/assets/multiple_requirements_project/plot.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Generate plot
"""

import pandas as pd
import seaborn as sns

Expand Down
1 change: 1 addition & 0 deletions tests/assets/multiple_requirements_project/raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Data reference: https://archive.ics.uci.edu/ml/datasets/Adult
"""

import pandas as pd

# + tags=["parameters"]
Expand Down
1 change: 1 addition & 0 deletions tests/assets/sample_project/clean.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Clean raw data
"""

import pandas as pd

# + tags=["parameters"]
Expand Down
1 change: 1 addition & 0 deletions tests/assets/sample_project/plot.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Generate plot
"""

import pandas as pd

# + tags=["parameters"]
Expand Down
1 change: 1 addition & 0 deletions tests/assets/sample_project/raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Data reference: https://archive.ics.uci.edu/ml/datasets/Adult
"""

import pandas as pd

# + tags=["parameters"]
Expand Down
1 change: 1 addition & 0 deletions tests/test_abc_config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Test abstract class implementation
"""

from pathlib import Path

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/test_add.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Common tests for all implementations
"""

from pathlib import Path

import pytest
Expand Down
1 change: 1 addition & 0 deletions tests/test_commons_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Testing docker-related functions. Unlike test_commons.py, this file does not
mock docker
"""

import subprocess
import platform
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions tests/test_config_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Here we check the default values for each config object, this should contain
the minimum number of keys, and values should contain reasonable hints
"""

import pytest

from soopervisor.shell.config import SlurmConfig
Expand Down
1 change: 1 addition & 0 deletions tests/test_dist.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Test generated wheel
"""

import tarfile
from glob import iglob
from pathlib import Path
Expand Down

0 comments on commit efbd706

Please sign in to comment.