Skip to content

Commit 00be0e4

Browse files
SAASMLOPS-1058-2 Reformat code
Signed-off-by: Alex Vinnik <alex.vinnik@sailpoint.com>
1 parent 4fb6a79 commit 00be0e4

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

sdk/python/feast/infra/offline_stores/snowflake.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,6 @@ def to_remote_storage(self) -> List[str]:
589589
native_export_path = self.export_path.replace("s3gov://", "s3://")
590590
return self._get_file_names_from_copy_into(cursor, native_export_path)
591591

592-
593592
def _get_file_names_from_copy_into(self, cursor, native_export_path) -> List[str]:
594593
file_name_column_index = [
595594
idx for idx, rm in enumerate(cursor.description) if rm.name == "FILE_NAME"

sdk/python/tests/unit/infra/offline_stores/test_snowflake.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
from unittest.mock import Mock, MagicMock, patch, ANY
2-
import pytest
1+
import re
2+
from unittest.mock import ANY, MagicMock, patch
33

4-
from feast.infra.online_stores.sqlite import SqliteOnlineStoreConfig
4+
import pytest
55

66
from feast.infra.offline_stores.snowflake import (
77
SnowflakeOfflineStoreConfig,
88
SnowflakeRetrievalJob,
99
)
10-
10+
from feast.infra.online_stores.sqlite import SqliteOnlineStoreConfig
1111
from feast.repo_config import RepoConfig
1212

13-
import re
1413

15-
@pytest.fixture(params=['s3','s3gov'])
14+
@pytest.fixture(params=["s3", "s3gov"])
1615
def retrieval_job(request):
1716
offline_store_config = SnowflakeOfflineStoreConfig(
1817
type="snowflake.offline",
@@ -44,10 +43,15 @@ def retrieval_job(request):
4443

4544
def test_to_remote_storage(retrieval_job):
4645
stored_files = ["just a path", "maybe another"]
47-
with patch.object(retrieval_job, "to_snowflake", return_value=None) as mock_to_snowflake, \
48-
patch.object(retrieval_job, "_get_file_names_from_copy_into", return_value=stored_files) as mock_get_file_names_from_copy:
49-
assert retrieval_job.to_remote_storage() == stored_files, "should return the list of files"
46+
with patch.object(
47+
retrieval_job, "to_snowflake", return_value=None
48+
) as mock_to_snowflake, patch.object(
49+
retrieval_job, "_get_file_names_from_copy_into", return_value=stored_files
50+
) as mock_get_file_names_from_copy:
51+
assert (
52+
retrieval_job.to_remote_storage() == stored_files
53+
), "should return the list of files"
5054
mock_to_snowflake.assert_called_once()
5155
mock_get_file_names_from_copy.assert_called_once_with(ANY, ANY)
5256
native_path = mock_get_file_names_from_copy.call_args[0][1]
53-
assert re.match(f"^s3://.*", native_path), "path should be s3://*"
57+
assert re.match("^s3://.*", native_path), "path should be s3://*"

0 commit comments

Comments
 (0)