tracdap-runtime 0.5.29__tar.gz → 0.6.0__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.
Files changed (109) hide show
  1. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/PKG-INFO +27 -15
  2. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/README.md +5 -5
  3. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/setup.cfg +22 -10
  4. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/_exec/dev_mode.py +2 -1
  5. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/_impl/data.py +1 -28
  6. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/_impl/static_api.py +5 -1
  7. tracdap_runtime-0.6.0/src/tracdap/rt/_impl/storage.py +830 -0
  8. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/_impl/util.py +24 -3
  9. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/_plugins/_helpers.py +26 -25
  10. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/_plugins/storage_aws.py +162 -76
  11. tracdap_runtime-0.6.0/src/tracdap/rt/_plugins/storage_azure.py +155 -0
  12. tracdap_runtime-0.6.0/src/tracdap/rt/_plugins/storage_gcp.py +183 -0
  13. tracdap_runtime-0.6.0/src/tracdap/rt/_plugins/storage_local.py +420 -0
  14. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/_version.py +1 -1
  15. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/api/static_api.py +2 -1
  16. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/config/__init__.py +8 -13
  17. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/config/common.py +10 -0
  18. tracdap_runtime-0.6.0/src/tracdap/rt/config/common_pb2.py +55 -0
  19. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/config/job_pb2.py +21 -20
  20. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/config/platform.py +60 -25
  21. tracdap_runtime-0.6.0/src/tracdap/rt/config/platform_pb2.py +71 -0
  22. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/config/result_pb2.py +15 -14
  23. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/config/runtime.py +0 -1
  24. tracdap_runtime-0.6.0/src/tracdap/rt/config/runtime_pb2.py +42 -0
  25. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/exceptions.py +9 -0
  26. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/ext/plugins.py +0 -12
  27. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/ext/storage.py +47 -29
  28. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/metadata/common_pb2.py +15 -14
  29. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/metadata/custom_pb2.py +9 -8
  30. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/metadata/data_pb2.py +31 -30
  31. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/metadata/file_pb2.py +9 -8
  32. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/metadata/flow_pb2.py +33 -32
  33. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/metadata/job_pb2.py +55 -54
  34. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/metadata/model_pb2.py +31 -30
  35. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/metadata/object_id_pb2.py +13 -12
  36. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/metadata/object_pb2.py +9 -8
  37. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/metadata/search_pb2.py +19 -18
  38. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/metadata/stoarge_pb2.py +31 -30
  39. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/metadata/tag_pb2.py +13 -12
  40. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/metadata/tag_update_pb2.py +11 -10
  41. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/metadata/type_pb2.py +29 -28
  42. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/tracdap_runtime.egg-info/PKG-INFO +27 -15
  43. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/tracdap_runtime.egg-info/SOURCES.txt +2 -2
  44. tracdap_runtime-0.6.0/tracdap_runtime.egg-info/requires.txt +26 -0
  45. tracdap-runtime-0.5.29/src/tracdap/rt/_impl/storage.py +0 -254
  46. tracdap-runtime-0.5.29/src/tracdap/rt/_plugins/storage_local.py +0 -269
  47. tracdap-runtime-0.5.29/src/tracdap/rt/config/common_pb2.py +0 -48
  48. tracdap-runtime-0.5.29/src/tracdap/rt/config/gateway.py +0 -104
  49. tracdap-runtime-0.5.29/src/tracdap/rt/config/gateway_pb2.py +0 -45
  50. tracdap-runtime-0.5.29/src/tracdap/rt/config/platform_pb2.py +0 -64
  51. tracdap-runtime-0.5.29/src/tracdap/rt/config/runtime_pb2.py +0 -42
  52. tracdap-runtime-0.5.29/tracdap_runtime.egg-info/requires.txt +0 -12
  53. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/LICENSE +0 -0
  54. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/pyproject.toml +0 -0
  55. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/__init__.py +0 -0
  56. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/_exec/__init__.py +0 -0
  57. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/_exec/actors.py +0 -0
  58. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/_exec/context.py +0 -0
  59. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/_exec/engine.py +0 -0
  60. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/_exec/functions.py +0 -0
  61. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/_exec/graph.py +0 -0
  62. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/_exec/graph_builder.py +0 -0
  63. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/_exec/runtime.py +0 -0
  64. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/_impl/__init__.py +0 -0
  65. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/_impl/config_parser.py +0 -0
  66. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/_impl/guard_rails.py +0 -0
  67. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/_impl/models.py +0 -0
  68. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/_impl/repos.py +0 -0
  69. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/_impl/schemas.py +0 -0
  70. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/_impl/shim.py +0 -0
  71. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/_impl/type_system.py +0 -0
  72. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/_impl/validation.py +0 -0
  73. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/_plugins/__init__.py +0 -0
  74. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/_plugins/format_arrow.py +0 -0
  75. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/_plugins/format_csv.py +0 -0
  76. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/_plugins/format_parquet.py +0 -0
  77. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/_plugins/repo_git.py +0 -0
  78. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/_plugins/repo_local.py +0 -0
  79. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/_plugins/repo_pypi.py +0 -0
  80. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/api/__init__.py +0 -0
  81. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/api/hook.py +0 -0
  82. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/api/model_api.py +0 -0
  83. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/config/job.py +0 -0
  84. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/config/result.py +0 -0
  85. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/ext/__init__.py +0 -0
  86. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/ext/_guard.py +0 -0
  87. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/ext/embed.py +0 -0
  88. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/ext/repos.py +0 -0
  89. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/launch/__init__.py +0 -0
  90. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/launch/__main__.py +0 -0
  91. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/launch/cli.py +0 -0
  92. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/launch/launch.py +0 -0
  93. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/metadata/__init__.py +19 -19
  94. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/metadata/common.py +0 -0
  95. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/metadata/custom.py +0 -0
  96. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/metadata/data.py +0 -0
  97. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/metadata/file.py +0 -0
  98. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/metadata/flow.py +0 -0
  99. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/metadata/job.py +0 -0
  100. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/metadata/model.py +0 -0
  101. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/metadata/object.py +0 -0
  102. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/metadata/object_id.py +0 -0
  103. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/metadata/search.py +0 -0
  104. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/metadata/stoarge.py +0 -0
  105. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/metadata/tag.py +0 -0
  106. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/metadata/tag_update.py +0 -0
  107. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/src/tracdap/rt/metadata/type.py +0 -0
  108. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/tracdap_runtime.egg-info/dependency_links.txt +0 -0
  109. {tracdap-runtime-0.5.29 → tracdap_runtime-0.6.0}/tracdap_runtime.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tracdap-runtime
