tencent-wedata-feature-engineering-dev 0.1.41__tar.gz → 0.1.43__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.

Potentially problematic release.


This version of tencent-wedata-feature-engineering-dev might be problematic. Click here for more details.

Files changed (69) hide show
  1. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/PKG-INFO +1 -1
  2. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/tencent_wedata_feature_engineering_dev.egg-info/PKG-INFO +1 -1
  3. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/constants/constants.py +1 -1
  4. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/feast_client/feast_client.py +27 -20
  5. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/feature_table_client/feature_table_client.py +5 -10
  6. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/spark_client/spark_client.py +0 -3
  7. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/utils/common_utils.py +0 -1
  8. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/utils/env_utils.py +25 -6
  9. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/README.md +0 -0
  10. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/setup.cfg +0 -0
  11. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/setup.py +0 -0
  12. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/tencent_wedata_feature_engineering_dev.egg-info/SOURCES.txt +0 -0
  13. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/tencent_wedata_feature_engineering_dev.egg-info/dependency_links.txt +0 -0
  14. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/tencent_wedata_feature_engineering_dev.egg-info/requires.txt +0 -0
  15. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/tencent_wedata_feature_engineering_dev.egg-info/top_level.txt +0 -0
  16. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/__init__.py +0 -0
  17. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/__init__.py +0 -0
  18. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/client.py +0 -0
  19. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/cloud_sdk_client/__init__.py +0 -0
  20. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/cloud_sdk_client/client.py +0 -0
  21. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/cloud_sdk_client/models.py +0 -0
  22. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/cloud_sdk_client/utils.py +0 -0
  23. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/common/__init__.py +0 -0
  24. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/common/protos/__init__.py +0 -0
  25. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/common/protos/feature_store_pb2.py +0 -0
  26. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/common/store_config/__init__.py +0 -0
  27. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/common/store_config/redis.py +0 -0
  28. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/constants/__init__.py +0 -0
  29. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/constants/engine_types.py +0 -0
  30. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/entities/__init__.py +0 -0
  31. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/entities/column_info.py +0 -0
  32. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/entities/environment_variables.py +0 -0
  33. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/entities/feature.py +0 -0
  34. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/entities/feature_column_info.py +0 -0
  35. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/entities/feature_function.py +0 -0
  36. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/entities/feature_lookup.py +0 -0
  37. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/entities/feature_spec.py +0 -0
  38. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/entities/feature_spec_constants.py +0 -0
  39. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/entities/feature_table.py +0 -0
  40. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/entities/feature_table_info.py +0 -0
  41. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/entities/function_info.py +0 -0
  42. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/entities/on_demand_column_info.py +0 -0
  43. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/entities/source_data_column_info.py +0 -0
  44. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/entities/training_set.py +0 -0
  45. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/feast_client/__init__.py +0 -0
  46. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/feature_table_client/__init__.py +0 -0
  47. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/mlflow_model.py +0 -0
  48. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/spark_client/__init__.py +0 -0
  49. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/training_set_client/__init__.py +0 -0
  50. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/training_set_client/training_set_client.py +0 -0
  51. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/utils/__init__.py +0 -0
  52. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/utils/feature_lookup_utils.py +0 -0
  53. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/utils/feature_spec_utils.py +0 -0
  54. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/utils/feature_utils.py +0 -0
  55. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/utils/on_demand_utils.py +0 -0
  56. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/utils/schema_utils.py +0 -0
  57. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/utils/signature_utils.py +0 -0
  58. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/utils/topological_sort.py +0 -0
  59. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/utils/training_set_utils.py +0 -0
  60. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/utils/uc_utils.py +0 -0
  61. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/feature_store/utils/validation_utils.py +0 -0
  62. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/tempo/__init__.py +0 -0
  63. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/tempo/interpol.py +0 -0
  64. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/tempo/intervals.py +0 -0
  65. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/tempo/io.py +0 -0
  66. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/tempo/ml.py +0 -0
  67. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/tempo/resample.py +0 -0
  68. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/tempo/tsdf.py +0 -0
  69. {tencent-wedata-feature-engineering-dev-0.1.41 → tencent-wedata-feature-engineering-dev-0.1.43}/wedata/tempo/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tencent-wedata-feature-engineering-dev
