Skip to content

Commit

Permalink
address duckdb replacement scans; release
Browse files Browse the repository at this point in the history
  • Loading branch information
liquidcarbon committed Nov 5, 2024
1 parent f9d8aa8 commit 4966133
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 0 additions & 1 deletion affinity.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,6 @@ def partition(self) -> Tuple[List[str], List[str]]:
partitions = []
for partition, data in _partitions_iter:
_path = self.LOCATION.path.format(*partition)
# paths.append((_path, self.__class__.build(dataframe=data)))
paths.append(_path)
partitions.append(self.__class__.build(dataframe=data))
return paths, partitions
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ readme = "README.md"
requires-python = ">=3.11"

dependencies = [
"duckdb>=1",
"pandas",
]

Expand Down
5 changes: 5 additions & 0 deletions test_affinity.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
from pathlib import Path

import duckdb
import numpy as np
import pandas as pd
import pytest

import affinity as af

# https://github.com/duckdb/duckdb/issues/14179
duckdb.sql("SET python_scan_all_frames=true")


def test_scalar():
s = af.ScalarObject("field comment")
Expand Down Expand Up @@ -142,6 +146,7 @@ class aDatasetVectorScalar(af.Dataset):
data1 = aDatasetVectorScalar(v1=list("abcdef"), v2=2, v3=range(6))
assert len(data1) == 6
assert data1.shape == (6, 3)
assert list(data1.v3)[-1] == 5.0
assert data1.data_dict == {"v1": "first", "v2": "second", "v3": "third"}
expected_dict = dict(v1=list("abcdef"), v2=2, v3=[0.0, 1.0, 2.0, 3.0, 4.0, 5.0])
assert data1.dict == expected_dict
Expand Down

0 comments on commit 4966133

Please sign in to comment.