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

A big one #28

Merged
merged 37 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
f6aa935
Added new langchain features
MatsMoll Jul 2, 2024
ac5c798
added new way to modify schemas
MatsMoll Jul 2, 2024
c0629ce
Updated
MatsMoll Jul 2, 2024
6313cc1
Minor bug fix
MatsMoll Jul 2, 2024
9b86bc3
Fixed Minor Bug
MatsMoll Jul 2, 2024
69a7560
Fixed bug
MatsMoll Jul 2, 2024
582eb0f
added loaded_at_source
MatsMoll Jul 3, 2024
20050e4
Updated loaded at
MatsMoll Jul 3, 2024
45fc397
Fixed loaded at
MatsMoll Jul 3, 2024
0e2b874
Fixed loading error
MatsMoll Jul 3, 2024
6e30449
Updated with_schema for a model
MatsMoll Jul 3, 2024
b5806c7
Removed render of Custom Method Source
MatsMoll Jul 4, 2024
56d207b
Renamed markdown for custom method source
MatsMoll Jul 4, 2024
24cb30e
Not returning hidden features
MatsMoll Jul 4, 2024
f1bd255
Derive features for dummy data source
MatsMoll Jul 4, 2024
eba785d
Updated partitioned parquet writer
MatsMoll Jul 4, 2024
7b44f36
Massive update across the place
MatsMoll Jul 18, 2024
aaffb73
fixed landedb similarity search
MatsMoll Jul 19, 2024
3444b10
Updated freshness for lancedb
MatsMoll Jul 20, 2024
1905747
Improved data writing
MatsMoll Aug 11, 2024
e5d16f8
Updated files based on pyright and some cleanup
MatsMoll Aug 13, 2024
3a97154
Minor improv
MatsMoll Aug 14, 2024
f9ae831
Updated with improved default values when missing
MatsMoll Aug 14, 2024
1cefa78
Added copy_default_values on with_schema
MatsMoll Aug 14, 2024
a2a8b9b
Setting tags on with_schema
MatsMoll Aug 14, 2024
183d892
Updated tags for derived features
MatsMoll Aug 14, 2024
2db588f
Removed references to codable source
MatsMoll Aug 20, 2024
b02cf81
Improved feature store
MatsMoll Aug 20, 2024
f58ddc0
Minor updates
MatsMoll Sep 1, 2024
872f490
Added a way to operate on spesific types of sources
MatsMoll Sep 9, 2024
23e6591
Updated with some bug fixes
MatsMoll Sep 11, 2024
8ac29b7
Updated with lazy pandas import
MatsMoll Sep 11, 2024
b61600e
Defined if transformations should be copied
MatsMoll Sep 11, 2024
2052b3a
Updated literal job
MatsMoll Sep 11, 2024
1bac8d4
Updated tests
MatsMoll Sep 11, 2024
485e159
Updated tests
MatsMoll Sep 11, 2024
a1bd7fc
Updated deps
MatsMoll Sep 11, 2024
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
26 changes: 4 additions & 22 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,13 @@ repos:
files: 'cloud\/.*\.py'

# Static type and code checkers below

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.6.0'
hooks:
- id: flake8
additional_dependencies:
- flake8-comprehensions
- flake8-print
- flake8-mutable
- flake8-pytest-style
- flake8-printf-formatting
- 'flake8-simplify==0.19.2'
- 'flake8-type-checking==2.1.3'
args: [ '--enable-extensions=G' ]
- id: ruff
args: [ --fix ]

- repo: https://github.com/python-poetry/poetry
rev: 1.5.0
hooks:
- id: poetry-check


- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.942
hooks:
- id: mypy
files: 'aladdin/.*|tests/.*'
additional_dependencies:
- types-freezegun
5 changes: 1 addition & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@ RUN poetry config virtualenvs.create false
RUN pip install pip --upgrade

COPY ./pyproject.toml /opt/app/pyproject.toml
# COPY ./poetry.lock /opt/app/poetry.lock
COPY ./poetry.lock /opt/app/poetry.lock

RUN mkdir /opt/app/aligned
RUN poetry install --no-dev --no-root --extras "redis psql server aws"

COPY ./aligned /opt/app/aligned

# COPY /. opt/app/aligned

ENTRYPOINT ["python", "-m", "aligned.cli"]
# RUN pip install -U 'opt/app/aligned[redis,aws,psql,server,text]'
3 changes: 2 additions & 1 deletion Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ RUN poetry config virtualenvs.create false
RUN pip install pip --upgrade

COPY ./pyproject.toml /opt/app/pyproject.toml
COPY ./poetry.lock /opt/app/poetry.lock

RUN mkdir /opt/app/aligned
RUN poetry install --no-root --all-extras
RUN poetry install --no-root --extras "redis pandera kafka ollama mlflow lancedb"

COPY ./aligned /opt/app/aligned
COPY ./conftest.py /opt/app/conftest.py
Expand Down
3 changes: 1 addition & 2 deletions aligned/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from aligned.data_source.stream_data_source import HttpStreamSource
from aligned.data_source.batch_data_source import CustomMethodDataSource
from aligned.feature_store import ContractStore, FeatureStore
from aligned.feature_view import feature_view, combined_feature_view, check_schema
from aligned.feature_view import feature_view, check_schema
from aligned.schemas.text_vectoriser import EmbeddingModel
from aligned.sources.kafka import KafkaConfig
from aligned.sources.local import FileSource, Directory, ParquetConfig, CsvConfig
Expand Down Expand Up @@ -77,7 +77,6 @@
'Json',
'EmbeddingModel',
'feature_view',
'combined_feature_view',
'model_contract',
# Aggregation
'CustomAggregation',
Expand Down
4 changes: 3 additions & 1 deletion aligned/active_learning/job.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from __future__ import annotations

import logging
from dataclasses import dataclass

import pandas as pd
import polars as pl

from aligned.lazy_imports import pandas as pd
from aligned.active_learning.selection import ActiveLearningMetric, ActiveLearningSelection
from aligned.active_learning.write_policy import ActiveLearningWritePolicy
from aligned.retrival_job import RetrivalJob
Expand Down
2 changes: 1 addition & 1 deletion aligned/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def as_markdown(self) -> str:
def feature_exist(feature: FeatureReference, store: ContractStore) -> bool:

loc = feature.location
if loc.location == 'model':
if loc.location_type == 'model':
model = store.model(loc.name).model
all_features = model.predictions_view.full_schema
else:
Expand Down
7 changes: 6 additions & 1 deletion aligned/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,12 @@ async def compile(repo_path: str, reference_file: str, env_file: str, ignore_fil

repo_def = await RepoReader.definition_from_path(dir, excludes)

await file.write(repo_def.to_json(omit_none=True).encode('utf-8'))
data = repo_def.to_json(omit_none=True)
if isinstance(data, str):
data_bytes = data.encode('utf-8')
else:
data_bytes = data
await file.write(data_bytes)
else:
click.echo(f'No repo file found at {dir}')

Expand Down
Loading
Loading