3
- Version: 0.1.41
3
+ Version: 0.1.43
4
4
  Summary: Wedata Feature Engineering Library Development
5
5
  Home-page:
6
6
  Author: meahqian
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tencent-wedata-feature-engineering-dev
3
- Version: 0.1.41
3
+ Version: 0.1.43
4
4
  Summary: Wedata Feature Engineering Library Development
5
5
  Home-page:
6
6
  Author: meahqian
@@ -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.41"
46
+ FEATURE_LOOKUP_CLIENT_MAJOR_VERSION = "0.1.43"
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 typing import List, Dict, Optional, Any
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
@@ -19,6 +20,7 @@ import pytz
19
20
  from feast import FeatureStore, RepoConfig, FeatureView
20
21
  from pyspark.sql import DataFrame, SparkSession
21
22
  from wedata.feature_store.common.store_config.redis import RedisStoreConfig
23
+ from wedata.feature_store.utils import env_utils
22
24
  from feast import Entity, FeatureService
23
25
  from feast.infra.offline_stores.contrib.spark_offline_store.spark_source import SparkSource
24
26
  from feast.infra.online_stores.redis import RedisOnlineStore
@@ -36,8 +38,8 @@ TEMP_FILE_PATH = "/tmp/feast_data/"
36
38
  class FeastClient:
37
39
 
38
40
  def __init__(self, offline_store: SparkSession, online_store_config: RedisStoreConfig = None):
39
- project_id = os.getenv("WEDATA_PROJECT_ID", "")
40
- remote_path = os.getenv("FEAST_REMOTE_ADDRESS", "")
41
+ project_id = env_utils.get_project_id()
42
+ remote_path = env_utils.get_feast_remote_url()
41
43
  if offline_store is None or not isinstance(offline_store, SparkSession):
42
44
  raise ValueError("offline_store must be provided SparkSession instance")
43
45
 
@@ -97,6 +99,7 @@ class FeastClient:
97
99
  tags=tags,
98
100
  description=description
99
101
  )
102
+ # 确保feature在增量服务时获取的数据时间范围时正确的。
100
103
  self._apply_feature_view(table_name, entities, feature_view)
101
104
 
102
105
  def _apply_feature_view(self, table_name, entities, feature_view: FeatureView):
@@ -160,11 +163,10 @@ class FeastClient:
160
163
  raise ValueError(f"Table {table_name} not found in Feast")
161
164
 
162
165
  if self._client.config.online_store.type == "redis":
163
- print("redis table_view join_keys:", table_view.join_keys)
164
166
  redis_online_store = RedisOnlineStore()
165
167
  redis_online_store.delete_table(self._client.config, table_view)
166
168
  table_view.online = False
167
- table_view.materialization_intervals = []
169
+ table_view.update_materialization_intervals(get_materialization_default_time())
168
170
  self._client.apply(table_view)
169
171
  else:
170
172
  raise ValueError(f"Unsupported online store type: {self._client.config.online_store.type}")
@@ -361,6 +363,7 @@ def _create_table_to_feature_view(
361
363
  source=resources,
362
364
  )
363
365
  feature_view.online = False
366
+ feature_view.update_materialization_intervals([(datetime(1990, 1, 1), datetime(1990, 1, 1))])
364
367
  return feature_view
365
368
 
366
369
 
@@ -465,18 +468,22 @@ def translate_table_name_to_feast(table_name: str):
465
468
  raise ValueError(f"Invalid table name: {table_name}")
466
469
 
467
470
 