3
- Version: 0.5.29
3
+ Version: 0.6.0
4
4
  Summary: Runtime package for building models on the TRAC Data & Analytics Platform
5
5
  Home-page: https://tracdap.finos.org/
6
6
  Author: Martin Traverse
@@ -13,19 +13,31 @@ Platform: any
13
13
  Classifier: Programming Language :: Python :: 3
14
14
  Classifier: License :: OSI Approved :: Apache Software License
15
15
  Classifier: Operating System :: OS Independent
16
- Requires-Python: <3.12,>=3.7
16
+ Requires-Python: <3.13,>=3.8
17
17
  Description-Content-Type: text/markdown
18
18
  License-File: LICENSE
19
- Requires-Dist: protobuf==4.23.2
20
- Requires-Dist: pyarrow==12.0.1
21
- Requires-Dist: pyyaml==6.0.0
22
- Requires-Dist: dulwich==0.21.2
23
- Requires-Dist: requests==2.31.0
24
- Requires-Dist: pandas<2.2.0,>=1.2.0
19
+ Requires-Dist: protobuf==4.25.3
20
+ Requires-Dist: pyarrow==16.0.0
21
+ Requires-Dist: pyyaml==6.0.1
22
+ Requires-Dist: dulwich==0.22.1
23
+ Requires-Dist: requests==2.32.3
24
+ Requires-Dist: pandas<2.3.0,>=1.2.0
25
+ Requires-Dist: numpy<2.0.0
25
26
  Provides-Extra: spark
26
- Requires-Dist: pyspark<3.4.0,>=2.4.0; extra == "spark"
27
+ Requires-Dist: pyspark<3.6.0,>=3.0.0; extra == "spark"
27
28
  Provides-Extra: aws
