mlrun 1.7.1rc10__py3-none-any.whl → 1.8.0rc11__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of mlrun might be problematic. Click here for more details.

Files changed (259) hide show
  1. mlrun/__init__.py +23 -21
  2. mlrun/__main__.py +3 -3
  3. mlrun/alerts/alert.py +148 -14
  4. mlrun/artifacts/__init__.py +2 -3
  5. mlrun/artifacts/base.py +55 -12
  6. mlrun/artifacts/dataset.py +16 -16
  7. mlrun/artifacts/document.py +378 -0
  8. mlrun/artifacts/manager.py +26 -17
  9. mlrun/artifacts/model.py +66 -53
  10. mlrun/common/constants.py +8 -0
  11. mlrun/common/formatters/__init__.py +1 -0
  12. mlrun/common/formatters/feature_set.py +1 -0
  13. mlrun/common/formatters/function.py +1 -0
  14. mlrun/{model_monitoring/db/stores/base/__init__.py → common/formatters/model_endpoint.py} +16 -1
  15. mlrun/common/formatters/pipeline.py +1 -2
  16. mlrun/common/formatters/project.py +9 -0
  17. mlrun/common/model_monitoring/__init__.py +0 -5
  18. mlrun/common/model_monitoring/helpers.py +1 -29
  19. mlrun/common/runtimes/constants.py +1 -2
  20. mlrun/common/schemas/__init__.py +6 -2
  21. mlrun/common/schemas/alert.py +111 -19
  22. mlrun/common/schemas/api_gateway.py +3 -3
  23. mlrun/common/schemas/artifact.py +11 -7
  24. mlrun/common/schemas/auth.py +6 -4
  25. mlrun/common/schemas/background_task.py +7 -7
  26. mlrun/common/schemas/client_spec.py +2 -3
  27. mlrun/common/schemas/clusterization_spec.py +2 -2
  28. mlrun/common/schemas/common.py +53 -3
  29. mlrun/common/schemas/constants.py +15 -0
  30. mlrun/common/schemas/datastore_profile.py +1 -1
  31. mlrun/common/schemas/feature_store.py +9 -9
  32. mlrun/common/schemas/frontend_spec.py +4 -4
  33. mlrun/common/schemas/function.py +10 -10
  34. mlrun/common/schemas/hub.py +1 -1
  35. mlrun/common/schemas/k8s.py +3 -3
  36. mlrun/common/schemas/memory_reports.py +3 -3
  37. mlrun/common/schemas/model_monitoring/__init__.py +2 -1
  38. mlrun/common/schemas/model_monitoring/constants.py +67 -14
  39. mlrun/common/schemas/model_monitoring/grafana.py +1 -1
  40. mlrun/common/schemas/model_monitoring/model_endpoints.py +92 -147
  41. mlrun/common/schemas/notification.py +24 -3
  42. mlrun/common/schemas/object.py +1 -1
  43. mlrun/common/schemas/pagination.py +4 -4
  44. mlrun/common/schemas/partition.py +137 -0
  45. mlrun/common/schemas/pipeline.py +2 -2
  46. mlrun/common/schemas/project.py +25 -17
  47. mlrun/common/schemas/runs.py +2 -2
  48. mlrun/common/schemas/runtime_resource.py +5 -5
  49. mlrun/common/schemas/schedule.py +1 -1
  50. mlrun/common/schemas/secret.py +1 -1
  51. mlrun/common/schemas/tag.py +3 -3
  52. mlrun/common/schemas/workflow.py +5 -5
  53. mlrun/config.py +68 -10
  54. mlrun/data_types/__init__.py +0 -2
  55. mlrun/data_types/data_types.py +1 -0
  56. mlrun/data_types/infer.py +3 -1
  57. mlrun/data_types/spark.py +5 -3
  58. mlrun/data_types/to_pandas.py +11 -2
  59. mlrun/datastore/__init__.py +2 -2
  60. mlrun/datastore/alibaba_oss.py +4 -1
  61. mlrun/datastore/azure_blob.py +4 -1
  62. mlrun/datastore/base.py +12 -4
  63. mlrun/datastore/datastore.py +9 -3
  64. mlrun/datastore/datastore_profile.py +79 -20
  65. mlrun/datastore/dbfs_store.py +4 -1
  66. mlrun/datastore/filestore.py +4 -1
  67. mlrun/datastore/google_cloud_storage.py +4 -1
  68. mlrun/datastore/hdfs.py +4 -1
  69. mlrun/datastore/inmem.py +4 -1
  70. mlrun/datastore/redis.py +4 -1
  71. mlrun/datastore/s3.py +4 -1
  72. mlrun/datastore/sources.py +52 -51
  73. mlrun/datastore/store_resources.py +7 -4
  74. mlrun/datastore/targets.py +23 -22
  75. mlrun/datastore/utils.py +2 -2
  76. mlrun/datastore/v3io.py +4 -1
  77. mlrun/datastore/vectorstore.py +229 -0
  78. mlrun/datastore/wasbfs/fs.py +13 -12
  79. mlrun/db/base.py +213 -83
  80. mlrun/db/factory.py +0 -3
  81. mlrun/db/httpdb.py +1265 -387
  82. mlrun/db/nopdb.py +205 -74
  83. mlrun/errors.py +2 -2
  84. mlrun/execution.py +136 -50
  85. mlrun/feature_store/__init__.py +0 -2
  86. mlrun/feature_store/api.py +41 -40
  87. mlrun/feature_store/common.py +9 -9
  88. mlrun/feature_store/feature_set.py +20 -18
  89. mlrun/feature_store/feature_vector.py +27 -24
  90. mlrun/feature_store/retrieval/base.py +14 -9
  91. mlrun/feature_store/retrieval/job.py +2 -1
  92. mlrun/feature_store/steps.py +2 -2
  93. mlrun/features.py +30 -13
  94. mlrun/frameworks/__init__.py +1 -2
  95. mlrun/frameworks/_common/__init__.py +1 -2
  96. mlrun/frameworks/_common/artifacts_library.py +2 -2
  97. mlrun/frameworks/_common/mlrun_interface.py +10 -6
  98. mlrun/frameworks/_common/model_handler.py +29 -27
  99. mlrun/frameworks/_common/producer.py +3 -1
  100. mlrun/frameworks/_dl_common/__init__.py +1 -2
  101. mlrun/frameworks/_dl_common/loggers/__init__.py +1 -2
  102. mlrun/frameworks/_dl_common/loggers/mlrun_logger.py +4 -4
  103. mlrun/frameworks/_dl_common/loggers/tensorboard_logger.py +3 -3
  104. mlrun/frameworks/_ml_common/__init__.py +1 -2
  105. mlrun/frameworks/_ml_common/loggers/__init__.py +1 -2
  106. mlrun/frameworks/_ml_common/model_handler.py +21 -21
  107. mlrun/frameworks/_ml_common/plans/__init__.py +1 -2
  108. mlrun/frameworks/_ml_common/plans/confusion_matrix_plan.py +3 -1
  109. mlrun/frameworks/_ml_common/plans/dataset_plan.py +3 -3
  110. mlrun/frameworks/_ml_common/plans/roc_curve_plan.py +4 -4
  111. mlrun/frameworks/auto_mlrun/__init__.py +1 -2
  112. mlrun/frameworks/auto_mlrun/auto_mlrun.py +22 -15
  113. mlrun/frameworks/huggingface/__init__.py +1 -2
  114. mlrun/frameworks/huggingface/model_server.py +9 -9
  115. mlrun/frameworks/lgbm/__init__.py +47 -44
  116. mlrun/frameworks/lgbm/callbacks/__init__.py +1 -2
  117. mlrun/frameworks/lgbm/callbacks/logging_callback.py +4 -2
  118. mlrun/frameworks/lgbm/callbacks/mlrun_logging_callback.py +4 -2
  119. mlrun/frameworks/lgbm/mlrun_interfaces/__init__.py +1 -2
  120. mlrun/frameworks/lgbm/mlrun_interfaces/mlrun_interface.py +5 -5
  121. mlrun/frameworks/lgbm/model_handler.py +15 -11
  122. mlrun/frameworks/lgbm/model_server.py +11 -7
  123. mlrun/frameworks/lgbm/utils.py +2 -2
  124. mlrun/frameworks/onnx/__init__.py +1 -2
  125. mlrun/frameworks/onnx/dataset.py +3 -3
  126. mlrun/frameworks/onnx/mlrun_interface.py +2 -2
  127. mlrun/frameworks/onnx/model_handler.py +7 -5
  128. mlrun/frameworks/onnx/model_server.py +8 -6
  129. mlrun/frameworks/parallel_coordinates.py +11 -11
  130. mlrun/frameworks/pytorch/__init__.py +22 -23
  131. mlrun/frameworks/pytorch/callbacks/__init__.py +1 -2
  132. mlrun/frameworks/pytorch/callbacks/callback.py +2 -1
  133. mlrun/frameworks/pytorch/callbacks/logging_callback.py +15 -8
  134. mlrun/frameworks/pytorch/callbacks/mlrun_logging_callback.py +19 -12
  135. mlrun/frameworks/pytorch/callbacks/tensorboard_logging_callback.py +22 -15
  136. mlrun/frameworks/pytorch/callbacks_handler.py +36 -30
  137. mlrun/frameworks/pytorch/mlrun_interface.py +17 -17
  138. mlrun/frameworks/pytorch/model_handler.py +21 -17
  139. mlrun/frameworks/pytorch/model_server.py +13 -9
  140. mlrun/frameworks/sklearn/__init__.py +19 -18
  141. mlrun/frameworks/sklearn/estimator.py +2 -2
  142. mlrun/frameworks/sklearn/metric.py +3 -3
  143. mlrun/frameworks/sklearn/metrics_library.py +8 -6
  144. mlrun/frameworks/sklearn/mlrun_interface.py +3 -2
  145. mlrun/frameworks/sklearn/model_handler.py +4 -3
  146. mlrun/frameworks/tf_keras/__init__.py +11 -12
  147. mlrun/frameworks/tf_keras/callbacks/__init__.py +1 -2
  148. mlrun/frameworks/tf_keras/callbacks/logging_callback.py +17 -14
  149. mlrun/frameworks/tf_keras/callbacks/mlrun_logging_callback.py +15 -12
  150. mlrun/frameworks/tf_keras/callbacks/tensorboard_logging_callback.py +21 -18
  151. mlrun/frameworks/tf_keras/model_handler.py +17 -13
  152. mlrun/frameworks/tf_keras/model_server.py +12 -8
  153. mlrun/frameworks/xgboost/__init__.py +19 -18
  154. mlrun/frameworks/xgboost/model_handler.py +13 -9
  155. mlrun/launcher/base.py +3 -4
  156. mlrun/launcher/local.py +1 -1
  157. mlrun/launcher/remote.py +1 -1
  158. mlrun/lists.py +4 -3
  159. mlrun/model.py +117 -46
  160. mlrun/model_monitoring/__init__.py +4 -4
  161. mlrun/model_monitoring/api.py +72 -59
  162. mlrun/model_monitoring/applications/_application_steps.py +17 -17
  163. mlrun/model_monitoring/applications/base.py +165 -6
  164. mlrun/model_monitoring/applications/context.py +88 -37
  165. mlrun/model_monitoring/applications/evidently_base.py +0 -1
  166. mlrun/model_monitoring/applications/histogram_data_drift.py +43 -21
  167. mlrun/model_monitoring/applications/results.py +55 -3
  168. mlrun/model_monitoring/controller.py +207 -239
  169. mlrun/model_monitoring/db/__init__.py +0 -2
  170. mlrun/model_monitoring/db/_schedules.py +156 -0
  171. mlrun/model_monitoring/db/_stats.py +189 -0
  172. mlrun/model_monitoring/db/tsdb/base.py +78 -25
  173. mlrun/model_monitoring/db/tsdb/tdengine/schemas.py +61 -6
  174. mlrun/model_monitoring/db/tsdb/tdengine/stream_graph_steps.py +33 -0
  175. mlrun/model_monitoring/db/tsdb/tdengine/tdengine_connector.py +255 -29
  176. mlrun/model_monitoring/db/tsdb/v3io/stream_graph_steps.py +1 -0
  177. mlrun/model_monitoring/db/tsdb/v3io/v3io_connector.py +78 -17
  178. mlrun/model_monitoring/helpers.py +151 -49
  179. mlrun/model_monitoring/stream_processing.py +99 -283
  180. mlrun/model_monitoring/tracking_policy.py +10 -3
  181. mlrun/model_monitoring/writer.py +48 -36
  182. mlrun/package/__init__.py +3 -6
  183. mlrun/package/context_handler.py +1 -1
  184. mlrun/package/packager.py +12 -9
  185. mlrun/package/packagers/__init__.py +0 -2
  186. mlrun/package/packagers/default_packager.py +14 -11
  187. mlrun/package/packagers/numpy_packagers.py +16 -7
  188. mlrun/package/packagers/pandas_packagers.py +18 -18
  189. mlrun/package/packagers/python_standard_library_packagers.py +25 -11
  190. mlrun/package/packagers_manager.py +31 -14
  191. mlrun/package/utils/__init__.py +0 -3
  192. mlrun/package/utils/_pickler.py +6 -6
  193. mlrun/platforms/__init__.py +47 -16
  194. mlrun/platforms/iguazio.py +4 -1
  195. mlrun/projects/operations.py +27 -27
  196. mlrun/projects/pipelines.py +71 -36
  197. mlrun/projects/project.py +890 -220
  198. mlrun/run.py +53 -10
  199. mlrun/runtimes/__init__.py +1 -3
  200. mlrun/runtimes/base.py +15 -11
  201. mlrun/runtimes/daskjob.py +9 -9
  202. mlrun/runtimes/generators.py +2 -1
  203. mlrun/runtimes/kubejob.py +4 -5
  204. mlrun/runtimes/mounts.py +572 -0
  205. mlrun/runtimes/mpijob/__init__.py +0 -2
  206. mlrun/runtimes/mpijob/abstract.py +7 -6
  207. mlrun/runtimes/nuclio/api_gateway.py +7 -7
  208. mlrun/runtimes/nuclio/application/application.py +11 -11
  209. mlrun/runtimes/nuclio/function.py +19 -17
  210. mlrun/runtimes/nuclio/serving.py +18 -13
  211. mlrun/runtimes/pod.py +154 -45
  212. mlrun/runtimes/remotesparkjob.py +3 -2
  213. mlrun/runtimes/sparkjob/__init__.py +0 -2
  214. mlrun/runtimes/sparkjob/spark3job.py +21 -11
  215. mlrun/runtimes/utils.py +6 -5
  216. mlrun/serving/merger.py +6 -4
  217. mlrun/serving/remote.py +18 -17
  218. mlrun/serving/routers.py +185 -172
  219. mlrun/serving/server.py +7 -1
  220. mlrun/serving/states.py +97 -78
  221. mlrun/serving/utils.py +13 -2
  222. mlrun/serving/v1_serving.py +3 -2
  223. mlrun/serving/v2_serving.py +105 -72
  224. mlrun/track/__init__.py +1 -1
  225. mlrun/track/tracker.py +2 -2
  226. mlrun/track/trackers/mlflow_tracker.py +6 -5
  227. mlrun/utils/async_http.py +1 -1
  228. mlrun/utils/clones.py +1 -1
  229. mlrun/utils/helpers.py +63 -19
  230. mlrun/utils/logger.py +106 -4
  231. mlrun/utils/notifications/notification/__init__.py +22 -19
  232. mlrun/utils/notifications/notification/base.py +33 -14
  233. mlrun/utils/notifications/notification/console.py +6 -6
  234. mlrun/utils/notifications/notification/git.py +11 -11
  235. mlrun/utils/notifications/notification/ipython.py +10 -9
  236. mlrun/utils/notifications/notification/mail.py +176 -0
  237. mlrun/utils/notifications/notification/slack.py +6 -6
  238. mlrun/utils/notifications/notification/webhook.py +6 -6
  239. mlrun/utils/notifications/notification_pusher.py +86 -44
  240. mlrun/utils/regex.py +11 -2
  241. mlrun/utils/version/version.json +2 -2
  242. {mlrun-1.7.1rc10.dist-info → mlrun-1.8.0rc11.dist-info}/METADATA +29 -24
  243. mlrun-1.8.0rc11.dist-info/RECORD +347 -0
  244. mlrun/model_monitoring/db/stores/__init__.py +0 -136
  245. mlrun/model_monitoring/db/stores/base/store.py +0 -213
  246. mlrun/model_monitoring/db/stores/sqldb/__init__.py +0 -13
  247. mlrun/model_monitoring/db/stores/sqldb/models/__init__.py +0 -71
  248. mlrun/model_monitoring/db/stores/sqldb/models/base.py +0 -190
  249. mlrun/model_monitoring/db/stores/sqldb/models/mysql.py +0 -103
  250. mlrun/model_monitoring/db/stores/sqldb/models/sqlite.py +0 -40
  251. mlrun/model_monitoring/db/stores/sqldb/sql_store.py +0 -659
  252. mlrun/model_monitoring/db/stores/v3io_kv/__init__.py +0 -13
  253. mlrun/model_monitoring/db/stores/v3io_kv/kv_store.py +0 -726
  254. mlrun/model_monitoring/model_endpoint.py +0 -118
  255. mlrun-1.7.1rc10.dist-info/RECORD +0 -351
  256. {mlrun-1.7.1rc10.dist-info → mlrun-1.8.0rc11.dist-info}/LICENSE +0 -0
  257. {mlrun-1.7.1rc10.dist-info → mlrun-1.8.0rc11.dist-info}/WHEEL +0 -0
  258. {mlrun-1.7.1rc10.dist-info → mlrun-1.8.0rc11.dist-info}/entry_points.txt +0 -0
  259. {mlrun-1.7.1rc10.dist-info → mlrun-1.8.0rc11.dist-info}/top_level.txt +0 -0
