Skip to content

Commit

Permalink
Test workflow changes: on from pull_request_target to pull_request
Browse files Browse the repository at this point in the history
Signed-off-by: Theodor Mihalache <[email protected]>
  • Loading branch information
tmihalac committed Sep 23, 2024
1 parent 9e774a8 commit f8e5935
Show file tree
Hide file tree
Showing 13 changed files with 353 additions and 628 deletions.
18 changes: 13 additions & 5 deletions sdk/python/feast/errors.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import importlib
import json
import logging
from typing import Any, List, Optional, Set
from typing import TYPE_CHECKING, Any, List, Optional, Set

from colorama import Fore, Style
from fastapi import status as HttpStatusCode
from grpc import StatusCode as GrpcStatusCode

if TYPE_CHECKING:
from grpc import StatusCode as GrpcStatusCode

from feast.field import Field

Expand All @@ -15,7 +17,9 @@
class FeastError(Exception):
pass

def grpc_status_code(self) -> GrpcStatusCode:
def grpc_status_code(self) -> "GrpcStatusCode":
from grpc import StatusCode as GrpcStatusCode

return GrpcStatusCode.INTERNAL

def http_status_code(self) -> int:
Expand Down Expand Up @@ -89,7 +93,9 @@ def __init__(self, ds_name: str):
class FeastObjectNotFoundException(FeastError):
pass

def grpc_status_code(self) -> GrpcStatusCode:
def grpc_status_code(self) -> "GrpcStatusCode":
from grpc import StatusCode as GrpcStatusCode

return GrpcStatusCode.NOT_FOUND

def http_status_code(self) -> int:
Expand Down Expand Up @@ -504,7 +510,9 @@ class FeastPermissionError(FeastError, PermissionError):
def __init__(self, details: str):
super().__init__(f"Permission error:\n{details}")

def grpc_status_code(self) -> GrpcStatusCode:
def grpc_status_code(self) -> "GrpcStatusCode":
from grpc import StatusCode as GrpcStatusCode

return GrpcStatusCode.PERMISSION_DENIED

def http_status_code(self) -> int:
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/feast/infra/offline_stores/bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class BigQueryOfflineStoreConfig(FeastConfigBaseModel):

@field_validator("billing_project_id")
def project_id_exists(cls, v, values, **kwargs):
if v and not values["project_id"]:
if v and not values.data["project_id"]:
raise ValueError(
"please specify project_id if billing_project_id is specified"
)
Expand Down
1 change: 1 addition & 0 deletions sdk/python/feast/infra/registry/snowflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -1303,6 +1303,7 @@ def delete_project(
"DATA_SOURCES",
"ENTITIES",
"PERMISSIONS",
"FEAST_METADATA",
"PROJECTS",
}:
query = f"""
Expand Down
1 change: 1 addition & 0 deletions sdk/python/feast/infra/registry/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -1237,6 +1237,7 @@ def delete_project(
data_sources,
entities,
permissions,
feast_metadata,
projects,
}:
stmt = delete(t).where(t.c.project_id == name)
Expand Down
Loading

0 comments on commit f8e5935

Please sign in to comment.