add black to python CI (#178)

Closes #48
This commit is contained in:
Tevin Wang
2023-06-12 11:22:34 -07:00
committed by GitHub
parent 7bad676f30
commit 9b83ce3d2a
13 changed files with 86 additions and 51 deletions

View File

@@ -119,4 +119,4 @@ def test_delete_table(tmp_path):
assert db.table_names() == []
db.create_table("test", data=data)
assert db.table_names() == ["test"]
assert db.table_names() == ["test"]

View File

@@ -19,6 +19,7 @@ import lancedb
# You need to setup AWS credentials an a base path to run this test. Example
# AWS_PROFILE=default TEST_S3_BASE_URL=s3://my_bucket/dataset pytest tests/test_io.py
@pytest.mark.skipif(
(os.environ.get("TEST_S3_BASE_URL") is None),
reason="please setup s3 base url",

View File

@@ -30,12 +30,16 @@ class MockTable:
@pytest.fixture
def table(tmp_path) -> MockTable:
df = pa.table({
"vector": pa.array([[1, 2], [3, 4]], type=pa.list_(pa.float32(), list_size=2)),
"id": pa.array([1, 2]),
"str_field": pa.array(["a", "b"]),
"float_field": pa.array([1.0, 2.0]),
})
df = pa.table(
{
"vector": pa.array(
[[1, 2], [3, 4]], type=pa.list_(pa.float32(), list_size=2)
),
"id": pa.array([1, 2]),
"str_field": pa.array(["a", "b"]),
"float_field": pa.array([1.0, 2.0]),
}
)
lance.write_dataset(df, tmp_path)
return MockTable(tmp_path)