mlrun/db/nopdb.py CHANGED
@@ -22,6 +22,7 @@ import mlrun.common.runtimes.constants
22
22
  import mlrun.common.schemas
23
23
  import mlrun.errors
24
24
  import mlrun.lists
25
+ import mlrun.model_monitoring
25
26
 
26
27
  from ..config import config
27
28
  from ..utils import logger
@@ -104,7 +105,7 @@ class NopDB(RunDBInterface):
104
105
  name: Optional[str] = None,
105
106
  uid: Optional[Union[str, list[str]]] = None,
106
107
  project: Optional[str] = None,
107
- labels: Optional[Union[str, list[str]]] = None,
108
+ labels: Optional[Union[str, dict[str, Optional[str]], list[str]]] = None,
108
109
  state: Optional[
109
110
  mlrun.common.runtimes.constants.RunStates
110
111
  ] = None, # Backward compatibility
@@ -112,10 +113,10 @@ class NopDB(RunDBInterface):
112
113
  sort: bool = True,
113
114
  last: int = 0,
114
115
  iter: bool = False,
115
- start_time_from: datetime.datetime = None,
116
- start_time_to: datetime.datetime = None,
117
- last_update_time_from: datetime.datetime = None,
118
- last_update_time_to: datetime.datetime = None,
116
+ start_time_from: Optional[datetime.datetime] = None,
117
+ start_time_to: Optional[datetime.datetime] = None,
118
+ last_update_time_from: Optional[datetime.datetime] = None,
119
+ last_update_time_to: Optional[datetime.datetime] = None,
119
120
  partition_by: Union[mlrun.common.schemas.RunPartitionByField, str] = None,
