Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add supported python version in workflows #50

Merged
merged 7 commits into from
May 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ["3.8"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
poetry-version: ["1.4.2"]

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ["3.8"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
poetry-version: ["1.4.2"]

steps:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[![Coverage Status](https://coveralls.io/repos/github/MoBagel/decanter-ai-sdk/badge.svg?branch=coveralls)](https://coveralls.io/github/MoBagel/decanter-ai-sdk?branch=coveralls)
[![tests](https://github.com/MoBagel/decanter-ai-sdk/workflows/main/badge.svg)](https://github.com/MoBagel/decanter-ai-sdk)
[![PyPI version](https://badge.fury.io/py/decanter-ai-sdk.svg)](https://badge.fury.io/py/decanter-ai-sdk)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

# Mobagel decanter ai sdk

Expand Down
12 changes: 4 additions & 8 deletions decanter_ai_sdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,10 +406,8 @@ def predict_iid(
)

prediction = Prediction(
attributes=self.wait_for_response("prediction", pred_id)
)
prediction.predict_df = self.api.get_pred_data(
prediction.attributes["_id"], download
attributes=self.wait_for_response("prediction", pred_id),
predict_df=self.api.get_pred_data(pred_id, download),
)

return prediction
Expand Down Expand Up @@ -458,10 +456,8 @@ def predict_ts(
)

prediction = Prediction(
attributes=self.wait_for_response("prediction", pred_id)
)
prediction.predict_df = self.api.get_pred_data(
prediction.attributes["_id"], download
attributes=self.wait_for_response("prediction", pred_id),
predict_df=self.api.get_pred_data(pred_id, download),
)
return prediction

Expand Down
8 changes: 4 additions & 4 deletions decanter_ai_sdk/non_blocking_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def train_iid(
Experiment id.
"""
data_column_info = self.api.get_table_info(table_id=experiment_table_id)

# cast target column
if target in custom_column_types.keys():
data_column_info[target] = custom_column_types[target].value
Expand Down Expand Up @@ -607,7 +607,7 @@ def get_table_list(self) -> List[str]:
"""
return self.api.get_table_list()

def check_upload_status(self, id) -> str:
def check_upload_status(self, id) -> Status:
"""
You can check the status of the uploading task by inputting upload id using this function.

Expand All @@ -622,7 +622,7 @@ def check_upload_status(self, id) -> str:
"""
return Status(self.api.check(task="table", id=id)["status"])

def check_exp_status(self, id) -> str:
def check_exp_status(self, id) -> Status:
"""
You can check the status of the experiment by inputting experiment id using this function.

Expand All @@ -637,7 +637,7 @@ def check_exp_status(self, id) -> str:
"""
return Status(self.api.check(task="experiment", id=id)["status"])

def check_pred_status(self, id) -> str:
def check_pred_status(self, id) -> Status:
"""
You can check the status of the prediction by inputting prediction id using this function.

Expand Down
2 changes: 1 addition & 1 deletion decanter_ai_sdk/web_api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class ApiClient(ABC):
@abstractmethod
def post_upload(self, file: Dict, name: str):
def post_upload(self, file: tuple, name: str):
raise NotImplementedError

@abstractmethod
Expand Down
8 changes: 5 additions & 3 deletions decanter_ai_sdk/web_api/decanter_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,12 @@ def update_table(self, table_id, updated_column, updated_type) -> None:
"columns": [{"data_type": updated_type, "id": updated_column}],
"table_id": table_id,
}

update_response = self.session.put(
f"{self.url}table/update", headers=self.headers, data=json.dumps(data), verify=False

update_response = self.session.put(
f"{self.url}table/update",
headers=self.headers,
data=json.dumps(data),
verify=False,
)
if update_response.status_code == 200:
print("Update Successfully!!")
Expand Down
3 changes: 2 additions & 1 deletion decanter_ai_sdk/web_api/iid_testing_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

current_path = os.path.dirname(os.path.abspath(__file__))


# The following code is generated for local unit testing simulation.
class TestingIidApiClient(ApiClient):
def __init__(self):
Expand All @@ -17,7 +18,7 @@ def __init__(self):
self.project_id = None
self.auth_headers = None

def post_upload(self, file: Dict, name: str):
def post_upload(self, file: tuple, name: str):
if name == "iid_train_file":
return "63047377818547e247f5aa4e"
else:
Expand Down
3 changes: 2 additions & 1 deletion decanter_ai_sdk/web_api/ts_testing_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

current_path = os.path.dirname(os.path.abspath(__file__))


# The following code is generated for local unit testing simulation.
class TestingTsApiClient(ApiClient):
def __init__(self):
Expand All @@ -17,7 +18,7 @@ def __init__(self):
self.project_id = None
self.auth_headers = None

def post_upload(self, file: Dict, name: str):
def post_upload(self, file: tuple, name: str):
if name == "ts_train_file":
return "63044594818547e247f5aa44"
else:
Expand Down
Loading