12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
+ import asyncio
15
16
import os
17
+ import shutil
16
18
import tempfile
17
19
import unittest
18
20
import warnings
19
21
from datetime import datetime , timedelta
20
22
from typing import Any
21
23
22
24
import pandas as pd
25
+ import pytest
23
26
24
27
from feast import (
25
28
Entity ,
@@ -205,8 +208,6 @@ def setUp(self):
205
208
self .store .apply ([driver , driver_stats_source , driver_stats_fv ])
206
209
207
210
def tearDown (self ):
208
- import shutil
209
-
210
211
shutil .rmtree (self .data_dir )
211
212
212
213
def test_empty_dataframe_warns (self ):
@@ -231,7 +232,6 @@ def test_empty_dataframe_warns(self):
231
232
232
233
def test_empty_dataframe_async_warns (self ):
233
234
"""Test that completely empty dataframe warns instead of raising error in async version"""
234
- import asyncio
235
235
236
236
async def test_async_empty ():
237
237
empty_df = pd .DataFrame ()
@@ -287,7 +287,6 @@ def test_dataframe_with_empty_feature_columns_warns(self):
287
287
288
288
def test_dataframe_with_empty_feature_columns_async_warns (self ):
289
289
"""Test that dataframe with entity data but empty feature columns warns instead of raising error in async version"""
290
- import asyncio
291
290
292
291
async def test_async_empty_features ():
293
292
current_time = pd .Timestamp .now ()
@@ -342,10 +341,6 @@ def test_valid_dataframe(self):
342
341
343
342
def test_valid_dataframe_async (self ):
344
343
"""Test that valid dataframe with feature data succeeds in async version"""
345
- import asyncio
346
-
347
- import pytest
348
-
349
344
pytest .skip ("Feature not implemented yet" )
350
345
351
346
async def test_async_valid ():
@@ -443,8 +438,6 @@ def test_inputs_dict_with_empty_features_warns(self):
443
438
444
439
def test_multiple_feature_views_materialization_with_empty_data (self ):
445
440
"""Test materializing multiple feature views where one has empty data - should not break materialization"""
446
- import tempfile
447
- from datetime import timedelta
448
441
449
442
with tempfile .TemporaryDirectory () as data_dir :
450
443
# Create a new store for this test
@@ -525,10 +518,10 @@ def test_multiple_feature_views_materialization_with_empty_data(self):
525
518
entity_key : pd .Series ([], dtype = "int64" ),
526
519
"event_timestamp" : pd .Series (
527
520
[], dtype = "datetime64[ns, UTC]"
528
- ), # ✅ Timezone-aware
521
+ ), # Timezone-aware
529
522
"created" : pd .Series (
530
523
[], dtype = "datetime64[ns, UTC]"
531
- ), # ✅ Timezone-aware
524
+ ), # Timezone-aware
532
525
f"feature_{ i + 1 } _rate" : pd .Series ([], dtype = "float32" ),
533
526
f"feature_{ i + 1 } _count" : pd .Series ([], dtype = "int64" ),
534
527
}
0 commit comments