tencent-wedata-feature-engineering-dev 0.1.42__py3-none-any.whl → 0.1.43__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of tencent-wedata-feature-engineering-dev might be problematic. Click here for more details.
- {tencent_wedata_feature_engineering_dev-0.1.42.dist-info → tencent_wedata_feature_engineering_dev-0.1.43.dist-info}/METADATA +1 -1
- {tencent_wedata_feature_engineering_dev-0.1.42.dist-info → tencent_wedata_feature_engineering_dev-0.1.43.dist-info}/RECORD +8 -8
- wedata/feature_store/constants/constants.py +1 -1
- wedata/feature_store/feast_client/feast_client.py +3 -2
- wedata/feature_store/spark_client/spark_client.py +0 -2
- wedata/feature_store/utils/env_utils.py +19 -10
- {tencent_wedata_feature_engineering_dev-0.1.42.dist-info → tencent_wedata_feature_engineering_dev-0.1.43.dist-info}/WHEEL +0 -0
- {tencent_wedata_feature_engineering_dev-0.1.42.dist-info → tencent_wedata_feature_engineering_dev-0.1.43.dist-info}/top_level.txt +0 -0
|
@@ -12,7 +12,7 @@ wedata/feature_store/common/protos/feature_store_pb2.py,sha256=oMIUGGeGNP84g_nFq
|
|
|
12
12
|
wedata/feature_store/common/store_config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
13
|
wedata/feature_store/common/store_config/redis.py,sha256=9R5npM2s1u0o9IakmpbRsFdJC0vNar_uvA62OLWuXBs,1145
|
|
14
14
|
wedata/feature_store/constants/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
|
-
wedata/feature_store/constants/constants.py,sha256=
|
|
15
|
+
wedata/feature_store/constants/constants.py,sha256=QX8I8g_DApln3vbdLMpP7IhlyYo0ZwnGve1RNX5CY6w,1959
|
|
16
16
|
wedata/feature_store/constants/engine_types.py,sha256=42mI-kNDDtoA4_I3iqDe4FkF2M2l_Bt4Q1V6WUB-_k0,921
|
|
17
17
|
wedata/feature_store/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
18
|
wedata/feature_store/entities/column_info.py,sha256=-AR6EKHwgoqIkRHFyguxVEtnYt6fvusWHkEjF4kvS0A,5141
|
|
@@ -30,16 +30,16 @@ wedata/feature_store/entities/on_demand_column_info.py,sha256=a44ep-f3FOruWNXl3c
|
|
|
30
30
|
wedata/feature_store/entities/source_data_column_info.py,sha256=FyBmBPUSvc2S2OPFTvsQf2AdS-KFGkYBmd4yL_Vur8M,702
|
|
31
31
|
wedata/feature_store/entities/training_set.py,sha256=ylt1h6Z_xU8hKYvnvd80CeewTGSN68-_kvFpoliwH7s,5679
|
|
32
32
|
wedata/feature_store/feast_client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
|
-
wedata/feature_store/feast_client/feast_client.py,sha256=
|
|
33
|
+
wedata/feature_store/feast_client/feast_client.py,sha256=ZjhOHlY99pkgPJXIxYzezK4c2hEYxz9FURYtVcyEIj8,20730
|
|
34
34
|
wedata/feature_store/feature_table_client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
35
35
|
wedata/feature_store/feature_table_client/feature_table_client.py,sha256=wLawB-97ZJ4og5Y8f0VfRYsuygXY6DzMeorTTzdA9mM,41176
|
|
36
36
|
wedata/feature_store/spark_client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
37
|
-
wedata/feature_store/spark_client/spark_client.py,sha256=
|
|
37
|
+
wedata/feature_store/spark_client/spark_client.py,sha256=aTenEqfZoJYMrph98qjNHZ-H4dgNKnMaH14st8bCVRQ,11797
|
|
38
38
|
wedata/feature_store/training_set_client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
39
39
|
wedata/feature_store/training_set_client/training_set_client.py,sha256=teaWM-xDgp2TwnadovUm0i4A26roTozgRefIZaHORko,23376
|
|
40
40
|
wedata/feature_store/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
41
41
|
wedata/feature_store/utils/common_utils.py,sha256=vkpoXxZTd6S-2MgdyTQZ6P_ckdqNSK50ECuVBG2BwfI,12314
|
|
42
|
-
wedata/feature_store/utils/env_utils.py,sha256=
|
|
42
|
+
wedata/feature_store/utils/env_utils.py,sha256=kMCl6gyqDxjN5IZ7-wZMR0R4YY-Evh_7NHxugSYPWQc,2736
|
|
43
43
|
wedata/feature_store/utils/feature_lookup_utils.py,sha256=mNV6RhBdpv1iTZduCA9YwXwkeJCwU5MFQ1MkFeD9IhY,22003
|
|
44
44
|
wedata/feature_store/utils/feature_spec_utils.py,sha256=j8t-zel2_r8Q9m88BmFKkHMdkGNIduWJB-28OZDASRY,11613
|
|
45
45
|
wedata/feature_store/utils/feature_utils.py,sha256=KKq28bVB_lCuhnR9Hk6JegJBOVgcelWlvrRM-F9onkA,2796
|
|
@@ -58,7 +58,7 @@ wedata/tempo/ml.py,sha256=WtGa2szn6PditvZsTZoxo7wFDe4k1SRoMZ-jgNGIjvE,4323
|
|
|
58
58
|
wedata/tempo/resample.py,sha256=h81RVVmCl4ect-YKE-KZZHPDi1rGI3sh-YIb-Btz0ck,9698
|
|
59
59
|
wedata/tempo/tsdf.py,sha256=S4lZfxhSRFiezYoYS6gvGsl1mZA3zp-MWEKFHYZpDg0,70968
|
|
60
60
|
wedata/tempo/utils.py,sha256=I9I6l2DMwUoY213L04Yc1UR_zTWgSkj1BVo4ZwzQd4Y,7977
|
|
61
|
-
tencent_wedata_feature_engineering_dev-0.1.
|
|
62
|
-
tencent_wedata_feature_engineering_dev-0.1.
|
|
63
|
-
tencent_wedata_feature_engineering_dev-0.1.
|
|
64
|
-
tencent_wedata_feature_engineering_dev-0.1.
|
|
61
|
+
tencent_wedata_feature_engineering_dev-0.1.43.dist-info/METADATA,sha256=kO9LqVAfns7FFPTPlhPt3cdnd6IIROvXEiMglhFKVp4,582
|
|
62
|
+
tencent_wedata_feature_engineering_dev-0.1.43.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
63
|
+
tencent_wedata_feature_engineering_dev-0.1.43.dist-info/top_level.txt,sha256=Xa0v1rh__RvfVTVDirW5r5UBKg7ZO_iuTeXfp8MNo2A,7
|
|
64
|
+
tencent_wedata_feature_engineering_dev-0.1.43.dist-info/RECORD,,
|
|
@@ -43,7 +43,7 @@ ML_MODEL = "MLmodel"
|
|
|
43
43
|
FEATURE_LOOKUP_CLIENT_PIP_PACKAGE = "tencent-wedata-feature-engineering-dev"
|
|
44
44
|
|
|
45
45
|
# 特征查找版本号
|
|
46
|
-
FEATURE_LOOKUP_CLIENT_MAJOR_VERSION = "0.1.
|
|
46
|
+
FEATURE_LOOKUP_CLIENT_MAJOR_VERSION = "0.1.43"
|
|
47
47
|
|
|
48
48
|
# 特征存储内部数据目录
|
|
49
49
|
FEATURE_STORE_INTERNAL_DATA_DIR = "_wedata_internal/"
|
|
@@ -20,6 +20,7 @@ import pytz
|
|
|
20
20
|
from feast import FeatureStore, RepoConfig, FeatureView
|
|
21
21
|
from pyspark.sql import DataFrame, SparkSession
|
|
22
22
|
from wedata.feature_store.common.store_config.redis import RedisStoreConfig
|
|
23
|
+
from wedata.feature_store.utils import env_utils
|
|
23
24
|
from feast import Entity, FeatureService
|
|
24
25
|
from feast.infra.offline_stores.contrib.spark_offline_store.spark_source import SparkSource
|
|
25
26
|
from feast.infra.online_stores.redis import RedisOnlineStore
|
|
@@ -37,8 +38,8 @@ TEMP_FILE_PATH = "/tmp/feast_data/"
|
|
|
37
38
|
class FeastClient:
|
|
38
39
|
|
|
39
40
|
def __init__(self, offline_store: SparkSession, online_store_config: RedisStoreConfig = None):
|
|
40
|
-
project_id =
|
|
41
|
-
remote_path =
|
|
41
|
+
project_id = env_utils.get_project_id()
|
|
42
|
+
remote_path = env_utils.get_feast_remote_url()
|
|
42
43
|
if offline_store is None or not isinstance(offline_store, SparkSession):
|
|
43
44
|
raise ValueError("offline_store must be provided SparkSession instance")
|
|
44
45
|
|
|
@@ -36,7 +36,6 @@ class SparkClient:
|
|
|
36
36
|
catalog = self._spark.sql("SELECT current_catalog()").first()[0]
|
|
37
37
|
return unsanitize_identifier(catalog)
|
|
38
38
|
|
|
39
|
-
|
|
40
39
|
def get_current_database(self):
|
|
41
40
|
"""
|
|
42
41
|
获取Spark上下文中当前设置的数据库名称
|
|
@@ -56,7 +55,6 @@ class SparkClient:
|
|
|
56
55
|
def createDataFrame(self, data, schema) -> DataFrame:
|
|
57
56
|
return self._spark.createDataFrame(data, schema)
|
|
58
57
|
|
|
59
|
-
|
|
60
58
|
def read_table(self, table_name):
|
|
61
59
|
"""读取Spark表数据
|
|
62
60
|
|
|
@@ -38,10 +38,10 @@ def get_region() -> str:
|
|
|
38
38
|
获取当前地域
|
|
39
39
|
"""
|
|
40
40
|
region_dlc = os.environ.get("DLC_REGION")
|
|
41
|
-
region_emr = os.environ.get("
|
|
41
|
+
region_emr = os.environ.get("KERNEL_REGION")
|
|
42
42
|
region = region_dlc if region_dlc else region_emr
|
|
43
43
|
if not region:
|
|
44
|
-
raise EnvironmentError("environment variable DLC_REGION or
|
|
44
|
+
raise EnvironmentError("environment variable DLC_REGION or KERNEL_REGION is not set, "
|
|
45
45
|
"please check environment configuration")
|
|
46
46
|
return region
|
|
47
47
|
|
|
@@ -72,20 +72,14 @@ def get_engine_name() -> str:
|
|
|
72
72
|
"""
|
|
73
73
|
获取引擎名称
|
|
74
74
|
"""
|
|
75
|
-
|
|
76
|
-
if engine_name:
|
|
77
|
-
return engine_name
|
|
78
|
-
raise EnvironmentError("environment variable KERNEL_ENGINE_NAME is not set, please check environment configuration")
|
|
75
|
+
return _get_variable("KERNEL_ENGINE_NAME")
|
|
79
76
|
|
|
80
77
|
|
|
81
78
|
def get_engine_id() -> str:
|
|
82
79
|
"""
|
|
83
80
|
获取引擎ID
|
|
84
81
|
"""
|
|
85
|
-
|
|
86
|
-
if engine_id:
|
|
87
|
-
return engine_id
|
|
88
|
-
raise EnvironmentError("environment variable KERNEL_ENGINE is not set, please check environment configuration")
|
|
82
|
+
return _get_variable("KERNEL_ENGINE")
|
|
89
83
|
|
|
90
84
|
|
|
91
85
|
def get_engine_type() -> str:
|
|
@@ -94,3 +88,18 @@ def get_engine_type() -> str:
|
|
|
94
88
|
"""
|
|
95
89
|
return "DLC" if os.environ.get("DLC_REGION") else "EMR"
|
|
96
90
|
|
|
91
|
+
|
|
92
|
+
def get_feast_remote_url() -> str:
|
|
93
|
+
"""
|
|
94
|
+
获取Feast远程URL
|
|
95
|
+
"""
|
|
96
|
+
return _get_variable("KERNEL_FEAST_REMOTE_ADDRESS")
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def _get_variable(variable_key: str, is_raise: bool = True, default_value: str = None) -> str:
|
|
100
|
+
val = os.environ.get(variable_key, default_value)
|
|
101
|
+
if not val:
|
|
102
|
+
if is_raise:
|
|
103
|
+
raise EnvironmentError(f"environment variable {variable_key} is not set, "
|
|
104
|
+
f"please check environment configuration")
|
|
105
|
+
return val
|
|
File without changes
|