Skip to content

Commit

Permalink
lints and deps
Browse files Browse the repository at this point in the history
  • Loading branch information
thorrester committed Jun 11, 2024
1 parent 039cf49 commit d964c84
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions opsml/helpers/gcp_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def _get_creds(self) -> Tuple[Optional[Union[ComputeEngineCredentials, Credentia
return self.get_default_creds()

def get_default_creds(self) -> Tuple[Optional[ComputeEngineCredentials], Optional[str], bool]:
credentials, project_id = google.auth.default()
credentials, project_id = google.auth.default() # type: ignore

return credentials, project_id, True

Expand All @@ -72,7 +72,7 @@ def create_gcp_creds_from_base64(self, service_base64_creds: str) -> Tuple[Crede
"""
scopes = {"scopes": ["https://www.googleapis.com/auth/devstorage.full_control"]} # needed for gcsfs
key = self.decode_base64(service_base64_creds=service_base64_creds)
service_creds: Credentials = service_account.Credentials.from_service_account_info(info=key, **scopes) # noqa
service_creds: Credentials = service_account.Credentials.from_service_account_info(info=key, **scopes) # type: ignore # noqa
project_name = cast(str, service_creds.project_id)

return service_creds, project_name, False
6 changes: 4 additions & 2 deletions opsml/registry/sql/connectors/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import os
from enum import Enum
from functools import cached_property
from typing import Any, Dict
from typing import Any, Dict, cast

import sqlalchemy
from sqlalchemy.engine.url import make_url
Expand Down Expand Up @@ -110,7 +110,9 @@ def _ip_type(self) -> Enum:
"""Sets IP type for CloudSql"""
from google.cloud.sql.connector.instance import IPTypes

return IPTypes.PRIVATE if os.environ.get("PRIVATE_IP") else IPTypes.PUBLIC
type_ = IPTypes.PRIVATE if os.environ.get("PRIVATE_IP") else IPTypes.PUBLIC

return cast(Enum, type_)

@property
def _connection_name(self) -> str:
Expand Down
4 changes: 2 additions & 2 deletions opsml/storage/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ def get_id_credentials(self) -> Any:
from google.auth import compute_engine
from google.auth.transport import requests

auth_request = requests.Request()
return compute_engine.IDTokenCredentials(auth_request, "")
auth_request = requests.Request() # type: ignore
return compute_engine.IDTokenCredentials(auth_request, "") # type: ignore

return self.settings.credentials

Expand Down
10 changes: 5 additions & 5 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ onnx = { version = "~1.16.0", optional = true }
onnxruntime = { version = "~1.16.0", optional = true }

# optional dependencies for sklearn onnx
skl2onnx = { version = "^1.16.0", optional = true }
skl2onnx = { version = "^1.15.0, !=1.17.0", optional = true }
onnxmltools = { version = "^1.11.1", optional = true }

# optional dependencies for tensorflow onnx
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1821,7 +1821,7 @@ def bagging_regression(regression_data):
@pytest.fixture(scope="module")
def bayesian_ridge_regression(regression_data):
X, y = regression_data
reg = linear_model.BayesianRidge(n_iter=10).fit(X, y)
reg = linear_model.BayesianRidge(max_iter=10).fit(X, y)
return SklearnModel(model=reg, sample_data=X)


Expand Down

0 comments on commit d964c84

Please sign in to comment.