120
121
  rows_per_partition: int = 1,
121
122
  partition_sort_by: Union[mlrun.common.schemas.SortField, str] = None,
@@ -127,10 +128,27 @@ class NopDB(RunDBInterface):
127
128
  ):
128
129
  return mlrun.lists.RunList()
129
130
 
131
+ def paginated_list_runs(
132
+ self,
133
+ *args,
134
+ page: Optional[int] = None,
135
+ page_size: Optional[int] = None,
136
+ page_token: Optional[str] = None,
137
+ **kwargs,
138
+ ):
139
+ return mlrun.lists.RunList(), None
140
+
130
141
  def del_run(self, uid, project="", iter=0):
131
142
  pass
132
143
 
133
- def del_runs(self, name="", project="", labels=None, state="", days_ago=0):
144
+ def del_runs(
145
+ self,
146
+ name: str = "",
147
+ project: str = "",
148
+ labels: Optional[Union[str, dict[str, Optional[str]], list[str]]] = None,
149
+ state: Optional[mlrun.common.runtimes.constants.RunStates] = None,
150
+ days_ago: int = 0,
151
+ ):
134
152
  pass
135
153
 
136
154
  def store_artifact(
@@ -155,19 +173,39 @@ class NopDB(RunDBInterface):
155
173
  name="",
156
174
  project="",
157
175
  tag="",
158
- labels=None,
176
+ labels: Optional[Union[str, dict[str, Optional[str]], list[str]]] = None,
159
177
  since=None,
160
178
  until=None,
161
- iter: int = None,
179
+ iter: Optional[int] = None,
162
180
  best_iteration: bool = False,
163
- kind: str = None,
181
+ kind: Optional[str] = None,
164
182
  category: Union[str, mlrun.common.schemas.ArtifactCategories] = None,
165
- tree: str = None,
183
+ tree: Optional[str] = None,
166
184
  format_: mlrun.common.formatters.ArtifactFormat = mlrun.common.formatters.ArtifactFormat.full,
167
- limit: int = None,
185
+ limit: Optional[int] = None,
186
+ partition_by: Optional[
187
+ Union[mlrun.common.schemas.ArtifactPartitionByField, str]
188
+ ] = None,
189
+ rows_per_partition: int = 1,
190
+ partition_sort_by: Optional[
191
+ Union[mlrun.common.schemas.SortField, str]
192
+ ] = mlrun.common.schemas.SortField.updated,
193
+ partition_order: Union[
194
+ mlrun.common.schemas.OrderType, str
195
+ ] = mlrun.common.schemas.OrderType.desc,
168
196
  ):
