-
Notifications
You must be signed in to change notification settings - Fork 242
Expand file tree
/
Copy pathprep_azure_test_data.py
More file actions
31 lines (26 loc) · 1.12 KB
/
prep_azure_test_data.py
File metadata and controls
31 lines (26 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import sys
import os
# We have to append user's current path to sys path so the modules can be resolved
# Otherwise we will got "no module named feathr" error
sys.path.append(os.path.abspath(os.getcwd()))
from feathrcli.cli import init
from click.testing import CliRunner
from feathr import FeathrClient
def initialize_data():
"""
Initialize the test data to Azure for testing.
WARNING: It will override the existing test data.
"""
print('Creating test data. This might override existing test data.')
client = FeathrClient()
# materialize feature to online store
client._materialize_features_with_config('feature_gen_conf/test_feature_gen_1.conf')
client._materialize_features_with_config('feature_gen_conf/test_feature_gen_2.conf')
client._materialize_features_with_config('feature_gen_conf/test_feature_gen_snowflake.conf')
print('Test data push job has started. It will take some time to complete.')
runner = CliRunner()
with runner.isolated_filesystem():
runner.invoke(init, [])
# Need to be in the workspace so it won't complain
os.chdir('feathr_user_workspace')
initialize_data()