Skip to content

Commit 9c3e9a2

Browse files
committed
lint ruff failures
1 parent 38f3311 commit 9c3e9a2

3 files changed

Lines changed: 9 additions & 10 deletions

File tree

src/datacustomcode/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
from datacustomcode.io.reader.query_api import QueryAPIDataCloudReader
1818
from datacustomcode.io.writer.print import PrintDataCloudWriter
1919

20-
__all__ = ["Client", "QueryAPIDataCloudReader", "PrintDataCloudWriter"]
20+
__all__ = ["Client", "PrintDataCloudWriter", "QueryAPIDataCloudReader"]

src/datacustomcode/config.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@
3636
# This lets all readers and writers to be findable via config
3737
from datacustomcode.io import * # noqa: F403
3838
from datacustomcode.io.base import BaseDataAccessLayer
39-
from datacustomcode.io.reader.base import BaseDataCloudReader # noqa: TCH001
40-
from datacustomcode.io.writer.base import BaseDataCloudWriter # noqa: TCH001
4139

4240
DEFAULT_CONFIG_NAME = "config.yaml"
4341

4442

4543
if TYPE_CHECKING:
4644
from pyspark.sql import SparkSession
45+
from datacustomcode.io.reader.base import BaseDataCloudReader
46+
from datacustomcode.io.writer.base import BaseDataCloudWriter
4747

4848

4949
class ForceableConfig(BaseModel):
@@ -72,7 +72,7 @@ class AccessLayerObjectConfig(ForceableConfig, Generic[_T]):
7272

7373
def to_object(self, spark: SparkSession) -> _T:
7474
type_ = self.type_base.subclass_from_config_name(self.type_config_name)
75-
return cast(_T, type_(spark=spark, **self.options))
75+
return cast("_T", type_(spark=spark, **self.options))
7676

7777

7878
class SparkConfig(ForceableConfig):
@@ -90,8 +90,8 @@ class SparkConfig(ForceableConfig):
9090

9191

9292
class ClientConfig(BaseModel):
93-
reader_config: Union[AccessLayerObjectConfig[BaseDataCloudReader], None] = None
94-
writer_config: Union[AccessLayerObjectConfig[BaseDataCloudWriter], None] = None
93+
reader_config: Union[AccessLayerObjectConfig["BaseDataCloudReader"], None] = None
94+
writer_config: Union[AccessLayerObjectConfig["BaseDataCloudWriter"], None] = None
9595
spark_config: Union[SparkConfig, None] = None
9696

9797
def update(self, other: ClientConfig) -> ClientConfig:

tests/test_deploy.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"""Tests for the deploy module."""
22

33
import shutil
4-
import sys
54
from unittest.mock import (
65
MagicMock,
76
call,
@@ -242,18 +241,18 @@ def test_prepare_dependency_archive_file_copy_failure(
242241
# Create a custom mock for shutil.copy that raises FileNotFoundError
243242
# only for the specific calls we want to test
244243
original_copy = shutil.copy
245-
244+
246245
def mock_copy(src, dst):
247246
if src == "requirements.txt" or src == "build_native_dependencies.sh":
248247
raise FileNotFoundError("File not found")
249248
return original_copy(src, dst)
250-
249+
251250
with patch("datacustomcode.deploy.shutil.copy", side_effect=mock_copy):
252251
# Call the function - it should catch the FileNotFoundError and call sys.exit(1)
253252
# We expect it to raise SystemExit (which is what sys.exit(1) does)
254253
with pytest.raises(SystemExit) as exc_info:
255254
prepare_dependency_archive("/test/dir")
256-
255+
257256
# Verify the exit code is 1
258257
assert exc_info.value.code == 1
259258

0 commit comments

Comments
 (0)