169
197
  return mlrun.lists.ArtifactList()
170
198
 
199
+ def paginated_list_artifacts(
200
+ self,
201
+ *args,
202
+ page: Optional[int] = None,
203
+ page_size: Optional[int] = None,
204
+ page_token: Optional[str] = None,
205
+ **kwargs,
206
+ ):
207
+ return mlrun.lists.ArtifactList(), None
208
+
171
209
  def del_artifact(
172
210
  self,
173
211
  key,
@@ -178,12 +216,18 @@ class NopDB(RunDBInterface):
178
216
  deletion_strategy: mlrun.common.schemas.artifact.ArtifactsDeletionStrategies = (
179
217
  mlrun.common.schemas.artifact.ArtifactsDeletionStrategies.metadata_only
180
218
  ),
181
- secrets: dict = None,
219
+ secrets: Optional[dict] = None,
182
220
  iter=None,
183
221
  ):
184
222
  pass
185
223
 
186
- def del_artifacts(self, name="", project="", tag="", labels=None):
224
+ def del_artifacts(
225
+ self,
226
+ name="",
227
+ project="",
228
+ tag="",
229
+ labels: Optional[Union[str, dict[str, Optional[str]], list[str]]] = None,
230
+ ):
187
231
  pass
188
232
 
189
233
  def store_function(self, function, name, project="", tag="", versioned=False):