28
- Requires-Dist: boto3==1.26.22; extra == "aws"
29
+ Requires-Dist: botocore==1.34.93; extra == "aws"
30
+ Requires-Dist: boto3==1.34.93; extra == "aws"
31
+ Provides-Extra: gcp
32
+ Requires-Dist: google-auth==2.29.0; extra == "gcp"
33
+ Requires-Dist: google-cloud-core==2.4.1; extra == "gcp"
34
+ Requires-Dist: google-cloud-storage==2.16.0; extra == "gcp"
35
+ Requires-Dist: gcsfs==2024.3.1; extra == "gcp"
36
+ Provides-Extra: azure
37
+ Requires-Dist: azure-core==1.30.1; extra == "azure"
38
+ Requires-Dist: azure-identity==1.16.1; extra == "azure"
39
+ Requires-Dist: azure-storage-blob==12.19.1; extra == "azure"
40
+ Requires-Dist: adlfs==2024.4.1; extra == "azure"
29
41
 
30
42
  # TRAC Model Runtime for Python
31
43
 
@@ -45,12 +57,12 @@ Documentation for the TRAC platform is available on our website at
45
57
 
46
58
  The TRAC runtime for Python has these requirements:
47
59
 
48
- * Python: 3.7 up to 3.11.x
49
- * Pandas: 1.2 up to 2.1.x
50
- * PySpark 2.4.x, or 3.0 up to 3.3.x
51
-
52
- Not every combination of versions will work, e.g. PySpark 3 requires Python 3.8.
60
+ * Python: 3.8 up to 3.12
61
+ * Pandas: 1.2 up to 2.2
62
+ * PySpark 3.0 up to 3.5 (optional)
53
63
 
64
+ 3rd party libraries may impose additional constraints on supported versions of Python, Pandas or PySpark.
65
+ As of February 2024, the Python libraries for GCP do not yet support Python 3.12.
54
66
 
55
67
  ## Installing the runtime
56
68
 
@@ -16,12 +16,12 @@ Documentation for the TRAC platform is available on our website at
16
16
 
17
17
  The TRAC runtime for Python has these requirements:
18
18
 
19
- * Python: 3.7 up to 3.11.x
20
- * Pandas: 1.2 up to 2.1.x
21
- * PySpark 2.4.x, or 3.0 up to 3.3.x
22
-
23
- Not every combination of versions will work, e.g. PySpark 3 requires Python 3.8.
19
+ * Python: 3.8 up to 3.12
20
+ * Pandas: 1.2 up to 2.2
21
+ * PySpark 3.0 up to 3.5 (optional)
24
22
 
23
+ 3rd party libraries may impose additional constraints on supported versions of Python, Pandas or PySpark.
24
+ As of February 2024, the Python libraries for GCP do not yet support Python 3.12.
25
25
 
26
26
  ## Installing the runtime
27
27
 
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = tracdap-runtime
3
- version = 0.5.29
3
+ version = 0.6.0
4
4
  description = Runtime package for building models on the TRAC Data & Analytics Platform
5
5
  long_description = file: README.md
6
6
  long_description_content_type = text/markdown
@@ -32,21 +32,33 @@ packages =
32
32
  package_dir =
33
33
  tracdap = src/tracdap
34
34
  tracdap.rt = src/tracdap/rt
35
- python_requires = >= 3.7, < 3.12
35
+ python_requires = >= 3.8, < 3.13
36
36
  install_requires =
37
- protobuf == 4.23.2
38
- pyarrow == 12.0.1
39
- pyyaml == 6.0.0
40
- dulwich == 0.21.2
41
- requests == 2.31.0
37
+ protobuf == 4.25.3
38
+ pyarrow == 16.0.0
39
+ pyyaml == 6.0.1
40
+ dulwich == 0.22.1
41
+ requests == 2.32.3
42
42
 
43
- pandas >= 1.2.0, < 2.2.0
43
+ pandas >= 1.2.0, < 2.3.0
44
+ numpy < 2.0.0
44
45
 
45
46
  [options.extras_require]
46
47
  spark =
47
- pyspark >= 2.4.0, < 3.4.0
48
+ pyspark >= 3.0.0, < 3.6.0
48
49
  aws =