468
- if __name__ == '__main__':
469
- import datetime
470
- FeastClient = FeastClient()
471
- FeastClient.client.registry.delete_data_source(name="xxxxx")
472
- FeastClient.client.registry.delete_entity("xxxxx", )
473
- FeastClient.client.registry.delete_feature_view()
474
- FeastClient.client.registry.get_feature_view()
475
- FeastClient.client.registry.delete_feature_service()
476
- FeastClient.client.get_historical_features()
477
- feature_view = FeastClient.client.get_feature_view(name="xxxxx")
478
- feature_view.source.get_table_query_string()
479
- feast_table_name = "xxx"
480
- from wedata.feature_store.utils.common_utils import build_full_table_name
481
- feast_table_name = translate_table_name_to_feast(build_full_table_name(table_name, database_name))
482
- FeastClient.client.materialize(start_date=datetime.datetime(2021,1,1), end_date=datetime.datetime.now(), feature_views=[feast_table_name])
471
+ def get_materialization_default_time() -> List[Tuple[datetime, datetime]]:
472
+ return [(datetime(1990, 1, 1), datetime(1990, 1, 1))]
473
+
474
+
475
+ # if __name__ == '__main__':
476
+ # import datetime
477
+ # FeastClient = FeastClient()
478
+ # FeastClient.client.registry.delete_data_source(name="xxxxx")
479
+ # FeastClient.client.registry.delete_entity("xxxxx", )
480
+ # FeastClient.client.registry.delete_feature_view()
481
+ # FeastClient.client.registry.get_feature_view()
482
+ # FeastClient.client.registry.delete_feature_service()
483
+ # FeastClient.client.get_historical_features()
484
+ # feature_view = FeastClient.client.get_feature_view(name="xxxxx")
485
+ # feature_view.source.get_table_query_string()
486
+ # feast_table_name = "xxx"
487
+ # from wedata.feature_store.utils.common_utils import build_full_table_name
488
+ # feast_table_name = translate_table_name_to_feast(build_full_table_name(table_name, database_name))
489
+ # 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 = database_name if database_name else os.environ.get(
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 = "DLC" if os.environ.get("DLC_REGION") else "EMR"
893
- offline_feature_config.EngineName = os.environ.get("KERNEL_ENGINE")
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 = os.environ.get("WEDATA_PROJECT_ID")
900
- if offline_feature_config.DatasourceType == "DLC":
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)
@@ -30,14 +30,12 @@ class SparkClient:
30
30
  str: 当前catalog名称,如果未设置则返回None
31
31
  """
32
32
  _, ok, _ = check_package_version("pyspark", "3.4.0", ">=")
33
- print(f"pyspark >= 3.4.0 {ok}")
34
33
  if ok:
35
34
  return unsanitize_identifier(self._spark.catalog.currentCatalog())
36
35
  else:
37
36
  catalog = self._spark.sql("SELECT current_catalog()").first()[0]
38
37
  return unsanitize_identifier(catalog)
39
38
 
40
-
41
39
  def get_current_database(self):
42
40
  """
43
41
  获取Spark上下文中当前设置的数据库名称
@@ -57,7 +55,6 @@ class SparkClient:
57
55
  def createDataFrame(self, data, schema) -> DataFrame:
58
56
  return self._spark.createDataFrame(data, schema)
59
57
 
60
-
61
58
  def read_table(self, table_name):
62
59
  """读取Spark表数据
63
60
 
@@ -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
@@ -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("EMR_REGION")
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 EMR_REGION is not set, "
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,10 +72,14 @@ def get_engine_name() -> str:
72
72
  """
73
73
  获取引擎名称
74
74
  """
75
- engine_name = os.environ.get("KERNEL_ENGINE")
76
- if engine_name:
77
- return engine_name
78
- raise EnvironmentError("environment variable KERNEL_ENGINE is not set, please check environment configuration")
75
+ return _get_variable("KERNEL_ENGINE_NAME")
76
+
77
+
78
+ def get_engine_id() -> str:
79
+ """
80
+ 获取引擎ID
81
+ """
82
+ return _get_variable("KERNEL_ENGINE")
79
83
 
80
84
 
81
85
  def get_engine_type() -> str:
@@ -84,3 +88,18 @@ def get_engine_type() -> str:
84
88
  """
85
89
  return "DLC" if os.environ.get("DLC_REGION") else "EMR"
86
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