@@ -196,10 +240,28 @@ class NopDB(RunDBInterface):
196
240
  pass
197
241
 
198
242
  def list_functions(
199
- self, name=None, project="", tag="", labels=None, since=None, until=None
243
+ self,
244
+ name: Optional[str] = None,
245
+ project: Optional[str] = None,
246
+ tag: Optional[str] = None,
247
+ kind: Optional[str] = None,
248
+ labels: Optional[Union[str, dict[str, Optional[str]], list[str]]] = None,
249
+ format_: mlrun.common.formatters.FunctionFormat = mlrun.common.formatters.FunctionFormat.full,
250
+ since: Optional[datetime.datetime] = None,
251
+ until: Optional[datetime.datetime] = None,
200
252
  ):
201
253
  return []
202
254
 
255
+ def paginated_list_functions(
256
+ self,
257
+ *args,
258
+ page: Optional[int] = None,
259
+ page_size: Optional[int] = None,
260
+ page_token: Optional[str] = None,
261
+ **kwargs,
262
+ ):
263
+ return [], None
264
+
203
265
  def tag_objects(
204
266
  self,
205
267
  project: str,
@@ -249,9 +311,9 @@ class NopDB(RunDBInterface):
249
311
 
250
312
  def list_projects(
251
313
  self,
252
- owner: str = None,
314
+ owner: Optional[str] = None,
253
315
  format_: mlrun.common.formatters.ProjectFormat = mlrun.common.formatters.ProjectFormat.name_only,
254
- labels: list[str] = None,
316
+ labels: Optional[Union[str, dict[str, Optional[str]], list[str]]] = None,
255
317
  state: mlrun.common.schemas.ProjectState = None,
256
318
  ) -> mlrun.common.schemas.ProjectsOutput:
257
319
  pass
@@ -275,49 +337,61 @@ class NopDB(RunDBInterface):
275
337
  pass
276
338
 
277
339
  def get_feature_set(
278
- self, name: str, project: str = "", tag: str = None, uid: str = None
340
+ self,
341
+ name: str,
342
+ project: str = "",
343
+ tag: Optional[str] = None,
344
+ uid: Optional[str] = None,
279
345
  ) -> dict:
280
346
  pass
281
347
 
282
348
  def list_features(
283
349
  self,
284
350
  project: str,
285
- name: str = None,
286
- tag: str = None,
287
- entities: list[str] = None,
288
- labels: list[str] = None,
351
+ name: Optional[str] = None,
352
+ tag: Optional[str] = None,
353
+ entities: Optional[list[str]] = None,
354
+ labels: Optional[Union[str, dict[str, Optional[str]], list[str]]] = None,
289
355
  ) -> mlrun.common.schemas.FeaturesOutput:
290
356
  pass
291
357
 
292
358
  def list_features_v2(
293
359
  self,
294
360
  project: str,
295
- name: str = None,
296
- tag: str = None,
297
- entities: list[str] = None,
298
- labels: list[str] = None,
361
+ name: Optional[str] = None,
362
+ tag: Optional[str] = None,
363
+ entities: Optional[list[str]] = None,
364
+ labels: Optional[Union[str, dict[str, Optional[str]], list[str]]] = None,
299
365
  ) -> mlrun.common.schemas.FeaturesOutputV2:
300
366
  pass
301
367
 
302
368
  def list_entities(
303
- self, project: str, name: str = None, tag: str = None, labels: list[str] = None
369
+ self,
370
+ project: str,
371
+ name: Optional[str] = None,
372
+ tag: Optional[str] = None,
373
+ labels: Optional[Union[str, dict[str, Optional[str]], list[str]]] = None,
304
374
  ) -> mlrun.common.schemas.EntitiesOutput:
305
375
  pass
306
376
 
307
377
  def list_entities_v2(
308
- self, project: str, name: str = None, tag: str = None, labels: list[str] = None
378
+ self,
379
+ project: str,
380
+ name: Optional[str] = None,
381
+ tag: Optional[str] = None,
382
+ labels: Optional[Union[str, dict[str, Optional[str]], list[str]]] = None,
309
383
  ) -> mlrun.common.schemas.EntitiesOutputV2:
310
384
  pass
311
385
 
312
386
  def list_feature_sets(
313
387
  self,
314
388
  project: str = "",
315
- name: str = None,
316
- tag: str = None,
317
- state: str = None,
318
- entities: list[str] = None,
319
- features: list[str] = None,
320
- labels: list[str] = None,
389
+ name: Optional[str] = None,
390
+ tag: Optional[str] = None,
391
+ state: Optional[str] = None,
392
+ entities: Optional[list[str]] = None,
393
+ features: Optional[list[str]] = None,
394
+ labels: Optional[Union[str, dict[str, Optional[str]], list[str]]] = None,
321
395
  partition_by: Union[
322
396
  mlrun.common.schemas.FeatureStorePartitionByField, str
323
397
  ] = None,
@@ -368,17 +442,21 @@ class NopDB(RunDBInterface):
368
442
  pass
369
443
 
370
444
  def get_feature_vector(
371
- self, name: str, project: str = "", tag: str = None, uid: str = None
445
+ self,
446
+ name: str,
447
+ project: str = "",
448
+ tag: Optional[str] = None,
449
+ uid: Optional[str] = None,
372
450
  ) -> dict:
373
451
  pass
374
452
 
375
453
  def list_feature_vectors(
376
454
  self,
377
455
  project: str = "",
378
- name: str = None,
379
- tag: str = None,
380
- state: str = None,
381
- labels: list[str] = None,
456
+ name: Optional[str] = None,
457
+ tag: Optional[str] = None,
458
+ state: Optional[str] = None,
459
+ labels: Optional[Union[str, dict[str, Optional[str]], list[str]]] = None,
382
460
  partition_by: Union[
383
461
  mlrun.common.schemas.FeatureStorePartitionByField, str
384
462
  ] = None,
@@ -420,26 +498,26 @@ class NopDB(RunDBInterface):
420
498
  def get_pipeline(
421
499
  self,
422
500
  run_id: str,
423
- namespace: str = None,
501
+ namespace: Optional[str] = None,
424
502
  timeout: int = 30,
425
503
  format_: Union[
426
504
  str, mlrun.common.formatters.PipelineFormat
427
505
  ] = mlrun.common.formatters.PipelineFormat.summary,
428
- project: str = None,
506
+ project: Optional[str] = None,
429
507
  ):
430
508
  pass
431
509
 
432
510
  def list_pipelines(
433
511
  self,
434
512
  project: str,
435
- namespace: str = None,
513
+ namespace: Optional[str] = None,
436
514
  sort_by: str = "",
437
515
  page_token: str = "",
438
516
  filter_: str = "",
439
517
  format_: Union[
440
518
  str, mlrun.common.formatters.PipelineFormat
441
519
  ] = mlrun.common.formatters.PipelineFormat.metadata_only,
442
- page_size: int = None,
520
+ page_size: Optional[int] = None,
443
521
  ) -> mlrun.common.schemas.PipelinesOutput:
444
522
  return mlrun.common.schemas.PipelinesOutput(runs=[], total_size=0)
445
523
 
@@ -449,7 +527,7 @@ class NopDB(RunDBInterface):
449
527
  provider: Union[
450
528
  str, mlrun.common.schemas.SecretProviderName
451
529
  ] = mlrun.common.schemas.SecretProviderName.kubernetes,
452
- secrets: dict = None,
530
+ secrets: Optional[dict] = None,
453
531
  ):
454
532
  pass
455
533
 
@@ -460,7 +538,7 @@ class NopDB(RunDBInterface):
460
538
  provider: Union[
461
539
  str, mlrun.common.schemas.SecretProviderName
462
540
  ] = mlrun.common.schemas.SecretProviderName.kubernetes,
463
- secrets: list[str] = None,
541
+ secrets: Optional[list[str]] = None,
464
542
  ) -> mlrun.common.schemas.SecretsData:
465
543
  pass
466
544
 
@@ -470,7 +548,7 @@ class NopDB(RunDBInterface):
470
548
  provider: Union[
471
549
  str, mlrun.common.schemas.SecretProviderName
472
550
  ] = mlrun.common.schemas.SecretProviderName.kubernetes,
473
- token: str = None,
551
+ token: Optional[str] = None,
474
552
  ) -> mlrun.common.schemas.SecretKeysData:
475
553
  pass
476
554
 
@@ -480,7 +558,7 @@ class NopDB(RunDBInterface):
480
558
  provider: Union[
481
559
  str, mlrun.common.schemas.SecretProviderName
482
560
  ] = mlrun.common.schemas.SecretProviderName.kubernetes,
483
- secrets: list[str] = None,
561
+ secrets: Optional[list[str]] = None,
484
562
  ):
485
563
  pass
486
564
 
@@ -490,45 +568,64 @@ class NopDB(RunDBInterface):
490
568
  provider: Union[
491
569
  str, mlrun.common.schemas.SecretProviderName
492
570
  ] = mlrun.common.schemas.SecretProviderName.vault,
493
- secrets: dict = None,
571
+ secrets: Optional[dict] = None,
494
572
  ):
495
573
  pass
496
574
 
497
575
  def create_model_endpoint(
498
576
  self,
499
- project: str,
500
- endpoint_id: str,
501
577
  model_endpoint: mlrun.common.schemas.ModelEndpoint,
502
- ):
578
+ ) -> mlrun.common.schemas.ModelEndpoint:
503
579
  pass
504
580
 
505
- def delete_model_endpoint(self, project: str, endpoint_id: str):
581
+ def delete_model_endpoint(
582
+ self,
583
+ name: str,
584
+ project: str,
585
+ function_name: Optional[str] = None,
586
+ function_tag: Optional[str] = None,
587
+ endpoint_id: Optional[str] = None,
588
+ ):
506
589
  pass
