Skip to content

Commit

Permalink
fix windows test/paths
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-beedie committed Mar 3, 2024
1 parent 1a79ee2 commit 0803fea
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions py-polars/tests/unit/io/test_database_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,17 @@
from types import GeneratorType
from typing import TYPE_CHECKING, Any, NamedTuple

import pytest
from sqlalchemy import Integer, MetaData, Table, create_engine, func, select
from sqlalchemy.orm import sessionmaker
from sqlalchemy.sql.expression import cast as alchemy_cast

import polars as pl
import pytest
from polars.exceptions import UnsuitableSQLError
from polars.io.database import _ARROW_DRIVER_REGISTRY_
from polars.testing import assert_frame_equal
from sqlalchemy import Integer, MetaData, Table, create_engine, func, select
from sqlalchemy.orm import sessionmaker
from sqlalchemy.sql.expression import cast as alchemy_cast

if TYPE_CHECKING:
import pyarrow as pa

from polars.type_aliases import (
ConnectionOrCursor,
DbReadEngine,
Expand Down Expand Up @@ -643,17 +641,15 @@ def test_read_kuzu_graph_database(tmp_path: Path, io_files_path: Path) -> None:
if (kuzu_test_db := (tmp_path / "kuzu_test.db")).exists():
kuzu_test_db.unlink()

test_db = str(kuzu_test_db)
if sys.platform == "win32":
test_db = test_db.replace("\\", "/")
test_db = str(kuzu_test_db).replace("\\", "/")

db = kuzu.Database(test_db)
conn = kuzu.Connection(db)
conn.execute("CREATE NODE TABLE User(name STRING, age INT64, PRIMARY KEY (name))")
conn.execute("CREATE REL TABLE Follows(FROM User TO User, since INT64)")

users = io_files_path / "graph-data" / "user.csv"
follows = io_files_path / "graph-data" / "follows.csv"
users = str(io_files_path / "graph-data" / "user.csv").replace("\\", "/")
follows = str(io_files_path / "graph-data" / "follows.csv").replace("\\", "/")
conn.execute(f'COPY User FROM "{users}"')
conn.execute(f'COPY Follows FROM "{follows}"')

Expand Down

0 comments on commit 0803fea

Please sign in to comment.