tencent-wedata-feature-engineering-dev 0.1.42__py3-none-any.whl → 0.2.5__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.
- {tencent_wedata_feature_engineering_dev-0.1.42.dist-info → tencent_wedata_feature_engineering_dev-0.2.5.dist-info}/METADATA +14 -3
- tencent_wedata_feature_engineering_dev-0.2.5.dist-info/RECORD +78 -0
- {tencent_wedata_feature_engineering_dev-0.1.42.dist-info → tencent_wedata_feature_engineering_dev-0.2.5.dist-info}/WHEEL +1 -1
- wedata/__init__.py +1 -1
- wedata/common/base_table_client/__init__.py +1 -0
- wedata/common/base_table_client/base.py +58 -0
- wedata/common/cloud_sdk_client/__init__.py +2 -0
- wedata/{feature_store → common}/cloud_sdk_client/client.py +56 -12
- wedata/{feature_store → common}/cloud_sdk_client/models.py +212 -37
- wedata/{feature_store → common}/cloud_sdk_client/utils.py +14 -0
- wedata/{feature_store → common}/constants/constants.py +3 -2
- wedata/common/constants/engine_types.py +34 -0
- wedata/{feature_store → common}/entities/column_info.py +6 -5
- wedata/{feature_store → common}/entities/feature_column_info.py +2 -1
- wedata/{feature_store → common}/entities/feature_lookup.py +1 -1
- wedata/{feature_store → common}/entities/feature_spec.py +9 -9
- wedata/{feature_store → common}/entities/feature_table_info.py +1 -1
- wedata/{feature_store → common}/entities/function_info.py +2 -1
- wedata/{feature_store → common}/entities/on_demand_column_info.py +2 -1
- wedata/{feature_store → common}/entities/source_data_column_info.py +3 -1
- wedata/{feature_store → common}/entities/training_set.py +6 -6
- wedata/common/feast_client/__init__.py +1 -0
- wedata/{feature_store → common}/feast_client/feast_client.py +3 -4
- wedata/common/log/__init__.py +1 -0
- wedata/common/log/logger.py +44 -0
- wedata/common/spark_client/__init__.py +1 -0
- wedata/{feature_store → common}/spark_client/spark_client.py +6 -9
- wedata/{feature_store → common}/utils/common_utils.py +7 -9
- wedata/{feature_store → common}/utils/env_utils.py +31 -10
- wedata/{feature_store → common}/utils/feature_lookup_utils.py +6 -6
- wedata/{feature_store → common}/utils/feature_spec_utils.py +13 -8
- wedata/{feature_store → common}/utils/feature_utils.py +5 -5
- wedata/{feature_store → common}/utils/on_demand_utils.py +5 -4
- wedata/{feature_store → common}/utils/schema_utils.py +1 -1
- wedata/{feature_store → common}/utils/signature_utils.py +4 -4
- wedata/{feature_store → common}/utils/training_set_utils.py +13 -13
- wedata/{feature_store → common}/utils/uc_utils.py +1 -1
- wedata/feature_engineering/__init__.py +1 -0
- wedata/feature_engineering/client.py +417 -0
- wedata/feature_engineering/ml_training_client/ml_training_client.py +569 -0
- wedata/feature_engineering/mlflow_model.py +9 -0
- wedata/feature_engineering/table_client/__init__.py +0 -0
- wedata/feature_engineering/table_client/table_client.py +548 -0
- wedata/feature_store/client.py +13 -16
- wedata/feature_store/constants/engine_types.py +8 -30
- wedata/feature_store/feature_table_client/feature_table_client.py +98 -108
- wedata/feature_store/training_set_client/training_set_client.py +14 -17
- wedata/tempo/interpol.py +2 -2
- tencent_wedata_feature_engineering_dev-0.1.42.dist-info/RECORD +0 -64
- {tencent_wedata_feature_engineering_dev-0.1.42.dist-info → tencent_wedata_feature_engineering_dev-0.2.5.dist-info}/top_level.txt +0 -0
- /wedata/{feature_store/cloud_sdk_client → common}/__init__.py +0 -0
- /wedata/{feature_store/common/protos → common/constants}/__init__.py +0 -0
- /wedata/{feature_store → common}/entities/__init__.py +0 -0
- /wedata/{feature_store → common}/entities/environment_variables.py +0 -0
- /wedata/{feature_store → common}/entities/feature.py +0 -0
- /wedata/{feature_store → common}/entities/feature_function.py +0 -0
- /wedata/{feature_store → common}/entities/feature_spec_constants.py +0 -0
- /wedata/{feature_store → common}/entities/feature_table.py +0 -0
- /wedata/{feature_store/feast_client → common/protos}/__init__.py +0 -0
- /wedata/{feature_store/common → common}/protos/feature_store_pb2.py +0 -0
- /wedata/{feature_store/spark_client → common/utils}/__init__.py +0 -0
- /wedata/{feature_store → common}/utils/topological_sort.py +0 -0
- /wedata/{feature_store → common}/utils/validation_utils.py +0 -0
- /wedata/{feature_store/utils → feature_engineering/ml_training_client}/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: tencent-wedata-feature-engineering-dev
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.5
|
|
4
4
|
Summary: Wedata Feature Engineering Library Development
|
|
5
5
|
Home-page:
|
|
6
6
|
Author: meahqian
|
|
@@ -16,4 +16,15 @@ Requires-Dist: feast[redis]==0.49.0
|
|
|
16
16
|
Requires-Dist: grpcio==1.74.0
|
|
17
17
|
Requires-Dist: tencentcloud-sdk-python
|
|
18
18
|
Requires-Dist: ipython
|
|
19
|
-
|
|
19
|
+
Provides-Extra: mlflow2
|
|
20
|
+
Requires-Dist: mlflow==2.17.2; extra == "mlflow2"
|
|
21
|
+
Provides-Extra: mlflow3
|
|
22
|
+
Requires-Dist: mlflow==3.1.0; extra == "mlflow3"
|
|
23
|
+
Dynamic: author
|
|
24
|
+
Dynamic: classifier
|
|
25
|
+
Dynamic: description-content-type
|
|
26
|
+
Dynamic: license
|
|
27
|
+
Dynamic: provides-extra
|
|
28
|
+
Dynamic: requires-dist
|
|
29
|
+
Dynamic: requires-python
|
|
30
|
+
Dynamic: summary
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
wedata/__init__.py,sha256=ePMhAZ8RA5tsYsAgEx6AfqwTVOhVyCUZdbcYeSfkxzI,193
|
|
2
|
+
wedata/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
+
wedata/common/base_table_client/__init__.py,sha256=tU9of0UpOU7bpzLo0tZH3E57kMon18KzBePyuAJeUfo,42
|
|
4
|
+
wedata/common/base_table_client/base.py,sha256=dtgfwj7_C-zy16KJRWk0h8z1bPn2s3IkQl8qXQ_l3l4,2264
|
|
5
|
+
wedata/common/cloud_sdk_client/__init__.py,sha256=GMwirZTY8XXRS6Z692J3MpowM4wUnIrfI2L-0tohhGc,56
|
|
6
|
+
wedata/common/cloud_sdk_client/client.py,sha256=M3LnPRsLgJkvbSVnDOyHt2i9pS1NQzsD5VTqKZDAgaM,6262
|
|
7
|
+
wedata/common/cloud_sdk_client/models.py,sha256=3BqbMSxaIqjhY1uJAPghHPa70sMG7TsucuHi2_kTf2E,24849
|
|
8
|
+
wedata/common/cloud_sdk_client/utils.py,sha256=vffI9rAGkW12dX7IN-QUmIIG865_WY75GtKJgVF6aho,1098
|
|
9
|
+
wedata/common/constants/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
+
wedata/common/constants/constants.py,sha256=c8AezQzGDG2OoLjbNHRKzUROYEM8_7eBpQupjUquv2g,2033
|
|
11
|
+
wedata/common/constants/engine_types.py,sha256=42mI-kNDDtoA4_I3iqDe4FkF2M2l_Bt4Q1V6WUB-_k0,921
|
|
12
|
+
wedata/common/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
+
wedata/common/entities/column_info.py,sha256=xPqvcMZVEvoGKA6ngIvzUDMkEo3l7G9-mUovw1GAfcw,5100
|
|
14
|
+
wedata/common/entities/environment_variables.py,sha256=ZEFml5H9MQuzBKM074mUrFYu-Sga4Knmxqiwpke2WGc,1679
|
|
15
|
+
wedata/common/entities/feature.py,sha256=wX8fTBlJq3GYdj9rrBDCY3kFgcVBBAiOOZdxEhnQkNQ,1241
|
|
16
|
+
wedata/common/entities/feature_column_info.py,sha256=GD5tlguntg0h0GLRdfeiZX4v06ELo6igB3bqwa4pd0Y,2394
|
|
17
|
+
wedata/common/entities/feature_function.py,sha256=R17INrCE-U_Uj9KLbFz69aYlOkTETTwQHMMo470F4lQ,1865
|
|
18
|
+
wedata/common/entities/feature_lookup.py,sha256=JfjWqWbW8C62FNlW4rHP5Hg0JKEZrl_gq74xE-gTLAk,8742
|
|
19
|
+
wedata/common/entities/feature_spec.py,sha256=OBXE1fvSWrkaaVf4Il8sQR7j8PG8DNw5z32XQO9G2jo,21699
|
|
20
|
+
wedata/common/entities/feature_spec_constants.py,sha256=YWDBfRiNDe6fUJFUBo3V4WYg2xsljoPAE-ZejfFZCgM,785
|
|
21
|
+
wedata/common/entities/feature_table.py,sha256=nHCCd7WUryROt9oTJpYkT-KiGbKcQd7BEE9L2_1dhYw,4107
|
|
22
|
+
wedata/common/entities/feature_table_info.py,sha256=5-iQ6f3TyF99jYhDi8PM9zOuWwgd8erhfN8iGChPBjM,1467
|
|
23
|
+
wedata/common/entities/function_info.py,sha256=MoT7Gs_Gm1vWKIW63ulSVQB-fbByXcKdzZqwp6xznU4,2739
|
|
24
|
+
wedata/common/entities/on_demand_column_info.py,sha256=JBwE3ST0cQAgrSnyhheDy1Kr2kXYezlS_4AyBFAJ340,1726
|
|
25
|
+
wedata/common/entities/source_data_column_info.py,sha256=40CSvROvkbls8m4cH6W8hsMoIZBw9sMdFHcRyWlRaWc,690
|
|
26
|
+
wedata/common/entities/training_set.py,sha256=espNtPJK6Y8YnNt0mcC1R9IHeYrzgliOI_bpfTE6eFU,5637
|
|
27
|
+
wedata/common/feast_client/__init__.py,sha256=ySxRfiUT3dhDThvJ4bGf-ukPlHQRUGJR-HcngKDViII,37
|
|
28
|
+
wedata/common/feast_client/feast_client.py,sha256=iohZmfm9fn0leZEIWjWY-xf33OFzaYQ2FtKqqOh4zIY,20721
|
|
29
|
+
wedata/common/log/__init__.py,sha256=M52flPoGWHFCuJiCstFiRKBmkO2ScDYXxuSpEcoi2Jo,30
|
|
30
|
+
wedata/common/log/logger.py,sha256=jwTecUnTrR6LL5ocCzTuuPLqW2swjEf4HZSFHTEY5Fc,1287
|
|
31
|
+
wedata/common/protos/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
32
|
+
wedata/common/protos/feature_store_pb2.py,sha256=oMIUGGeGNP84g_nFqOQwTXjV1GiU2ehSOy7CyFu2__g,4207
|
|
33
|
+
wedata/common/spark_client/__init__.py,sha256=r9GycVT64kqayl4yU_gYJC2Zbq2EwM7yi-_NiIIPMCA,37
|
|
34
|
+
wedata/common/spark_client/spark_client.py,sha256=hsOKpYXUP-1u6axulJ-HQV2_6Jn82AScjKRdAsEqyKM,11741
|
|
35
|
+
wedata/common/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
36
|
+
wedata/common/utils/common_utils.py,sha256=PDl-4ZKo9RKslUpEoUjMl9cN0Sy4nwS34hz9zyXMa7o,12278
|
|
37
|
+
wedata/common/utils/env_utils.py,sha256=Zj6569qDZR5fhfpKimOzwasaVT04q2c3BIUy5Uctv2g,3160
|
|
38
|
+
wedata/common/utils/feature_lookup_utils.py,sha256=usR6u1MJtlQrX5zTi98cZ1deFjVHzOhHyJtX4LGjF8k,21961
|
|
39
|
+
wedata/common/utils/feature_spec_utils.py,sha256=msH1dw7AvyRKpBhQo6OucxrUMPanLR72QEpH7cmYldQ,11723
|
|
40
|
+
wedata/common/utils/feature_utils.py,sha256=4qKouP5y-pkIQd5W0SYREw0EgDeZmANJdsT_epAlDYQ,2748
|
|
41
|
+
wedata/common/utils/on_demand_utils.py,sha256=3Dy0KjQYteH-tgGar1pssMcGojPOQeXTW8cPm_u-BFk,4263
|
|
42
|
+
wedata/common/utils/schema_utils.py,sha256=e3nLQKsJv9cEWDTWWE1qKbuzp_BMyrlas7KBcnzIxd4,4484
|
|
43
|
+
wedata/common/utils/signature_utils.py,sha256=F_f9n1W600CcFB17KVGZ1urMwbm4U8V-0a0FQIBmFIQ,7745
|
|
44
|
+
wedata/common/utils/topological_sort.py,sha256=ebzKxmxeCLk9seB1zR0ASCGXsZsa-DjxJeTc4KUadtg,6475
|
|
45
|
+
wedata/common/utils/training_set_utils.py,sha256=SHIy-UZdY9nFvAtKtkY8nPmk799yVWoSOoMEKOvqAN4,22389
|
|
46
|
+
wedata/common/utils/uc_utils.py,sha256=TTv00jv3eFmxrseCYe06XRfUkyxswDVmgMVxj-b6lSM,11429
|
|
47
|
+
wedata/common/utils/validation_utils.py,sha256=lJe6HCg5v5CZxH_pvT-vpGhCpo66LT2erXraHE2T0iI,2584
|
|
48
|
+
wedata/feature_engineering/__init__.py,sha256=knPPDKqnmHa1StaHPPAW1TjWMxbiASo4vRYp7hT-pfg,45
|
|
49
|
+
wedata/feature_engineering/client.py,sha256=ux8iTuv0SMEJmP5_a4Id8PKEfXtBttWgpOrTo8hgXko,15635
|
|
50
|
+
wedata/feature_engineering/mlflow_model.py,sha256=0_8Z0iJjE2J4LukgbucYqV0TRuyLfdAHatEgciyseBQ,232
|
|
51
|
+
wedata/feature_engineering/ml_training_client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
52
|
+
wedata/feature_engineering/ml_training_client/ml_training_client.py,sha256=j_sdUzz-mocWBr0Wpv8GWVLB5xYnrFXXXznIELr2ukk,23039
|
|
53
|
+
wedata/feature_engineering/table_client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
54
|
+
wedata/feature_engineering/table_client/table_client.py,sha256=KwFkeiTiYciOGixyJHbPTy896DHZ0UY-iulYpcxj70c,20082
|
|
55
|
+
wedata/feature_store/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
56
|
+
wedata/feature_store/client.py,sha256=czlBFs4gQbE4xj6lVY33XWnamPoePUH6WOUyxyr8kaA,19114
|
|
57
|
+
wedata/feature_store/mlflow_model.py,sha256=OCUuccOoO0NXWSzIPoGeL03Ha1Q3aQTJW2RlJrTCmzc,554
|
|
58
|
+
wedata/feature_store/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
59
|
+
wedata/feature_store/common/store_config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
60
|
+
wedata/feature_store/common/store_config/redis.py,sha256=9R5npM2s1u0o9IakmpbRsFdJC0vNar_uvA62OLWuXBs,1145
|
|
61
|
+
wedata/feature_store/constants/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
62
|
+
wedata/feature_store/constants/engine_types.py,sha256=-_tw2SwLqEjQ6Bnj7EEfCkgWE5_B9XiX89ESXLq9KQw,497
|
|
63
|
+
wedata/feature_store/feature_table_client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
64
|
+
wedata/feature_store/feature_table_client/feature_table_client.py,sha256=RwScDLkJsuxBDPMGJYB0pS7xR6fF4TN60SbZoH_3sGA,41756
|
|
65
|
+
wedata/feature_store/training_set_client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
66
|
+
wedata/feature_store/training_set_client/training_set_client.py,sha256=jguT3-AOdCbuPEWVQ5mYocJT_PZ_YOyQuPqWsX2hF3s,23022
|
|
67
|
+
wedata/tempo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
68
|
+
wedata/tempo/interpol.py,sha256=WXjypOTSKN0CKHiBdRDyjI0CvIT6UNRH2BHMb0ve8Ig,16419
|
|
69
|
+
wedata/tempo/intervals.py,sha256=L2ao7LlgQmfDTFwnBoFLXeuygSvwtIKXL52thiD80Yw,44078
|
|
70
|
+
wedata/tempo/io.py,sha256=KWIn6IBSkuBxr8QCcpdZ6NFX_49-8UQdGftmZgs_ujw,1872
|
|
71
|
+
wedata/tempo/ml.py,sha256=WtGa2szn6PditvZsTZoxo7wFDe4k1SRoMZ-jgNGIjvE,4323
|
|
72
|
+
wedata/tempo/resample.py,sha256=h81RVVmCl4ect-YKE-KZZHPDi1rGI3sh-YIb-Btz0ck,9698
|
|
73
|
+
wedata/tempo/tsdf.py,sha256=S4lZfxhSRFiezYoYS6gvGsl1mZA3zp-MWEKFHYZpDg0,70968
|
|
74
|
+
wedata/tempo/utils.py,sha256=I9I6l2DMwUoY213L04Yc1UR_zTWgSkj1BVo4ZwzQd4Y,7977
|
|
75
|
+
tencent_wedata_feature_engineering_dev-0.2.5.dist-info/METADATA,sha256=gjUNHpNEk6cc5nbQ3hgYmKKSZlyttZYdryye5GgGxZs,903
|
|
76
|
+
tencent_wedata_feature_engineering_dev-0.2.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
77
|
+
tencent_wedata_feature_engineering_dev-0.2.5.dist-info/top_level.txt,sha256=Xa0v1rh__RvfVTVDirW5r5UBKg7ZO_iuTeXfp8MNo2A,7
|
|
78
|
+
tencent_wedata_feature_engineering_dev-0.2.5.dist-info/RECORD,,
|
wedata/__init__.py
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .base import AbstractBaseTableClient
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
|
|
2
|
+
from typing import Union, List, Optional, Sequence, Any
|
|
3
|
+
from pyspark.sql import DataFrame
|
|
4
|
+
from pyspark.sql.types import StructType
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class AbstractBaseTableClient:
|
|
8
|
+
|
|
9
|
+
@staticmethod
|
|
10
|
+
def _normalize_params(
|
|
11
|
+
param: Optional[Union[str, Sequence[str]]],
|
|
12
|
+
default_type: type = list
|
|
13
|
+
) -> list:
|
|
14
|
+
"""统一处理参数标准化"""
|
|
15
|
+
if param is None:
|
|
16
|
+
return default_type()
|
|
17
|
+
return list(param) if isinstance(param, Sequence) else [param]
|
|
18
|
+
|
|
19
|
+
@staticmethod
|
|
20
|
+
def _validate_schema(df: DataFrame, schema: StructType):
|
|
21
|
+
"""校验DataFrame和schema的有效性和一致性"""
|
|
22
|
+
# 检查是否同时为空
|
|
23
|
+
if df is None and schema is None:
|
|
24
|
+
raise ValueError("Either DataFrame or schema must be provided")
|
|
25
|
+
|
|
26
|
+
# 检查schema匹配
|
|
27
|
+
if df is not None and schema is not None:
|
|
28
|
+
df_schema = df.schema
|
|
29
|
+
if df_schema != schema:
|
|
30
|
+
diff_fields = set(df_schema.fieldNames()).symmetric_difference(set(schema.fieldNames()))
|
|
31
|
+
raise ValueError(
|
|
32
|
+
f"DataFrame schema does not match. Differences: "
|
|
33
|
+
f"{diff_fields if diff_fields else 'field type mismatch'}"
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
@staticmethod
|
|
37
|
+
def _validate_key_conflicts(primary_keys: List[str], timestamp_keys: str):
|
|
38
|
+
"""校验主键与时间戳键是否冲突"""
|
|
39
|
+
if timestamp_keys in primary_keys:
|
|
40
|
+
raise ValueError(f"Timestamp keys conflict with primary keys: {timestamp_keys}")
|
|
41
|
+
|
|
42
|
+
@staticmethod
|
|
43
|
+
def _validate_key_exists(primary_keys: List[str], timestamp_keys: str):
|
|
44
|
+
"""校验主键与时间戳键是否存在"""
|
|
45
|
+
if not primary_keys:
|
|
46
|
+
raise ValueError("Primary keys cannot be empty")
|
|
47
|
+
if not timestamp_keys:
|
|
48
|
+
raise ValueError("Timestamp keys cannot be empty")
|
|
49
|
+
|
|
50
|
+
@staticmethod
|
|
51
|
+
def _escape_sql_value(value: str) -> str:
|
|
52
|
+
"""转义SQL值中的特殊字符"""
|
|
53
|
+
return value.replace("'", "''")
|
|
54
|
+
|
|
55
|
+
@staticmethod
|
|
56
|
+
def _check_sequence_element_type(sequence: Sequence[Any], element_type: type) -> bool:
|
|
57
|
+
"""检查序列中的元素是否为指定类型"""
|
|
58
|
+
return all(isinstance(element, element_type) for element in sequence)
|
|
@@ -4,8 +4,9 @@ from tencentcloud.wedata.v20210820.wedata_client import WedataClient
|
|
|
4
4
|
from tencentcloud.wedata.v20250806.wedata_client import WedataClient as WedataClientV2
|
|
5
5
|
from tencentcloud.common import credential
|
|
6
6
|
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
|
|
7
|
-
from wedata.
|
|
8
|
-
import wedata.
|
|
7
|
+
from wedata.common.cloud_sdk_client.utils import get_client_profile, set_request_header, is_mock
|
|
8
|
+
import wedata.common.cloud_sdk_client.models as models
|
|
9
|
+
from wedata.common.log.logger import get_logger
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
class FeatureCloudSDK:
|
|
@@ -22,17 +23,21 @@ class FeatureCloudSDK:
|
|
|
22
23
|
Returns:
|
|
23
24
|
创建结果响应
|
|
24
25
|
"""
|
|
26
|
+
logger = get_logger()
|
|
27
|
+
if is_mock():
|
|
28
|
+
logger.debug("Mock CreateOnlineFeatureTable API")
|
|
29
|
+
return models.CreateOnlineFeatureTableResponse()
|
|
25
30
|
try:
|
|
26
31
|
params = request._serialize()
|
|
27
32
|
headers = set_request_header(request.headers)
|
|
28
|
-
|
|
29
|
-
|
|
33
|
+
logger.debug(f"CreateOnlineFeatureTable params: {params}")
|
|
34
|
+
logger.debug(f"CreateOnlineFeatureTable headers: {headers}")
|
|
30
35
|
self._client._apiVersion = "2021-08-20"
|
|
31
36
|
body = self._client.call("CreateOnlineFeatureTable", params, headers=headers)
|
|
32
37
|
response = json.loads(body)
|
|
33
38
|
model = models.CreateOnlineFeatureTableResponse()
|
|
34
39
|
model._deserialize(response["Response"])
|
|
35
|
-
|
|
40
|
+
logger.debug(f"CreateOnlineFeatureTable Response: {response}")
|
|
36
41
|
return model
|
|
37
42
|
except Exception as e:
|
|
38
43
|
if isinstance(e, TencentCloudSDKException):
|
|
@@ -49,17 +54,22 @@ class FeatureCloudSDK:
|
|
|
49
54
|
Returns:
|
|
50
55
|
查询结果响应
|
|
51
56
|
"""
|
|
57
|
+
logger = get_logger()
|
|
58
|
+
if is_mock():
|
|
59
|
+
logger.debug("Mock DescribeNormalSchedulerExecutorGroups API")
|
|
60
|
+
return models.DescribeNormalSchedulerExecutorGroupsResponse()
|
|
61
|
+
|
|
52
62
|
try:
|
|
53
63
|
params = request._serialize()
|
|
54
64
|
headers = set_request_header(request.headers)
|
|
55
|
-
|
|
56
|
-
|
|
65
|
+
logger.debug(f"DescribeNormalSchedulerExecutorGroups params: {params}")
|
|
66
|
+
logger.debug(f"DescribeNormalSchedulerExecutorGroups headers: {headers}")
|
|
57
67
|
self._client._apiVersion = "2021-08-20"
|
|
58
68
|
body = self._client.call("DescribeNormalSchedulerExecutorGroups", params, headers=headers)
|
|
59
69
|
response = json.loads(body)
|
|
60
70
|
model = models.DescribeNormalSchedulerExecutorGroupsResponse()
|
|
61
71
|
model._deserialize(response["Response"])
|
|
62
|
-
|
|
72
|
+
logger.debug(f"DescribeNormalSchedulerExecutorGroups Response: {response}")
|
|
63
73
|
return model
|
|
64
74
|
except Exception as e:
|
|
65
75
|
if isinstance(e, TencentCloudSDKException):
|
|
@@ -75,20 +85,54 @@ class FeatureCloudSDK:
|
|
|
75
85
|
Returns:
|
|
76
86
|
刷新结果响应
|
|
77
87
|
"""
|
|
88
|
+
logger = get_logger()
|
|
89
|
+
if is_mock():
|
|
90
|
+
logger.debug("Mock RefreshFeatureTable API")
|
|
91
|
+
return models.RefreshFeatureTableResponse()
|
|
78
92
|
try:
|
|
79
93
|
params = request._serialize()
|
|
80
94
|
headers = set_request_header(request.headers)
|
|
81
|
-
|
|
82
|
-
|
|
95
|
+
logger.debug(f"RefreshFeatureTable params: {params}")
|
|
96
|
+
logger.debug(f"RefreshFeatureTable headers: {headers}")
|
|
83
97
|
self._client_v2._apiVersion = "2025-08-06"
|
|
84
98
|
body = self._client_v2.call("RefreshFeatureTable", params, headers=headers)
|
|
85
99
|
response = json.loads(body)
|
|
86
100
|
model = models.RefreshFeatureTableResponse()
|
|
87
101
|
model._deserialize(response["Response"])
|
|
88
|
-
|
|
102
|
+
logger.debug(f"RefreshFeatureTable Response: {response}")
|
|
103
|
+
return model
|
|
104
|
+
except Exception as e:
|
|
105
|
+
if isinstance(e, TencentCloudSDKException):
|
|
106
|
+
raise
|
|
107
|
+
else:
|
|
108
|
+
raise TencentCloudSDKException(type(e).__name__, str(e))
|
|
109
|
+
|
|
110
|
+
def DescribeFeatureStoreDatabases(self, request: models.DescribeFeatureStoreDatabasesRequest) -> 'models.DescribeFeatureStoreDatabasesResponse':
|
|
111
|
+
"""
|
|
112
|
+
查询特征库列表
|
|
113
|
+
Args:
|
|
114
|
+
request: 查询请求参数
|
|
115
|
+
Returns:
|
|
116
|
+
查询结果响应
|
|
117
|
+
"""
|
|
118
|
+
logger = get_logger()
|
|
119
|
+
if is_mock():
|
|
120
|
+
logger.debug("Mock DescribeFeatureStoreDatabases API")
|
|
121
|
+
return models.DescribeFeatureStoreDatabasesResponse()
|
|
122
|
+
try:
|
|
123
|
+
params = request._serialize()
|
|
124
|
+
headers = set_request_header(request.headers)
|
|
125
|
+
logger.debug(f"DescribeFeatureStoreDatabases params: {params}")
|
|
126
|
+
logger.debug(f"DescribeFeatureStoreDatabases headers: {headers}")
|
|
127
|
+
self._client_v2._apiVersion = "2021-08-20"
|
|
128
|
+
body = self._client_v2.call("DescribeFeatureStoreDatabases", params, headers=headers)
|
|
129
|
+
response = json.loads(body)
|
|
130
|
+
model = models.DescribeFeatureStoreDatabasesResponse()
|
|
131
|
+
model._deserialize(response["Response"])
|
|
132
|
+
logger.debug(f"DescribeFeatureStoreDatabases Response: {response}")
|
|
89
133
|
return model
|
|
90
134
|
except Exception as e:
|
|
91
135
|
if isinstance(e, TencentCloudSDKException):
|
|
92
136
|
raise
|
|
93
137
|
else:
|
|
94
|
-
raise TencentCloudSDKException(type(e).__name__, str(e))
|
|
138
|
+
raise TencentCloudSDKException(type(e).__name__, str(e))
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
|
|
1
2
|
from tencentcloud.common.abstract_model import AbstractModel
|
|
3
|
+
import typing
|
|
2
4
|
import warnings
|
|
5
|
+
from wedata.common.cloud_sdk_client.utils import is_warning
|
|
3
6
|
|
|
4
7
|
|
|
5
8
|
class OfflineFeatureConfiguration(AbstractModel):
|
|
@@ -85,8 +88,8 @@ class OfflineFeatureConfiguration(AbstractModel):
|
|
|
85
88
|
property_name = name[1:]
|
|
86
89
|
if property_name in member_set:
|
|
87
90
|
member_set.remove(property_name)
|
|
88
|
-
if len(member_set) > 0:
|
|
89
|
-
warnings.warn("%s
|
|
91
|
+
if len(member_set) > 0 and is_warning():
|
|
92
|
+
warnings.warn("%s fields are useless." % ",".join(member_set))
|
|
90
93
|
|
|
91
94
|
|
|
92
95
|
class TaskSchedulerConfiguration(AbstractModel):
|
|
@@ -190,8 +193,8 @@ class TaskSchedulerConfiguration(AbstractModel):
|
|
|
190
193
|
property_name = name[1:]
|
|
191
194
|
if property_name in member_set:
|
|
192
195
|
member_set.remove(property_name)
|
|
193
|
-
if len(member_set) > 0:
|
|
194
|
-
warnings.warn("%s
|
|
196
|
+
if len(member_set) > 0 and is_warning():
|
|
197
|
+
warnings.warn("%s fields are useless." % ",".join(member_set))
|
|
195
198
|
|
|
196
199
|
|
|
197
200
|
class OnlineFeatureConfiguration(AbstractModel):
|
|
@@ -257,8 +260,8 @@ class OnlineFeatureConfiguration(AbstractModel):
|
|
|
257
260
|
property_name = name[1:]
|
|
258
261
|
if property_name in member_set:
|
|
259
262
|
member_set.remove(property_name)
|
|
260
|
-
if len(member_set) > 0:
|
|
261
|
-
warnings.warn("%s
|
|
263
|
+
if len(member_set) > 0 and is_warning():
|
|
264
|
+
warnings.warn("%s fields are useless." % ",".join(member_set))
|
|
262
265
|
|
|
263
266
|
|
|
264
267
|
class CreateOnlineFeatureTableRequest(AbstractModel):
|
|
@@ -337,8 +340,8 @@ class CreateOnlineFeatureTableRequest(AbstractModel):
|
|
|
337
340
|
property_name = name[1:]
|
|
338
341
|
if property_name in member_set:
|
|
339
342
|
member_set.remove(property_name)
|
|
340
|
-
if len(member_set) > 0:
|
|
341
|
-
warnings.warn("%s
|
|
343
|
+
if len(member_set) > 0 and is_warning():
|
|
344
|
+
warnings.warn("%s fields are useless." % ",".join(member_set))
|
|
342
345
|
|
|
343
346
|
|
|
344
347
|
class CreateOnlineFeatureTableRsp(AbstractModel):
|
|
@@ -374,8 +377,8 @@ class CreateOnlineFeatureTableRsp(AbstractModel):
|
|
|
374
377
|
property_name = name[1:]
|
|
375
378
|
if property_name in member_set:
|
|
376
379
|
member_set.remove(property_name)
|
|
377
|
-
if len(member_set) > 0:
|
|
378
|
-
warnings.warn("%s
|
|
380
|
+
if len(member_set) > 0 and is_warning():
|
|
381
|
+
warnings.warn("%s fields are useless." % ",".join(member_set))
|
|
379
382
|
|
|
380
383
|
|
|
381
384
|
class CreateOnlineFeatureTableResponse(AbstractModel):
|
|
@@ -402,8 +405,8 @@ class CreateOnlineFeatureTableResponse(AbstractModel):
|
|
|
402
405
|
property_name = name[1:]
|
|
403
406
|
if property_name in member_set:
|
|
404
407
|
member_set.remove(property_name)
|
|
405
|
-
if len(member_set) > 0:
|
|
406
|
-
warnings.warn("%s
|
|
408
|
+
if len(member_set) > 0 and is_warning():
|
|
409
|
+
warnings.warn("%s fields are useless." % ",".join(member_set))
|
|
407
410
|
|
|
408
411
|
|
|
409
412
|
class DescribeNormalSchedulerExecutorGroupsData(AbstractModel):
|
|
@@ -480,12 +483,12 @@ class DescribeNormalSchedulerExecutorGroupsData(AbstractModel):
|
|
|
480
483
|
self._Available = params.get("Available")
|
|
481
484
|
self._PythonSubVersions = params.get("PythonSubVersions")
|
|
482
485
|
self._EnvJson = params.get("EnvJson")
|
|
483
|
-
|
|
486
|
+
member_set = set(params.keys())
|
|
484
487
|
for name, value in vars(self).items():
|
|
485
|
-
if name in
|
|
486
|
-
|
|
487
|
-
if len(
|
|
488
|
-
warnings.warn("%s
|
|
488
|
+
if name in member_set:
|
|
489
|
+
member_set.remove(name)
|
|
490
|
+
if len(member_set) > 0 and is_warning():
|
|
491
|
+
warnings.warn("%s fields are useless." % ",".join(member_set))
|
|
489
492
|
|
|
490
493
|
|
|
491
494
|
class DescribeNormalSchedulerExecutorGroupsResponse(AbstractModel):
|
|
@@ -511,12 +514,12 @@ class DescribeNormalSchedulerExecutorGroupsResponse(AbstractModel):
|
|
|
511
514
|
obj = DescribeNormalSchedulerExecutorGroupsData()
|
|
512
515
|
obj._deserialize(item)
|
|
513
516
|
self._Data.append(obj)
|
|
514
|
-
|
|
517
|
+
member_set = set(params.keys())
|
|
515
518
|
for name, value in vars(self).items():
|
|
516
|
-
if name in
|
|
517
|
-
|
|
518
|
-
if len(
|
|
519
|
-
warnings.warn("%s
|
|
519
|
+
if name in member_set:
|
|
520
|
+
member_set.remove(name)
|
|
521
|
+
if len(member_set) > 0 and is_warning():
|
|
522
|
+
warnings.warn("%s fields are useless." % ",".join(member_set))
|
|
520
523
|
|
|
521
524
|
|
|
522
525
|
class DescribeNormalSchedulerExecutorGroupsRequest(AbstractModel):
|
|
@@ -547,12 +550,12 @@ class DescribeNormalSchedulerExecutorGroupsRequest(AbstractModel):
|
|
|
547
550
|
def _deserialize(self, params):
|
|
548
551
|
self._ProjectId = params.get("ProjectId")
|
|
549
552
|
self._OnlyAvailable = params.get("OnlyAvailable")
|
|
550
|
-
|
|
553
|
+
member_set = set(params.keys())
|
|
551
554
|
for name, value in vars(self).items():
|
|
552
|
-
if name in
|
|
553
|
-
|
|
554
|
-
if len(
|
|
555
|
-
warnings.warn("%s
|
|
555
|
+
if name in member_set:
|
|
556
|
+
member_set.remove(name)
|
|
557
|
+
if len(member_set) > 0 and is_warning():
|
|
558
|
+
warnings.warn("%s fields are useless." % ",".join(member_set))
|
|
556
559
|
|
|
557
560
|
|
|
558
561
|
class RefreshFeatureTableRequest(AbstractModel):
|
|
@@ -651,12 +654,12 @@ class RefreshFeatureTableRequest(AbstractModel):
|
|
|
651
654
|
self._DatasourceType = params.get("DatasourceType")
|
|
652
655
|
self._EngineName = params.get("EngineName")
|
|
653
656
|
self._IsTry = params.get("IsTry")
|
|
654
|
-
|
|
657
|
+
member_set = set(params.keys())
|
|
655
658
|
for name, value in vars(self).items():
|
|
656
|
-
if name in
|
|
657
|
-
|
|
658
|
-
if len(
|
|
659
|
-
warnings.warn("%s
|
|
659
|
+
if name in member_set:
|
|
660
|
+
member_set.remove(name)
|
|
661
|
+
if len(member_set) > 0 and is_warning():
|
|
662
|
+
warnings.warn("%s fields are useless." % ",".join(member_set))
|
|
660
663
|
|
|
661
664
|
|
|
662
665
|
class RefreshFeatureTableResponse(AbstractModel):
|
|
@@ -678,9 +681,181 @@ class RefreshFeatureTableResponse(AbstractModel):
|
|
|
678
681
|
|
|
679
682
|
def _deserialize(self, params):
|
|
680
683
|
self._Data = params.get("Data")
|
|
681
|
-
|
|
684
|
+
member_set = set(params.keys())
|
|
685
|
+
for name, value in vars(self).items():
|
|
686
|
+
if name in member_set:
|
|
687
|
+
member_set.remove(name)
|
|
688
|
+
if len(member_set) > 0 and is_warning():
|
|
689
|
+
warnings.warn("%s fields are useless." % ",".join(member_set))
|
|
690
|
+
|
|
691
|
+
|
|
692
|
+
class FeatureStoreDatabase(AbstractModel):
|
|
693
|
+
"""
|
|
694
|
+
特征存储库
|
|
695
|
+
Property:
|
|
696
|
+
DatabaseName: 特征库名称
|
|
697
|
+
DatasourceType:数据源类型: EMR/DLC
|
|
698
|
+
EngineName: 引擎名称
|
|
699
|
+
ProjectId: 项目ID
|
|
700
|
+
IsDefault: 是否默认库
|
|
701
|
+
IsExistDatabase: 是否存在库
|
|
702
|
+
DatasourceId: 数据源ID
|
|
703
|
+
OnlineMode: 在线模式: 0-离线; 1-在线
|
|
704
|
+
DatasourceName: 数据源名称
|
|
705
|
+
"""
|
|
706
|
+
def __init__(self):
|
|
707
|
+
self._DatabaseName = None
|
|
708
|
+
self._DatasourceType = None
|
|
709
|
+
self._EngineName = None
|
|
710
|
+
self._ProjectId = None
|
|
711
|
+
self._IsDefault = None
|
|
712
|
+
self._IsExistDatabase = None
|
|
713
|
+
self._DatasourceId = None
|
|
714
|
+
self._OnlineMode = None
|
|
715
|
+
self._DatasourceName = None
|
|
716
|
+
|
|
717
|
+
@property
|
|
718
|
+
def DatabaseName(self):
|
|
719
|
+
return self._DatabaseName
|
|
720
|
+
|
|
721
|
+
@DatabaseName.setter
|
|
722
|
+
def DatabaseName(self, DatabaseName):
|
|
723
|
+
self._DatabaseName = DatabaseName
|
|
724
|
+
|
|
725
|
+
@property
|
|
726
|
+
def DatasourceType(self):
|
|
727
|
+
return self._DatasourceType
|
|
728
|
+
|
|
729
|
+
@DatasourceType.setter
|
|
730
|
+
def DatasourceType(self, DatasourceType):
|
|
731
|
+
self._DatasourceType = DatasourceType
|
|
732
|
+
|
|
733
|
+
@property
|
|
734
|
+
def EngineName(self):
|
|
735
|
+
return self._EngineName
|
|
736
|
+
|
|
737
|
+
@EngineName.setter
|
|
738
|
+
def EngineName(self, EngineName):
|
|
739
|
+
self._EngineName = EngineName
|
|
740
|
+
|
|
741
|
+
@property
|
|
742
|
+
def ProjectId(self):
|
|
743
|
+
return self._ProjectId
|
|
744
|
+
|
|
745
|
+
@ProjectId.setter
|
|
746
|
+
def ProjectId(self, ProjectId):
|
|
747
|
+
self._ProjectId = ProjectId
|
|
748
|
+
|
|
749
|
+
@property
|
|
750
|
+
def IsDefault(self):
|
|
751
|
+
return self._IsDefault
|
|
752
|
+
|
|
753
|
+
@IsDefault.setter
|
|
754
|
+
def IsDefault(self, IsDefault):
|
|
755
|
+
self._IsDefault = IsDefault
|
|
756
|
+
|
|
757
|
+
@property
|
|
758
|
+
def IsExistDatabase(self):
|
|
759
|
+
return self._IsExistDatabase
|
|
760
|
+
|
|
761
|
+
@IsExistDatabase.setter
|
|
762
|
+
def IsExistDatabase(self, IsExistDatabase):
|
|
763
|
+
self._IsExistDatabase = IsExistDatabase
|
|
764
|
+
|
|
765
|
+
@property
|
|
766
|
+
def DatasourceId(self):
|
|
767
|
+
return self._DatasourceId
|
|
768
|
+
|
|
769
|
+
@DatasourceId.setter
|
|
770
|
+
def DatasourceId(self, DatasourceId):
|
|
771
|
+
self._DatasourceId = DatasourceId
|
|
772
|
+
|
|
773
|
+
@property
|
|
774
|
+
def OnlineMode(self):
|
|
775
|
+
return self._OnlineMode
|
|
776
|
+
|
|
777
|
+
@OnlineMode.setter
|
|
778
|
+
def OnlineMode(self, OnlineMode):
|
|
779
|
+
self._OnlineMode = OnlineMode
|
|
780
|
+
|
|
781
|
+
@property
|
|
782
|
+
def DatasourceName(self):
|
|
783
|
+
return self._DatasourceName
|
|
784
|
+
|
|
785
|
+
@DatasourceName.setter
|
|
786
|
+
def DatasourceName(self, DatasourceName):
|
|
787
|
+
self._DatasourceName = DatasourceName
|
|
788
|
+
|
|
789
|
+
def _deserialize(self, params):
|
|
790
|
+
self._DatabaseName = params.get("DatabaseName")
|
|
791
|
+
self._DatasourceType = params.get("DatasourceType")
|
|
792
|
+
self._EngineName = params.get("EngineName")
|
|
793
|
+
self._ProjectId = params.get("ProjectId")
|
|
794
|
+
self._IsDefault = params.get("IsDefault")
|
|
795
|
+
self._IsExistDatabase = params.get("IsExistDatabase")
|
|
796
|
+
self._DatasourceId = params.get("DatasourceId")
|
|
797
|
+
self._OnlineMode = params.get("OnlineMode")
|
|
798
|
+
self._DatasourceName = params.get("DatasourceName")
|
|
799
|
+
member_set = set(params.keys())
|
|
800
|
+
for name, value in vars(self).items():
|
|
801
|
+
if name in member_set:
|
|
802
|
+
member_set.remove(name)
|
|
803
|
+
if len(member_set) > 0 and is_warning():
|
|
804
|
+
warnings.warn("%s fields are useless." % ",".join(member_set))
|
|
805
|
+
|
|
806
|
+
|
|
807
|
+
class DescribeFeatureStoreDatabasesResponse(AbstractModel):
|
|
808
|
+
"""
|
|
809
|
+
描述特征库
|
|
810
|
+
Property:
|
|
811
|
+
Data: 结果
|
|
812
|
+
"""
|
|
813
|
+
def __init__(self):
|
|
814
|
+
self._Data = None
|
|
815
|
+
|
|
816
|
+
@property
|
|
817
|
+
def Data(self) -> typing.List[FeatureStoreDatabase]:
|
|
818
|
+
return self._Data
|
|
819
|
+
|
|
820
|
+
@Data.setter
|
|
821
|
+
def Data(self, Data):
|
|
822
|
+
self._Data = Data
|
|
823
|
+
|
|
824
|
+
def _deserialize(self, params):
|
|
825
|
+
self._Data = []
|
|
826
|
+
for item in params.get("Data", []):
|
|
827
|
+
obj = FeatureStoreDatabase()
|
|
828
|
+
obj._deserialize(item)
|
|
829
|
+
self._Data.append(obj)
|
|
830
|
+
member_set = set(params.keys())
|
|
831
|
+
for name, value in vars(self).items():
|
|
832
|
+
if name in member_set:
|
|
833
|
+
member_set.remove(name)
|
|
834
|
+
if len(member_set) > 0 and is_warning():
|
|
835
|
+
warnings.warn("%s fields are useless." % ",".join(member_set))
|
|
836
|
+
|
|
837
|
+
|
|
838
|
+
class DescribeFeatureStoreDatabasesRequest(AbstractModel):
|
|
839
|
+
"""
|
|
840
|
+
Property:
|
|
841
|
+
ProjectId: 项目ID
|
|
842
|
+
"""
|
|
843
|
+
def __init__(self):
|
|
844
|
+
self._ProjectId = None
|
|
845
|
+
|
|
846
|
+
@property
|
|
847
|
+
def ProjectId(self):
|
|
848
|
+
return self._ProjectId
|
|
849
|
+
|
|
850
|
+
@ProjectId.setter
|
|
851
|
+
def ProjectId(self, ProjectId):
|
|
852
|
+
self._ProjectId = ProjectId
|
|
853
|
+
|
|
854
|
+
def _deserialize(self, params):
|
|
855
|
+
self._ProjectId = params.get("ProjectId")
|
|
856
|
+
member_set = set(params.keys())
|
|
682
857
|
for name, value in vars(self).items():
|
|
683
|
-
if name in
|
|
684
|
-
|
|
685
|
-
if len(
|
|
686
|
-
warnings.warn("%s
|
|
858
|
+
if name in member_set:
|
|
859
|
+
member_set.remove(name)
|
|
860
|
+
if len(member_set) > 0 and is_warning():
|
|
861
|
+
warnings.warn("%s fields are useless." % ",".join(member_set))
|
|
@@ -30,3 +30,17 @@ def set_request_header(headers):
|
|
|
30
30
|
headers["X-Qcloud-User-Id"] = os.environ.get("TEST_USER_ID")
|
|
31
31
|
return headers
|
|
32
32
|
|
|
33
|
+
|
|
34
|
+
def is_mock() -> bool:
|
|
35
|
+
"""
|
|
36
|
+
是否为模拟环境
|
|
37
|
+
"""
|
|
38
|
+
return os.getenv("IS_MOCK_API") == "true"
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def is_warning() -> bool:
|
|
42
|
+
"""
|
|
43
|
+
是否展示警告环境
|
|
44
|
+
"""
|
|
45
|
+
return os.getenv("IS_CLOUD_API_WARNING") == "true"
|
|
46
|
+
|