507
590
 
508
591
  def list_model_endpoints(
509
592
  self,
510
593
  project: str,
511
- model: Optional[str] = None,
512
- function: Optional[str] = None,
513
- labels: list[str] = None,
514
- start: str = "now-1h",
515
- end: str = "now",
516
- metrics: Optional[list[str]] = None,
517
- ):
594
+ name: Optional[str] = None,
595
+ function_name: Optional[str] = None,
596
+ function_tag: Optional[str] = None,
597
+ model_name: Optional[str] = None,
598
+ labels: Optional[Union[str, dict[str, Optional[str]], list[str]]] = None,
599
+ start: Optional[datetime.datetime] = None,
600
+ end: Optional[datetime.datetime] = None,
601
+ tsdb_metrics: bool = True,
602
+ top_level: bool = False,
603
+ uids: Optional[list[str]] = None,
604
+ latest_only: bool = False,
605
+ ) -> mlrun.common.schemas.ModelEndpointList:
518
606
  pass
519
607
 
520
608
  def get_model_endpoint(
521
609
  self,
610
+ name: str,
522
611
  project: str,
523
- endpoint_id: str,
524
- start: Optional[str] = None,
525
- end: Optional[str] = None,
526
- metrics: Optional[list[str]] = None,
527
- features: bool = False,
528
- ):
612
+ function_name: Optional[str] = None,
613
+ function_tag: Optional[str] = None,
614
+ endpoint_id: Optional[str] = None,
615
+ tsdb_metrics: bool = True,
616
+ feature_analysis: bool = False,
617
+ ) -> mlrun.common.schemas.ModelEndpoint:
529
618
  pass
530
619
 
531
- def patch_model_endpoint(self, project: str, endpoint_id: str, attributes: dict):
620
+ def patch_model_endpoint(
621
+ self,
622
+ name: str,
623
+ project: str,
624
+ attributes: dict,
625
+ function_name: Optional[str] = None,
626
+ function_tag: Optional[str] = None,
627
+ endpoint_id: Optional[str] = None,
628
+ ) -> mlrun.common.schemas.ModelEndpoint:
532
629
  pass
533
630
 
