Skip to content
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
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
"ghcr.io/devcontainers-contrib/features/maven-sdkman:2": {
"jdkVersion": "11.0.24-amzn"
}
},
}

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Uncomment the next line to run commands after the container is created.
"postCreateCommand": "make install-python-ci-dependencies-uv-venv"
// "postCreateCommand": "make install-python-ci-dependencies-uv-venv"

// Configure tool-specific properties.
// "customizations": {},
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/smoke_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: smoke-tests
Copy link
Member

@franciscojavierarceo franciscojavierarceo Sep 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image


on: [pull_request]
jobs:
unit-test-python:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: [ "3.9", "3.10", "3.11"]
os: [ ubuntu-latest ]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v4
- name: Setup Python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Get uv cache dir
id: uv-cache
run: |
echo "::set-output name=dir::$(uv cache dir)"
- name: uv cache
uses: actions/cache@v4
with:
path: ${{ steps.uv-cache.outputs.dir }}
key: ${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-uv-${{ hashFiles(format('**/py{0}-ci-requirements.txt', env.PYTHON)) }}
- name: Install dependencies
run: make install-python-dependencies-uv
- name: Test Imports
run: python -c "from feast import cli"
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ build: protos build-java build-docker

# Python SDK

install-python-dependencies-uv:
uv pip sync --system sdk/python/requirements/py$(PYTHON_VERSION)-requirements.txt
uv pip install --system --no-deps .

install-python-dependencies-uv-venv:
uv pip sync sdk/python/requirements/py$(PYTHON_VERSION)-requirements.txt
uv pip install --no-deps .

install-python-ci-dependencies:
python -m piptools sync sdk/python/requirements/py$(PYTHON_VERSION)-ci-requirements.txt
pip install --no-deps -e .
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ requires = [
"sphinx!=4.0.0",
"wheel",
]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
# Including this section is comparable to supplying use_scm_version=True in setup.py.
Expand Down
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