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

chore: release 1.4.5 #387

Merged
merged 80 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
fc41ab9
[MLOP-634] Butterfree dev workflow, set triggers for branches staging…
moromimay Feb 8, 2021
4be4ffe
[BUG] Fix Staging GithubActions Pipeline (#283)
moromimay Feb 8, 2021
a3a601b
Apply only wheel. (#285)
moromimay Feb 8, 2021
4339608
[BUG] Change version on setup.py to PyPI (#286)
moromimay Feb 9, 2021
a82433c
Keep milliseconds when using 'from_ms' argument in timestamp feature …
hmeretti Feb 9, 2021
dcbf540
Change trigger for pipeline staging (#287)
moromimay Feb 10, 2021
a0a9335
Create a dev package. (#288)
moromimay Feb 10, 2021
7427898
[MLOP-633] Butterfree dev workflow, update documentation (#281)
moromimay Feb 10, 2021
245eaa5
[MLOP-632] Butterfree dev workflow, automate release description (#279)
AlvaroMarquesAndrade Feb 11, 2021
d6ecfa4
[MLOP-636] Create migration classes (#282)
AlvaroMarquesAndrade Feb 18, 2021
32e24d6
[MLOP-635] Rebase Incremental Job/Interval Run branch for test on sel…
moromimay Feb 19, 2021
8da89ed
Allow slide selection (#293)
roelschr Feb 22, 2021
0df07ae
Fix Slide Duration Typo (#295)
AlvaroMarquesAndrade Feb 26, 2021
aeb7999
[MLOP-637] Implement diff method (#292)
moromimay Mar 8, 2021
9afc39c
[MLOP-640] Create CLI with migrate command (#298)
roelschr Mar 15, 2021
bf204f2
[MLOP-645] Implement query method, cassandra (#291)
AlvaroMarquesAndrade Mar 15, 2021
b518dbc
[MLOP-671] Implement get_schema on Spark client (#301)
AlvaroMarquesAndrade Mar 16, 2021
5fe4c40
[MLOP-648] Implement query method, metastore (#294)
AlvaroMarquesAndrade Mar 16, 2021
e8fc0da
Fix Validation Step (#302)
AlvaroMarquesAndrade Mar 22, 2021
3d93a09
[MLOP-647] [MLOP-646] Apply migrations (#300)
roelschr Mar 23, 2021
0d30932
[BUG] Apply create_partitions to historical validate (#303)
moromimay Mar 30, 2021
d607297
[BUG] Fix key path for validate read (#304)
moromimay Mar 30, 2021
3dcd975
[FIX] Add Partition types for Metastore (#305)
AlvaroMarquesAndrade Apr 1, 2021
8077d86
[MLOP-639] Track logs in S3 (#306)
moromimay Apr 1, 2021
6d2a8f9
[BUG] Change logging config (#307)
moromimay Apr 6, 2021
d2c5d39
Change solution for tracking logs (#308)
moromimay Apr 8, 2021
43392f4
Read and write consistency level options (#309)
github-felipe-caputo Apr 13, 2021
0f31164
Fix kafka reader. (#310)
moromimay Apr 14, 2021
e6f67e9
Fix path validate. (#311)
moromimay Apr 14, 2021
baa594b
Add local dc property (#312)
github-felipe-caputo Apr 16, 2021
a74f098
Remove metastore migrate (#313)
moromimay Apr 20, 2021
378f3a5
Fix link in our docs. (#315)
moromimay Apr 20, 2021
3b18b5a
[BUG] Fix Cassandra Connect Session (#316)
moromimay Apr 23, 2021
c46f171
Fix migration query. (#318)
moromimay Apr 26, 2021
bb124f5
Fix migration query add type key. (#319)
moromimay Apr 28, 2021
1c97316
Fix db-config condition (#321)
moromimay May 5, 2021
bb7ed77
MLOP-642 Document migration in Butterfree (#320)
roelschr May 7, 2021
5a0a622
[MLOP-702] Debug mode for Automate Migration (#322)
moromimay May 10, 2021
b1371f1
[MLOP-727] Improve logging messages (#325)
GaBrandao Jun 2, 2021
acf7022
[MLOP-728] Improve logging messages (#324)
moromimay Jun 2, 2021
d0bf61a
Fix method to generate agg feature name. (#326)
moromimay Jun 4, 2021
1cf0dbd
[MLOP-691] Include step to add partition to SparkMetastore during wr…
moromimay Jun 10, 2021
9f42f53
Add the missing link for H3 geohash (#330)
jdvala Jun 16, 2021
78927e3
Update README.md (#331)
Jul 30, 2021
43bb3a3
Update Github Actions Workflow runner (#332)
Aug 22, 2022
2593839
Delete sphinx version. (#334)
moromimay Dec 20, 2022
35bcd30
Update files to staging (#336)
moromimay Dec 21, 2022
3a73ed8
Revert "Update files to staging (#336)" (#337)
moromimay Jan 2, 2023
6b78a50
Less strict requirements (#333)
lecardozo Aug 16, 2023
2a19009
feat: optional row count validation (#340)
ralphrass Aug 18, 2023
ca1a16d
fix: parameter, libs (#341)
ralphrass Aug 18, 2023
60c7ee4
pre-release 1.2.2.dev0 (#342)
ralphrass Aug 21, 2023
f35d665
Rebase staging (#343)
ralphrass Aug 21, 2023
97e44fa
Rebase staging from master (#345)
ralphrass Aug 21, 2023
9bcca0e
feat(MLOP-1985): optional params (#347)
ralphrass Nov 13, 2023
512a0fe
pre-release 1.2.3 (#349)
ralphrass Nov 13, 2023
688a5b3
feat(MLOP-2145): add feature set creation script (#351)
ralphrass Apr 11, 2024
da91b49
Rebase staging from master (#354)
ralphrass Apr 25, 2024
887fbb2
feat(mlop-2269): bump versions (#355)
ralphrass May 29, 2024
5af8a05
fix: sphinx version (#356)
ralphrass Jun 3, 2024
cbda73d
fix: publish and dev versions (#359)
ralphrass Jun 7, 2024
2a5a6e8
feat(MLOP-2236): add NTZ (#360)
ralphrass Jun 14, 2024
6363e03
fix: cassandra configs (#364)
ralphrass Jun 20, 2024
81c2c17
fix: Cassandra config keys (#366)
ralphrass Jun 28, 2024
b1949cd
fix: new type (#368)
ralphrass Jun 28, 2024
12d5e98
Delete .checklist.yaml (#371)
fernandrone Aug 16, 2024
35dd929
Add Delta support (#370)
ralphrass Aug 19, 2024
f6c5db6
Fix dup code (#373)
ralphrass Aug 21, 2024
11cc5d5
fix: performance improvements (#374)
ralphrass Sep 16, 2024
5f7028b
fix: version, format (#376)
ralphrass Oct 3, 2024
52d4911
fix: performance adjustments, migrate (#378)
ralphrass Oct 8, 2024
7f65873
chore: level (#382)
ralphrass Oct 10, 2024
ab551c0
feat(mlop-2456): add protection to host setting on cassandra_client (…
albjoaov Oct 11, 2024
a11a699
fix: rollback repartition (#386)
ralphrass Oct 14, 2024
9ed9af3
chore: release
ralphrass Oct 14, 2024
9e710cb
Merge branch 'master' into release/1.4.5
ralphrass Oct 14, 2024
27617ee
changelog
ralphrass Oct 14, 2024
b784430
Merge branch 'release/1.4.5' of github.com:quintoandar/butterfree int…
ralphrass Oct 14, 2024
9da3e48
lint
ralphrass Oct 14, 2024
ff85d8b
fix: missing import
ralphrass Oct 14, 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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ Preferably use **Added**, **Changed**, **Removed** and **Fixed** topics in each

## [Unreleased]

## [1.4.5](https://github.com/quintoandar/butterfree/releases/tag/1.4.5)
* Rollback repartitions ([#386](https://github.com/quintoandar/butterfree/pull/386))
* Add protection to host setting on cassandra_client ([#385](https://github.com/quintoandar/butterfree/pull/385))

## [1.4.4](https://github.com/quintoandar/butterfree/releases/tag/1.4.4)
* Fix Storage Level ([#382](https://github.com/quintoandar/butterfree/pull/382))

Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ style-check:
@echo "Code Style"
@echo "=========="
@echo ""
@python -m black --check -t py39 --exclude="build/|buck-out/|dist/|_build/|pip/|\.pip/|\.git/|\.hg/|\.mypy_cache/|\.tox/|\.venv/" . && echo "\n\nSuccess" || (echo "\n\nFailure\n\nYou need to run \"make apply-style\" to apply style formatting to your code"; exit 1)
@python -m black --check -t py39 --exclude="build/|buck-out/|dist/|_build/|pip/|\.pip/|\.git/|\.hg/|\.mypy_cache/|\.tox/|\.venv/|venv/" . && echo "\n\nSuccess" || (echo "\n\nFailure\n\nYou need to run \"make apply-style\" to apply style formatting to your code"; exit 1)

.PHONY: quality-check
## run code quality checks with flake8
Expand All @@ -85,7 +85,7 @@ quality-check:
@echo "Flake 8"
@echo "======="
@echo ""
@python -m flake8 && echo "Success"
python -m flake8 --exclude="dist,build,pip,.pip,deps,.venv,venv,.git,.hg,.mypy_cache,.tox" && echo "Success"
@echo ""

.PHONY: type-check
Expand All @@ -95,7 +95,7 @@ type-check:
@echo "mypy"
@echo "===="
@echo ""
@python -m mypy butterfree
@python -m mypy --exclude="build/|buck-out/|dist/|_build/|pip/|\.pip/|\.git/|\.hg/|\.mypy_cache/|\.tox/|\.venv/|venv/" butterfree

.PHONY: checks
## run all code checks
Expand All @@ -104,7 +104,7 @@ checks: style-check quality-check type-check
.PHONY: apply-style
## fix stylistic errors with black
apply-style:
@python -m black -t py39 --exclude="build/|buck-out/|dist/|_build/|pip/|\.pip/|\.git/|\.hg/|\.mypy_cache/|\.tox/|\.venv/" .
@python -m black -t py39 --exclude="build/|buck-out/|dist/|_build/|pip/|\.pip/|\.git/|\.hg/|\.mypy_cache/|\.tox/|\.venv/|venv/" .
@python -m isort --atomic butterfree/ tests/

.PHONY: clean
Expand Down
46 changes: 44 additions & 2 deletions butterfree/clients/cassandra_client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""CassandraClient entity."""

from ssl import CERT_REQUIRED, PROTOCOL_TLSv1
from typing import Dict, List, Optional
from typing import Dict, List, Optional, Union

from cassandra.auth import PlainTextAuthProvider
from cassandra.cluster import (
Expand All @@ -16,6 +16,12 @@
from typing_extensions import TypedDict

from butterfree.clients import AbstractClient
from butterfree.configs.logger import __logger

logger = __logger("cassandra_client")

EMPTY_STRING_HOST_ERROR = "The value of Cassandra host is empty. Please fill correctly with your endpoints" # noqa: E501
GENERIC_INVALID_HOST_ERROR = "The Cassandra host must be a valid string, a string that represents a list or list of strings" # noqa: E501


class CassandraColumn(TypedDict):
Expand Down Expand Up @@ -53,12 +59,48 @@ def __init__(
user: Optional[str] = None,
password: Optional[str] = None,
) -> None:
self.host = host
self.host = self._validate_and_format_cassandra_host(host)
logger.info(f"The host setted is {self.host}")
self.keyspace = keyspace
self.user = user
self.password = password
self._session: Optional[Session] = None

def _validate_and_format_cassandra_host(self, host: Union[List, str]):
"""
Validate and format the provided Cassandra host input.
This method checks if the input `host` is either a string, a list of strings, or
a list containing a single string with comma-separated values. It splits the string
by commas and trims whitespace, returning a list of hosts. If the input is already
a list of strings, it returns that list. If the input is empty or invalid, a
ValueError is raised.
Args:
host (str | list): The Cassandra host input, which can be a comma-separated
string or a list of string endpoints.
Returns:
list: A list of formatted Cassandra host strings.
Raises:
ValueError: If the input is an empty list/string or if it is not a string
(or a representation of a list) or a list of strings.
""" # noqa: E501
if isinstance(host, str):
if host:
return [item.strip() for item in host.split(",")]
else:
raise ValueError(EMPTY_STRING_HOST_ERROR)

if isinstance(host, list):
if len(host) == 1 and isinstance(host[0], str):
return [item.strip() for item in host[0].split(",")]
elif all(isinstance(item, str) for item in host):
return host

raise ValueError(GENERIC_INVALID_HOST_ERROR)

@property
def conn(self, *, ssl_path: str = None) -> Session: # type: ignore
"""Establishes a Cassandra connection."""
Expand Down
4 changes: 3 additions & 1 deletion butterfree/pipelines/feature_set_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,9 @@ def run(
num_processors=num_processors,
)

if dataframe.storageLevel != StorageLevel(False, False, False, False, 1):
if transformed_dataframe.storageLevel != StorageLevel(
False, False, False, False, 1
):
dataframe.unpersist() # Clear the data from the cache (disk and memory)

# Step 4: Load the data into the configured sink.
Expand Down
13 changes: 12 additions & 1 deletion docs/source/butterfree.dataframe_service.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,22 @@ butterfree.dataframe\_service.partitioning module
butterfree.dataframe\_service.repartition module
------------------------------------------------

.. automodule:: butterfree.dataframe_service.repartition
.. automodule:: butterfree.dataframe_service.incremental_strategy
:members:
:undoc-members:
:show-inheritance:

butterfree.dataframe\_service.partitioning module
-------------------------------------------------

.. automodule:: butterfree.dataframe_service.partitioning
:members:
:undoc-members:
:show-inheritance:

butterfree.dataframe\_service.repartition module
------------------------------------------------

.. automodule:: butterfree.dataframe_service.repartition
:members:
:undoc-members:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import find_packages, setup

__package_name__ = "butterfree"
__version__ = "1.4.4"
__version__ = "1.4.5"
__repository_url__ = "https://github.com/quintoandar/butterfree"

with open("requirements.txt") as f:
Expand Down
52 changes: 51 additions & 1 deletion tests/unit/butterfree/clients/test_cassandra_client.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
from typing import Any, Dict, List
from unittest.mock import MagicMock

import pytest

from butterfree.clients import CassandraClient
from butterfree.clients.cassandra_client import CassandraColumn
from butterfree.clients.cassandra_client import (
EMPTY_STRING_HOST_ERROR,
GENERIC_INVALID_HOST_ERROR,
CassandraColumn,
)


def sanitize_string(query: str) -> str:
Expand Down Expand Up @@ -86,3 +92,47 @@ def test_cassandra_create_table(
query = cassandra_client.sql.call_args[0][0]

assert sanitize_string(query) == sanitize_string(expected_query)

def test_initialize_with_string_host(self):
client = CassandraClient(host="127.0.0.0, 127.0.0.1", keyspace="dummy_keyspace")
assert client.host == ["127.0.0.0", "127.0.0.1"]

def test_initialize_with_list_host(self):
client = CassandraClient(
host=["127.0.0.0", "127.0.0.1"], keyspace="test_keyspace"
)
assert client.host == ["127.0.0.0", "127.0.0.1"]

def test_initialize_with_empty_string_host(self):
with pytest.raises(
ValueError,
match=EMPTY_STRING_HOST_ERROR,
):
CassandraClient(host="", keyspace="test_keyspace")

def test_initialize_with_none_host(self):
with pytest.raises(
ValueError,
match=GENERIC_INVALID_HOST_ERROR,
):
CassandraClient(host=None, keyspace="test_keyspace")

def test_initialize_with_invalid_host_type(self):
with pytest.raises(
ValueError,
match=GENERIC_INVALID_HOST_ERROR,
):
CassandraClient(host=123, keyspace="test_keyspace")

def test_initialize_with_invalid_list_host(self):
with pytest.raises(
ValueError,
match=GENERIC_INVALID_HOST_ERROR,
):
CassandraClient(host=["127.0.0.0", 123], keyspace="test_keyspace")

def test_initialize_with_list_of_string_hosts(self):
client = CassandraClient(
host=["127.0.0.0, 127.0.0.1"], keyspace="test_keyspace"
)
assert client.host == ["127.0.0.0", "127.0.0.1"]
Loading