534
631
  def create_hub_source(
@@ -560,9 +657,9 @@ class NopDB(RunDBInterface):
560
657
  def get_hub_catalog(
561
658
  self,
562
659
  source_name: str,
563
- channel: str = None,
564
- version: str = None,
565
- tag: str = None,
660
+ channel: Optional[str] = None,
661
+ version: Optional[str] = None,
662
+ tag: Optional[str] = None,
566
663
  force_refresh: bool = False,
567
664
  ):
568
665
  pass
@@ -572,7 +669,7 @@ class NopDB(RunDBInterface):
572
669
  source_name: str,
573
670
  item_name: str,
574
671
  channel: str = "development",
575
- version: str = None,
672
+ version: Optional[str] = None,
576
673
  tag: str = "latest",
577
674
  force_refresh: bool = False,
578
675
  ):
@@ -584,7 +681,7 @@ class NopDB(RunDBInterface):
584
681
  mlrun.common.schemas.APIGateway,
585
682
  mlrun.runtimes.nuclio.api_gateway.APIGateway,
586
683
  ],
587
- project: str = None,
684
+ project: Optional[str] = None,
588
685
  ) -> mlrun.common.schemas.APIGateway:
589
686
  pass
590
687
 
@@ -628,6 +725,7 @@ class NopDB(RunDBInterface):
628
725
  logs: bool = True,
629
726
  last_log_timestamp: float = 0.0,
630
727
  verbose: bool = False,
728
+ events_offset: int = 0,
631
729
  ):
632
730
  pass
633
731
 
@@ -651,7 +749,7 @@ class NopDB(RunDBInterface):
651
749
  self,
652
750
  notification_objects: list[mlrun.model.Notification],
653
751
  run_uid: str,
654
- project: str = None,
752
+ project: Optional[str] = None,
655
753
  mask_params: bool = True,
656
754
  ):
657
755
  pass
@@ -694,7 +792,9 @@ class NopDB(RunDBInterface):
694
792
  pass
695
793
 
696
794
  def start_function(
697
- self, func_url: str = None, function: "mlrun.runtimes.BaseRuntime" = None
795
+ self,
796
+ func_url: Optional[str] = None,
797
+ function: "mlrun.runtimes.BaseRuntime" = None,
698
798
  ):
699
799
  pass
700
800
 
@@ -712,7 +812,7 @@ class NopDB(RunDBInterface):
712
812
  source: Optional[str] = None,
713
813
  run_name: Optional[str] = None,
714
814
  namespace: Optional[str] = None,
715
- notifications: list["mlrun.model.Notification"] = None,
815
+ notifications: Optional[list["mlrun.model.Notification"]] = None,
716
816
  ) -> "mlrun.common.schemas.WorkflowResponse":
717
817
  pass
718
818
 
@@ -742,7 +842,7 @@ class NopDB(RunDBInterface):
742
842
  delete_stream_function: bool = False,
743
843
  delete_histogram_data_drift_app: bool = True,
744
844
  delete_user_applications: bool = False,
745
- user_application_list: list[str] = None,
845
+ user_application_list: Optional[list[str]] = None,
746
846
  ) -> bool:
747
847
  pass
748
848
 
@@ -774,6 +874,7 @@ class NopDB(RunDBInterface):
774
874
  alert_name: str,
775
875
  alert_data: Union[dict, mlrun.alerts.alert.AlertConfig],
776
876
  project="",
877
+ force_reset: bool = False,
777
878
  ):
778
879
  pass
779
880
 
@@ -794,3 +895,33 @@ class NopDB(RunDBInterface):
794
895
 
795
896
  def list_alert_templates(self):
796
897
  pass
898
+
899
+ def list_alert_activations(
900
+ self,
901
+ project: Optional[str] = None,
902
+ name: Optional[str] = None,
903
+ since: Optional[datetime.datetime] = None,
904
+ until: Optional[datetime.datetime] = None,
905
+ entity: Optional[str] = None,
906
+ severity: Optional[
907
+ list[Union[mlrun.common.schemas.alert.AlertSeverity, str]]
908
+ ] = None,
909
+ entity_kind: Optional[
910
+ Union[mlrun.common.schemas.alert.EventEntityKind, str]
911
+ ] = None,
912
+ event_kind: Optional[Union[mlrun.common.schemas.alert.EventKind, str]] = None,
913
+ ):
914
+ pass
915
+
916
+ def paginated_list_alert_activations(
917
+ self,
918
+ *args,
919
+ page: Optional[int] = None,
920
+ page_size: Optional[int] = None,
921
+ page_token: Optional[str] = None,
922
+ **kwargs,
923
+ ):
924
+ pass
925
+
926
+ def get_project_summary(self, project: str):
927
+ pass
mlrun/errors.py CHANGED
@@ -86,7 +86,7 @@ def raise_for_status(
86
86
  requests.Response,
87
87
  aiohttp.ClientResponse,
88
88
  ],
89
- message: str = None,
89
+ message: typing.Optional[str] = None,
90
90
  ):
91
91
  """
92
92
  Raise a specific MLRunSDK error depending on the given response status code.
@@ -107,7 +107,7 @@ def raise_for_status(
107
107
  raise MLRunHTTPError(error_message, response=response) from exc
108
108
 
109
109
 
110
- def err_for_status_code(status_code: int, message: str = None):
110
+ def err_for_status_code(status_code: int, message: typing.Optional[str] = None):
111
111
  """
112
112
  Return a specific MLRunSDK error depending on the given response status code.
113
113
  If no specific error exists, returns an MLRunHTTPError.