tencent-wedata-feature-engineering-dev 0.1.40__tar.gz → 0.1.42__tar.gz
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.
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/PKG-INFO +1 -1
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/tencent_wedata_feature_engineering_dev.egg-info/PKG-INFO +1 -1
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/constants/constants.py +1 -1
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/feast_client/feast_client.py +24 -18
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/feature_table_client/feature_table_client.py +6 -11
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/spark_client/spark_client.py +0 -1
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/utils/common_utils.py +0 -1
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/utils/env_utils.py +11 -1
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/README.md +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/setup.cfg +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/setup.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/tencent_wedata_feature_engineering_dev.egg-info/SOURCES.txt +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/tencent_wedata_feature_engineering_dev.egg-info/dependency_links.txt +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/tencent_wedata_feature_engineering_dev.egg-info/requires.txt +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/tencent_wedata_feature_engineering_dev.egg-info/top_level.txt +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/__init__.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/__init__.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/client.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/cloud_sdk_client/__init__.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/cloud_sdk_client/client.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/cloud_sdk_client/models.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/cloud_sdk_client/utils.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/common/__init__.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/common/protos/__init__.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/common/protos/feature_store_pb2.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/common/store_config/__init__.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/common/store_config/redis.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/constants/__init__.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/constants/engine_types.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/entities/__init__.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/entities/column_info.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/entities/environment_variables.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/entities/feature.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/entities/feature_column_info.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/entities/feature_function.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/entities/feature_lookup.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/entities/feature_spec.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/entities/feature_spec_constants.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/entities/feature_table.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/entities/feature_table_info.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/entities/function_info.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/entities/on_demand_column_info.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/entities/source_data_column_info.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/entities/training_set.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/feast_client/__init__.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/feature_table_client/__init__.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/mlflow_model.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/spark_client/__init__.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/training_set_client/__init__.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/training_set_client/training_set_client.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/utils/__init__.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/utils/feature_lookup_utils.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/utils/feature_spec_utils.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/utils/feature_utils.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/utils/on_demand_utils.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/utils/schema_utils.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/utils/signature_utils.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/utils/topological_sort.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/utils/training_set_utils.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/utils/uc_utils.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/feature_store/utils/validation_utils.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/tempo/__init__.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/tempo/interpol.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/tempo/intervals.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/tempo/io.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/tempo/ml.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/tempo/resample.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/tempo/tsdf.py +0 -0
- {tencent-wedata-feature-engineering-dev-0.1.40 → tencent-wedata-feature-engineering-dev-0.1.42}/wedata/tempo/utils.py +0 -0
|
@@ -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.42"
|
|
47
47
|
|
|
48
48
|
# 特征存储内部数据目录
|
|
49
49
|
FEATURE_STORE_INTERNAL_DATA_DIR = "_wedata_internal/"
|
|
@@ -7,7 +7,8 @@ Feast客户端,用于与Feast服务器交互
|
|
|
7
7
|
import json
|
|
8
8
|
import os
|
|
9
9
|
import re
|
|
10
|
-
from
|
|
10
|
+
from datetime import datetime
|
|
11
|
+
from typing import List, Dict, Optional, Any, Tuple
|
|
11
12
|
try:
|
|
12
13
|
# pyspark 3.5.0 以后
|
|
13
14
|
from pyspark.errors import IllegalArgumentException
|
|
@@ -97,6 +98,7 @@ class FeastClient:
|
|
|
97
98
|
tags=tags,
|
|
98
99
|
description=description
|
|
99
100
|
)
|
|
101
|
+
# 确保feature在增量服务时获取的数据时间范围时正确的。
|
|
100
102
|
self._apply_feature_view(table_name, entities, feature_view)
|
|
101
103
|
|
|
102
104
|
def _apply_feature_view(self, table_name, entities, feature_view: FeatureView):
|
|
@@ -160,11 +162,10 @@ class FeastClient:
|
|
|
160
162
|
raise ValueError(f"Table {table_name} not found in Feast")
|
|
161
163
|
|
|
162
164
|
if self._client.config.online_store.type == "redis":
|
|
163
|
-
print("redis table_view join_keys:", table_view.join_keys)
|
|
164
165
|
redis_online_store = RedisOnlineStore()
|
|
165
166
|
redis_online_store.delete_table(self._client.config, table_view)
|
|
166
167
|
table_view.online = False
|
|
167
|
-
table_view.
|
|
168
|
+
table_view.update_materialization_intervals(get_materialization_default_time())
|
|
168
169
|
self._client.apply(table_view)
|
|
169
170
|
else:
|
|
170
171
|
raise ValueError(f"Unsupported online store type: {self._client.config.online_store.type}")
|
|
@@ -361,6 +362,7 @@ def _create_table_to_feature_view(
|
|
|
361
362
|
source=resources,
|
|
362
363
|
)
|
|
363
364
|
feature_view.online = False
|
|
365
|
+
feature_view.update_materialization_intervals([(datetime(1990, 1, 1), datetime(1990, 1, 1))])
|
|
364
366
|
return feature_view
|
|
365
367
|
|
|
366
368
|
|
|
@@ -465,18 +467,22 @@ def translate_table_name_to_feast(table_name: str):
|
|
|
465
467
|
raise ValueError(f"Invalid table name: {table_name}")
|
|
466
468
|
|
|
467
469
|
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
470
|
+
def get_materialization_default_time() -> List[Tuple[datetime, datetime]]:
|
|
471
|
+
return [(datetime(1990, 1, 1), datetime(1990, 1, 1))]
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
# if __name__ == '__main__':
|
|
475
|
+
# import datetime
|
|
476
|
+
# FeastClient = FeastClient()
|
|
477
|
+
# FeastClient.client.registry.delete_data_source(name="xxxxx")
|
|
478
|
+
# FeastClient.client.registry.delete_entity("xxxxx", )
|
|
479
|
+
# FeastClient.client.registry.delete_feature_view()
|
|
480
|
+
# FeastClient.client.registry.get_feature_view()
|
|
481
|
+
# FeastClient.client.registry.delete_feature_service()
|
|
482
|
+
# FeastClient.client.get_historical_features()
|
|
483
|
+
# feature_view = FeastClient.client.get_feature_view(name="xxxxx")
|
|
484
|
+
# feature_view.source.get_table_query_string()
|
|
485
|
+
# feast_table_name = "xxx"
|
|
486
|
+
# from wedata.feature_store.utils.common_utils import build_full_table_name
|
|
487
|
+
# feast_table_name = translate_table_name_to_feast(build_full_table_name(table_name, database_name))
|
|
488
|
+
# FeastClient.client.materialize(start_date=datetime.datetime(2021,1,1), end_date=datetime.datetime.now(), feature_views=[feast_table_name])
|
|
@@ -881,27 +881,22 @@ class FeatureTableClient:
|
|
|
881
881
|
online_feature_config.DB = online_config.db
|
|
882
882
|
|
|
883
883
|
offline_feature_config = OfflineFeatureConfiguration()
|
|
884
|
-
offline_feature_config.DatabaseName =
|
|
885
|
-
"WEDATA_DEFAULT_FEATURE_STORE_DATABASE")
|
|
884
|
+
offline_feature_config.DatabaseName = env_utils.get_database_name(database_name)
|
|
886
885
|
offline_feature_config.TableName = table_name
|
|
887
886
|
|
|
888
887
|
offline_feature_config.PrimaryKeys, offline_feature_config.TimestampColumn = self._get_table_primary_keys_and_timestamp_key(
|
|
889
888
|
full_table_name)
|
|
890
889
|
|
|
891
890
|
offline_feature_config.DatasourceName = data_source_name
|
|
892
|
-
offline_feature_config.DatasourceType =
|
|
893
|
-
offline_feature_config.EngineName =
|
|
891
|
+
offline_feature_config.DatasourceType = env_utils.get_engine_type()
|
|
892
|
+
offline_feature_config.EngineName = env_utils.get_engine_name()
|
|
894
893
|
|
|
895
894
|
api_requests = CreateOnlineFeatureTableRequest()
|
|
896
895
|
api_requests.OfflineFeatureConfiguration = offline_feature_config
|
|
897
896
|
api_requests.OnlineFeatureConfiguration = online_feature_config
|
|
898
897
|
api_requests.TaskSchedulerConfiguration = cycle_obj
|
|
899
|
-
api_requests.ProjectId =
|
|
900
|
-
|
|
901
|
-
region = os.environ.get("DLC_REGION")
|
|
902
|
-
else:
|
|
903
|
-
region = os.environ.get("EMR_REGION")
|
|
904
|
-
|
|
898
|
+
api_requests.ProjectId = env_utils.get_project_id()
|
|
899
|
+
region = env_utils.get_region()
|
|
905
900
|
if not os.environ.get("RESOURCE_GROUP_ID", ""):
|
|
906
901
|
res_group_item = _get_default_resource_group(
|
|
907
902
|
api_requests.ProjectId, cloud_secret_id, cloud_secret_key, region)
|
|
@@ -962,7 +957,7 @@ def _refresh_table(project_id: str, secret_id: str, secret_key: str, region: str
|
|
|
962
957
|
request.DatasourceName = data_source_name
|
|
963
958
|
request.DatasourceType = data_source_type
|
|
964
959
|
request.EngineName = engine_name
|
|
965
|
-
request.
|
|
960
|
+
request.ActionName = action
|
|
966
961
|
request.IsTry = is_try
|
|
967
962
|
resp = client.RefreshFeatureTable(request)
|
|
968
963
|
return resp
|
|
@@ -348,5 +348,4 @@ def check_spark_table_exists(spark_client: SparkSession, full_table_name: str) -
|
|
|
348
348
|
query = f"SHOW TABLES IN {split[1]} LIKE '{split[2]}'"
|
|
349
349
|
else:
|
|
350
350
|
query = f"SHOW TABLES LIKE '{full_table_name}'"
|
|
351
|
-
logging.debug("check table sql: =======", query)
|
|
352
351
|
return spark_client.sql(query).count() > 0
|
|
@@ -72,9 +72,19 @@ def get_engine_name() -> str:
|
|
|
72
72
|
"""
|
|
73
73
|
获取引擎名称
|
|
74
74
|
"""
|
|
75
|
-
engine_name = os.environ.get("
|
|
75
|
+
engine_name = os.environ.get("KERNEL_ENGINE_NAME")
|
|
76
76
|
if engine_name:
|
|
77
77
|
return engine_name
|
|
78
|
+
raise EnvironmentError("environment variable KERNEL_ENGINE_NAME is not set, please check environment configuration")
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def get_engine_id() -> str:
|
|
82
|
+
"""
|
|
83
|
+
获取引擎ID
|
|
84
|
+
"""
|
|
85
|
+
engine_id = os.environ.get("KERNEL_ENGINE")
|
|
86
|
+
if engine_id:
|
|
87
|
+
return engine_id
|
|
78
88
|
raise EnvironmentError("environment variable KERNEL_ENGINE is not set, please check environment configuration")
|
|
79
89
|
|
|
80
90
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|