49
- boto3 == 1.26.22
50
+ botocore == 1.34.93
51
+ boto3 == 1.34.93
52
+ gcp =
53
+ google-auth == 2.29.0
54
+ google-cloud-core == 2.4.1
55
+ google-cloud-storage == 2.16.0
56
+ gcsfs == 2024.3.1
57
+ azure =
58
+ azure-core == 1.30.1
59
+ azure-identity == 1.16.1
60
+ azure-storage-blob == 12.19.1
61
+ adlfs == 2024.4.1
50
62
 
51
63
  [egg_info]
52
64
  tag_build =
@@ -648,7 +648,8 @@ class DevModeTranslator:
648
648
  x_name = x_orig_path.name
649
649
 
650
650
  if x_storage.exists(str(x_orig_path.parent)):
651
- existing_files = x_storage.ls(str(x_orig_path.parent))
651
+ listing = x_storage.ls(str(x_orig_path.parent))
652
+ existing_files = list(map(lambda stat: stat.file_name, listing))
652
653
  else:
653
654
  existing_files = []
654
655
 
@@ -330,7 +330,7 @@ class DataMapping:
330
330
  DataConformance.check_duplicate_fields(table.schema.names, False)
331
331
 
332
332
  # Use Arrow's built-in function to convert to Pandas
333
- df_from_arrow = table.to_pandas(
333
+ return table.to_pandas(
334
334
 
335
335
  # Mapping for arrow -> pandas types for core types
336
336
  types_mapper=cls.__ARROW_TO_PANDAS_TYPE_MAPPING.get,
@@ -346,33 +346,6 @@ class DataMapping:
346
346
  # This is a significant performance win for very wide datasets
347
347
  split_blocks=True) # noqa
348
348
 
349
- # Arrow 12 doesn't support the new precision handling for datetime values supported in Pandas 2
350
- # However Arrow 13 dropped support for Python 3.7, which is a requirement for the TRAC 0.5.x series
351
- # So to backport Pandas 2 support, special handling is needed for datetime fields when using Pandas 2
352
- # This is not needed from TRAC 0.6 onward, which upgrades to Arrow 13 and drops Python 3.7 support
353
- # Also it is not needed if the temporal objects flag is set, since it only affects NumPy datetime64
354
-
355
- if cls.__PANDAS_MAJOR_VERSION == 2 and not temporal_objects_flag:
356
- # Use table.schema, it is always present and has been normalized if a separate schema was supplied
357
- return cls._fix_pandas_2_datetime_precision(df_from_arrow, table.schema)
358
- else:
359
- return df_from_arrow
360
-
361
- @classmethod
362
- def _fix_pandas_2_datetime_precision(cls, df: pd.DataFrame, schema: pa.Schema) -> pd.DataFrame:
363
-
364
- for field in schema:
365
- if pa.types.is_date(field.type):
366
- dtype = cls.__PANDAS_DATE_TYPE
367
- if df[field.name].dtype != dtype:
368
- df[field.name] = df[field.name].astype(dtype)
369
- if pa.types.is_timestamp(field.type):
370
- dtype = cls.__pandas_datetime_type(field.type.tz, field.type.unit)
371
- if df[field.name].dtype != dtype:
372
- df[field.name] = df[field.name].astype(dtype)
373
-
374
- return df
375
-
376
349
  @classmethod
377
350
  def pandas_to_arrow(cls, df: pd.DataFrame, schema: tp.Optional[pa.Schema] = None) -> pa.Table:
378
351
 
@@ -82,7 +82,11 @@ class StaticApiImpl(_StaticApiHook):
82
82
  param_type_descriptor = _meta.TypeDescriptor(param_type, None, None)
83
83
 
84
84
  if default_value is not None and not isinstance(default_value, _meta.Value):
85
- default_value = _type_system.MetadataCodec.encode_value(default_value)
85
+ try:
86
+ default_value = _type_system.MetadataCodec.convert_value(default_value, param_type_descriptor)
87
+ except _ex.ETrac as e:
88
+ msg = f"Default value for parameter [{param_name}] does not match the declared type"
89
+ raise _ex.EModelValidation(msg) from e
86
90
 
87
91
  return _Named(param_name, _meta.ModelParameter(param_type_descriptor, label, default_value))
88
92