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

Matsemoll/pr ci #5

Merged
merged 32 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
6419042
Removed features from the batch_write function
MatsMoll Jun 25, 2023
1a4ad99
feat: added basic source validation
MatsMoll Jun 25, 2023
784847d
feat: Feature View Code Generation
MatsMoll Jun 26, 2023
04724dd
fix: CI
MatsMoll Jun 26, 2023
d75a467
fix: CI
MatsMoll Jun 26, 2023
289c359
fix: Poetry Version in PR
MatsMoll Jun 26, 2023
54722bf
fix: CI
MatsMoll Jun 26, 2023
6ead365
Changed connectorx version
MatsMoll Jun 26, 2023
d5474a3
fix: Downgraded Python Version in CI
MatsMoll Jun 26, 2023
f6c5be9
fix: test
MatsMoll Jun 26, 2023
a6caa3f
stream improvments
MatsMoll Jul 3, 2023
a57ae6c
Improved tests
MatsMoll Jul 17, 2023
7e9cb56
added psql db to CI
MatsMoll Jul 17, 2023
c914dca
fix: ci psql url
MatsMoll Jul 17, 2023
72d5d15
Added improved parquet test
MatsMoll Jul 17, 2023
99b818a
fix: event timestamp bug
MatsMoll Jul 17, 2023
7efd896
fix: added port for psql in ci
MatsMoll Jul 17, 2023
16903a6
feat: added a way to load predictions and ground truths in the same f…
MatsMoll Jul 18, 2023
487b544
added more doc strings
MatsMoll Jul 18, 2023
24919f7
fix: tests
MatsMoll Jul 18, 2023
7b92086
feat: started adding a way to define which event_timestamp to use
MatsMoll Jul 18, 2023
ab9509f
chore: refactored parts of the sql jobs
MatsMoll Jul 26, 2023
8c22152
Added docker-compose needed to test locally
Jul 24, 2023
5edcb58
Added docker-compose needed to test locally
Jul 24, 2023
c420466
fix: minor pre-commit changes
Jul 26, 2023
84369e7
feat: added better validation and some new config
Jul 31, 2023
23141f4
Added psycopg2 as dev dep
Jul 31, 2023
138e3cc
minor changes
MatsMoll Aug 1, 2023
3f81d14
added support for lists in Redshift
MatsMoll Aug 1, 2023
66a64f7
Added better redshift support
MatsMoll Aug 3, 2023
c02453b
updated poetry packages
MatsMoll Aug 3, 2023
eed3472
Writing to psql db from polars to get timestamp schema
MatsMoll Aug 3, 2023
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
51 changes: 51 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Test PR

on:
pull_request:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14.3-alpine
env:
POSTGRES_DB: postgres
POSTGRES_PORT: 5432
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- '127.0.0.1:5432:5432'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"

- uses: actions/cache@v3
id: cache-venv
with:
path: |
~/.local
.venv
key: ${{ hashFiles('**/poetry.lock') }}-${{ steps.setup-python.outputs.python-version }}-1

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: false
version: 1.5.0
- run: |
python -m venv .venv --upgrade-deps
source .venv/bin/activate
poetry install --no-interaction --all-extras
if: steps.cache-venv.outputs.cache-hit != 'true'

- name: Run tests
env:
PSQL_DATABASE_TEST: postgresql://postgres:postgres@localhost:5432/postgres
run: |
source .venv/bin/activate
pytest
44 changes: 34 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,41 @@ on:
- main

jobs:
# build-and-publish-test:
# runs-on: ubuntu-latest
# steps:
# - uses: snok/.github/workflows/publish@main
# with:
# overwrite-repository: true
# repository-url: https://test.pypi.org/legacy/
# token: ${{ secrets.TEST_PYPI_TOKEN }}
# python-version: '3.10.0'
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"

- uses: actions/cache@v3
id: cache-venv
with:
path: |
~/.local
.venv
key: ${{ hashFiles('**/poetry.lock') }}-${{ steps.setup-python.outputs.python-version }}-1

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: false
version: 1.5.0
- run: |
python -m venv .venv --upgrade-deps
source .venv/bin/activate
poetry install --no-interaction --all-extras
if: steps.cache-venv.outputs.cache-hit != 'true'


- name: Run tests
run: |
source .venv/bin/activate
pytest

build-and-publish:
# needs: build-and-publish-test
needs: [test]
runs-on: ubuntu-latest
steps:
- uses: MatsMoll/.github/workflows/publish@patch-1
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
.pg/*
.DS_STORE

test_data/feature-store.json

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
56 changes: 22 additions & 34 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
default_stages: [commit]
repos:
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
args: [ "--quiet" ]

- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.4.0
hooks:
- id: check-ast
- id: check-merge-conflict
Expand All @@ -25,43 +21,35 @@ repos:
- id: trailing-whitespace
- id: double-quote-string-fixer

- repo: https://github.com/asottile/yesqa
rev: v1.3.0
- repo: https://github.com/asottile/pyupgrade
rev: v3.7.0
hooks:
- id: yesqa
additional_dependencies: &flake8_deps
- flake8-bugbear
- id: pyupgrade
types: [ python ]
args: [ "--py36-plus", "--py37-plus", "--py38-plus", "--py39-plus", "--py310-plus"]
files: 'cloud\/.*\.py'

# Static type and code checkers below

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies:
- flake8-comprehensions
- flake8-print
- flake8-mutable
- flake8-simplify
- flake8-pytest-style
- flake8-printf-formatting
- 'flake8-simplify==0.18'
- 'flake8-type-checking==1.3.2'
- 'flake8-simplify==0.19.2'
- 'flake8-type-checking==2.1.3'
args: [ '--enable-extensions=G' ]

- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
- repo: https://github.com/python-poetry/poetry
rev: 1.5.0
hooks:
- id: flake8
additional_dependencies: *flake8_deps

- repo: https://github.com/sirosen/check-jsonschema
rev: 0.14.2
hooks:
- id: check-github-actions
- id: check-github-workflows

- repo: https://github.com/asottile/pyupgrade
rev: v2.31.1
hooks:
- id: pyupgrade
args: [ "--py36-plus", "--py37-plus", '--py38-plus', '--py39-plus']
- id: poetry-check

- repo: https://github.com/hadialqattan/pycln
rev: v1.2.5
hooks:
- id: pycln

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.942
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10.5
4 changes: 2 additions & 2 deletions aligned/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
String,
Timestamp,
)
from aligned.compiler.model import Model
from aligned.compiler.model import ModelContract
from aligned.data_source.stream_data_source import HttpStreamSource
from aligned.feature_store import FeatureStore
from aligned.feature_view import (
Expand Down Expand Up @@ -56,6 +56,6 @@
'EventTimestamp',
'Timestamp',
'Json',
'Model',
'ModelContract',
'TextVectoriserModel',
]
11 changes: 2 additions & 9 deletions aligned/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,7 @@ def serve_command(
default='.env',
help='The path to env variables',
)
@click.option(
'--prune-unused-features',
default=False,
help='Will only process features that are used in a model if set to True',
)
async def serve_worker_command(
repo_path: str, worker_path: str, env_file: str, prune_unused_features: bool
) -> None:
async def serve_worker_command(repo_path: str, worker_path: str, env_file: str) -> None:
"""
Starts a API serving the feature store
"""
Expand All @@ -269,7 +262,7 @@ async def serve_worker_command(

worker = StreamWorker.from_object(dir, reference_file_path, obj)

await worker.start(prune_unused_features)
await worker.start()


@cli.command('materialize')
Expand Down
Loading