Skip to content

Commit 8bbc155

Browse files
committed
fix lint
1 parent 0eb17ec commit 8bbc155

File tree

5 files changed

+17
-184
lines changed

5 files changed

+17
-184
lines changed

python/python/knowledge_graph/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
from pathlib import Path
77
from typing import Any, Mapping, Optional
88

9-
import yaml
109
import pyarrow.fs
10+
import yaml
1111
from lance_graph import GraphConfig
1212

1313

python/python/knowledge_graph/store.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ def __init__(self, config: "KnowledgeGraphConfig"):
3636
str(self._root), **(self.config.storage_options or {})
3737
)
3838
except ImportError:
39-
# Re-raise explicit ImportError if protocol driver (e.g. gcsfs, s3fs) is missing
39+
# Re-raise explicit ImportError if protocol driver (e.g. gcsfs, s3fs)
40+
# is missing
4041
raise
4142

4243
@property
@@ -55,7 +56,8 @@ def ensure_layout(self) -> None:
5556
self._fs.makedirs(self._fs_path, exist_ok=True)
5657
except Exception:
5758
# S3/GCS might not support directory creation or it might be implicit.
58-
# We treat failure here as non-fatal if the path is actually accessible later,
59+
# We treat failure here as non-fatal if the path is actually accessible
60+
# later,
5961
# but usually makedirs is safe on object stores (no-op).
6062
pass
6163

python/python/tests/test_gcs_integration.py

Lines changed: 0 additions & 174 deletions
This file was deleted.

python/python/tests/test_knowledge_graph_config.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import pyarrow as pa
2-
import pytest
31
from pathlib import Path
42
from unittest.mock import MagicMock, patch
5-
from knowledge_graph.config import build_graph_config_from_mapping, KnowledgeGraphConfig
3+
4+
import pyarrow as pa
5+
import pytest
6+
from knowledge_graph.config import KnowledgeGraphConfig, build_graph_config_from_mapping
67
from lance_graph import CypherQuery
78

89

@@ -89,7 +90,10 @@ def test_load_schema_payload_s3(self, mock_pyarrow):
8990

9091
# Mock filesystem
9192
mock_fs = MagicMock()
92-
mock_pyarrow.fs.FileSystem.from_uri.return_value = (mock_fs, "bucket/graph/graph.yaml")
93+
mock_pyarrow.fs.FileSystem.from_uri.return_value = (
94+
mock_fs,
95+
"bucket/graph/graph.yaml",
96+
)
9397

9498
# Mock file content
9599
mock_input_stream = MagicMock()
@@ -100,5 +104,7 @@ def test_load_schema_payload_s3(self, mock_pyarrow):
100104
payload = config._load_schema_payload()
101105

102106
assert payload == {"nodes": {"Person": "id"}}
103-
mock_pyarrow.fs.FileSystem.from_uri.assert_called_with("s3://bucket/graph/graph.yaml")
107+
mock_pyarrow.fs.FileSystem.from_uri.assert_called_with(
108+
"s3://bucket/graph/graph.yaml"
109+
)
104110
mock_fs.open_input_stream.assert_called_with("bucket/graph/graph.yaml")

python/python/tests/test_store.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,7 @@ class TestS3Support:
360360
@pytest.fixture
361361
def s3_config(self):
362362
return KnowledgeGraphConfig(
363-
storage_path="s3://bucket/graph",
364-
schema_path="s3://bucket/graph/graph.yaml"
363+
storage_path="s3://bucket/graph", schema_path="s3://bucket/graph/graph.yaml"
365364
)
366365

367366
@pytest.fixture

0 commit comments

Comments
 (0)