mlrun 1.7.1rc10__py3-none-any.whl → 1.8.0rc8__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 (257) 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 +1 -2
  5. mlrun/artifacts/base.py +46 -12
  6. mlrun/artifacts/dataset.py +16 -16
  7. mlrun/artifacts/document.py +334 -0
  8. mlrun/artifacts/manager.py +15 -13
  9. mlrun/artifacts/model.py +66 -53
  10. mlrun/common/constants.py +7 -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 +66 -14
  39. mlrun/common/schemas/model_monitoring/grafana.py +1 -1
  40. mlrun/common/schemas/model_monitoring/model_endpoints.py +91 -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 +67 -10
  54. mlrun/data_types/__init__.py +0 -2
  55. mlrun/data_types/infer.py +3 -1
  56. mlrun/data_types/spark.py +2 -1
  57. mlrun/datastore/__init__.py +0 -2
  58. mlrun/datastore/alibaba_oss.py +4 -1
  59. mlrun/datastore/azure_blob.py +4 -1
  60. mlrun/datastore/base.py +12 -4
  61. mlrun/datastore/datastore.py +9 -3
  62. mlrun/datastore/datastore_profile.py +79 -20
  63. mlrun/datastore/dbfs_store.py +4 -1
  64. mlrun/datastore/filestore.py +4 -1
  65. mlrun/datastore/google_cloud_storage.py +4 -1
  66. mlrun/datastore/hdfs.py +4 -1
  67. mlrun/datastore/inmem.py +4 -1
  68. mlrun/datastore/redis.py +4 -1
  69. mlrun/datastore/s3.py +4 -1
  70. mlrun/datastore/sources.py +52 -51
  71. mlrun/datastore/store_resources.py +0 -2
  72. mlrun/datastore/targets.py +21 -21
  73. mlrun/datastore/utils.py +2 -2
  74. mlrun/datastore/v3io.py +4 -1
  75. mlrun/datastore/vectorstore.py +194 -0
  76. mlrun/datastore/wasbfs/fs.py +13 -12
  77. mlrun/db/base.py +208 -82
  78. mlrun/db/factory.py +0 -3
  79. mlrun/db/httpdb.py +1237 -386
  80. mlrun/db/nopdb.py +201 -74
  81. mlrun/errors.py +2 -2
  82. mlrun/execution.py +136 -50
  83. mlrun/feature_store/__init__.py +0 -2
  84. mlrun/feature_store/api.py +41 -40
  85. mlrun/feature_store/common.py +9 -9
  86. mlrun/feature_store/feature_set.py +20 -18
  87. mlrun/feature_store/feature_vector.py +27 -24
  88. mlrun/feature_store/retrieval/base.py +14 -9
  89. mlrun/feature_store/retrieval/job.py +2 -1
  90. mlrun/feature_store/steps.py +2 -2
  91. mlrun/features.py +30 -13
  92. mlrun/frameworks/__init__.py +1 -2
  93. mlrun/frameworks/_common/__init__.py +1 -2
  94. mlrun/frameworks/_common/artifacts_library.py +2 -2
  95. mlrun/frameworks/_common/mlrun_interface.py +10 -6
  96. mlrun/frameworks/_common/model_handler.py +29 -27
  97. mlrun/frameworks/_common/producer.py +3 -1
  98. mlrun/frameworks/_dl_common/__init__.py +1 -2
  99. mlrun/frameworks/_dl_common/loggers/__init__.py +1 -2
  100. mlrun/frameworks/_dl_common/loggers/mlrun_logger.py +4 -4
  101. mlrun/frameworks/_dl_common/loggers/tensorboard_logger.py +3 -3
  102. mlrun/frameworks/_ml_common/__init__.py +1 -2
  103. mlrun/frameworks/_ml_common/loggers/__init__.py +1 -2
  104. mlrun/frameworks/_ml_common/model_handler.py +21 -21
  105. mlrun/frameworks/_ml_common/plans/__init__.py +1 -2
  106. mlrun/frameworks/_ml_common/plans/confusion_matrix_plan.py +3 -1
  107. mlrun/frameworks/_ml_common/plans/dataset_plan.py +3 -3
  108. mlrun/frameworks/_ml_common/plans/roc_curve_plan.py +4 -4
  109. mlrun/frameworks/auto_mlrun/__init__.py +1 -2
  110. mlrun/frameworks/auto_mlrun/auto_mlrun.py +22 -15
  111. mlrun/frameworks/huggingface/__init__.py +1 -2
  112. mlrun/frameworks/huggingface/model_server.py +9 -9
  113. mlrun/frameworks/lgbm/__init__.py +47 -44
  114. mlrun/frameworks/lgbm/callbacks/__init__.py +1 -2
  115. mlrun/frameworks/lgbm/callbacks/logging_callback.py +4 -2
  116. mlrun/frameworks/lgbm/callbacks/mlrun_logging_callback.py +4 -2
  117. mlrun/frameworks/lgbm/mlrun_interfaces/__init__.py +1 -2
  118. mlrun/frameworks/lgbm/mlrun_interfaces/mlrun_interface.py +5 -5
  119. mlrun/frameworks/lgbm/model_handler.py +15 -11
  120. mlrun/frameworks/lgbm/model_server.py +11 -7
  121. mlrun/frameworks/lgbm/utils.py +2 -2
  122. mlrun/frameworks/onnx/__init__.py +1 -2
  123. mlrun/frameworks/onnx/dataset.py +3 -3
  124. mlrun/frameworks/onnx/mlrun_interface.py +2 -2
  125. mlrun/frameworks/onnx/model_handler.py +7 -5
  126. mlrun/frameworks/onnx/model_server.py +8 -6
  127. mlrun/frameworks/parallel_coordinates.py +11 -11
  128. mlrun/frameworks/pytorch/__init__.py +22 -23
  129. mlrun/frameworks/pytorch/callbacks/__init__.py +1 -2
  130. mlrun/frameworks/pytorch/callbacks/callback.py +2 -1
  131. mlrun/frameworks/pytorch/callbacks/logging_callback.py +15 -8
  132. mlrun/frameworks/pytorch/callbacks/mlrun_logging_callback.py +19 -12
  133. mlrun/frameworks/pytorch/callbacks/tensorboard_logging_callback.py +22 -15
  134. mlrun/frameworks/pytorch/callbacks_handler.py +36 -30
  135. mlrun/frameworks/pytorch/mlrun_interface.py +17 -17
  136. mlrun/frameworks/pytorch/model_handler.py +21 -17
  137. mlrun/frameworks/pytorch/model_server.py +13 -9
  138. mlrun/frameworks/sklearn/__init__.py +19 -18
  139. mlrun/frameworks/sklearn/estimator.py +2 -2
  140. mlrun/frameworks/sklearn/metric.py +3 -3
  141. mlrun/frameworks/sklearn/metrics_library.py +8 -6
  142. mlrun/frameworks/sklearn/mlrun_interface.py +3 -2
  143. mlrun/frameworks/sklearn/model_handler.py +4 -3
  144. mlrun/frameworks/tf_keras/__init__.py +11 -12
  145. mlrun/frameworks/tf_keras/callbacks/__init__.py +1 -2
  146. mlrun/frameworks/tf_keras/callbacks/logging_callback.py +17 -14
  147. mlrun/frameworks/tf_keras/callbacks/mlrun_logging_callback.py +15 -12
  148. mlrun/frameworks/tf_keras/callbacks/tensorboard_logging_callback.py +21 -18
  149. mlrun/frameworks/tf_keras/model_handler.py +17 -13
  150. mlrun/frameworks/tf_keras/model_server.py +12 -8
  151. mlrun/frameworks/xgboost/__init__.py +19 -18
  152. mlrun/frameworks/xgboost/model_handler.py +13 -9
  153. mlrun/launcher/base.py +3 -4
  154. mlrun/launcher/local.py +1 -1
  155. mlrun/launcher/remote.py +1 -1
  156. mlrun/lists.py +4 -3
  157. mlrun/model.py +117 -46
  158. mlrun/model_monitoring/__init__.py +4 -4
  159. mlrun/model_monitoring/api.py +61 -59
  160. mlrun/model_monitoring/applications/_application_steps.py +17 -17
  161. mlrun/model_monitoring/applications/base.py +165 -6
  162. mlrun/model_monitoring/applications/context.py +88 -37
  163. mlrun/model_monitoring/applications/evidently_base.py +0 -1
  164. mlrun/model_monitoring/applications/histogram_data_drift.py +43 -21
  165. mlrun/model_monitoring/applications/results.py +55 -3
  166. mlrun/model_monitoring/controller.py +207 -239
  167. mlrun/model_monitoring/db/__init__.py +0 -2
  168. mlrun/model_monitoring/db/_schedules.py +156 -0
  169. mlrun/model_monitoring/db/_stats.py +189 -0
  170. mlrun/model_monitoring/db/tsdb/base.py +78 -25
  171. mlrun/model_monitoring/db/tsdb/tdengine/schemas.py +61 -6
  172. mlrun/model_monitoring/db/tsdb/tdengine/stream_graph_steps.py +33 -0
  173. mlrun/model_monitoring/db/tsdb/tdengine/tdengine_connector.py +255 -29
  174. mlrun/model_monitoring/db/tsdb/v3io/stream_graph_steps.py +1 -0
  175. mlrun/model_monitoring/db/tsdb/v3io/v3io_connector.py +78 -17
  176. mlrun/model_monitoring/helpers.py +152 -49
  177. mlrun/model_monitoring/stream_processing.py +99 -283
  178. mlrun/model_monitoring/tracking_policy.py +10 -3
  179. mlrun/model_monitoring/writer.py +48 -36
  180. mlrun/package/__init__.py +3 -6
  181. mlrun/package/context_handler.py +1 -1
  182. mlrun/package/packager.py +12 -9
  183. mlrun/package/packagers/__init__.py +0 -2
  184. mlrun/package/packagers/default_packager.py +14 -11
  185. mlrun/package/packagers/numpy_packagers.py +16 -7
  186. mlrun/package/packagers/pandas_packagers.py +18 -18
  187. mlrun/package/packagers/python_standard_library_packagers.py +25 -11
  188. mlrun/package/packagers_manager.py +31 -14
  189. mlrun/package/utils/__init__.py +0 -3
  190. mlrun/package/utils/_pickler.py +6 -6
  191. mlrun/platforms/__init__.py +47 -16
  192. mlrun/platforms/iguazio.py +4 -1
  193. mlrun/projects/operations.py +27 -27
  194. mlrun/projects/pipelines.py +71 -36
  195. mlrun/projects/project.py +865 -206
  196. mlrun/run.py +53 -10
  197. mlrun/runtimes/__init__.py +1 -3
  198. mlrun/runtimes/base.py +15 -11
  199. mlrun/runtimes/daskjob.py +9 -9
  200. mlrun/runtimes/generators.py +2 -1
  201. mlrun/runtimes/kubejob.py +4 -5
  202. mlrun/runtimes/mounts.py +572 -0
  203. mlrun/runtimes/mpijob/__init__.py +0 -2
  204. mlrun/runtimes/mpijob/abstract.py +7 -6
  205. mlrun/runtimes/nuclio/api_gateway.py +7 -7
  206. mlrun/runtimes/nuclio/application/application.py +11 -11
  207. mlrun/runtimes/nuclio/function.py +19 -17
  208. mlrun/runtimes/nuclio/serving.py +18 -11
  209. mlrun/runtimes/pod.py +154 -45
  210. mlrun/runtimes/remotesparkjob.py +3 -2
  211. mlrun/runtimes/sparkjob/__init__.py +0 -2
  212. mlrun/runtimes/sparkjob/spark3job.py +21 -11
  213. mlrun/runtimes/utils.py +6 -5
  214. mlrun/serving/merger.py +6 -4
  215. mlrun/serving/remote.py +18 -17
  216. mlrun/serving/routers.py +185 -172
  217. mlrun/serving/server.py +7 -1
  218. mlrun/serving/states.py +97 -78
  219. mlrun/serving/utils.py +13 -2
  220. mlrun/serving/v1_serving.py +3 -2
  221. mlrun/serving/v2_serving.py +74 -65
  222. mlrun/track/__init__.py +1 -1
  223. mlrun/track/tracker.py +2 -2
  224. mlrun/track/trackers/mlflow_tracker.py +6 -5
  225. mlrun/utils/async_http.py +1 -1
  226. mlrun/utils/clones.py +1 -1
  227. mlrun/utils/helpers.py +54 -16
  228. mlrun/utils/logger.py +106 -4
  229. mlrun/utils/notifications/notification/__init__.py +22 -19
  230. mlrun/utils/notifications/notification/base.py +33 -14
  231. mlrun/utils/notifications/notification/console.py +6 -6
  232. mlrun/utils/notifications/notification/git.py +11 -11
  233. mlrun/utils/notifications/notification/ipython.py +10 -9
  234. mlrun/utils/notifications/notification/mail.py +176 -0
  235. mlrun/utils/notifications/notification/slack.py +6 -6
  236. mlrun/utils/notifications/notification/webhook.py +6 -6
  237. mlrun/utils/notifications/notification_pusher.py +86 -44
  238. mlrun/utils/regex.py +3 -1
  239. mlrun/utils/version/version.json +2 -2
  240. {mlrun-1.7.1rc10.dist-info → mlrun-1.8.0rc8.dist-info}/METADATA +21 -16
  241. mlrun-1.8.0rc8.dist-info/RECORD +347 -0
  242. mlrun/model_monitoring/db/stores/__init__.py +0 -136
  243. mlrun/model_monitoring/db/stores/base/store.py +0 -213
  244. mlrun/model_monitoring/db/stores/sqldb/__init__.py +0 -13
  245. mlrun/model_monitoring/db/stores/sqldb/models/__init__.py +0 -71
  246. mlrun/model_monitoring/db/stores/sqldb/models/base.py +0 -190
  247. mlrun/model_monitoring/db/stores/sqldb/models/mysql.py +0 -103
  248. mlrun/model_monitoring/db/stores/sqldb/models/sqlite.py +0 -40
  249. mlrun/model_monitoring/db/stores/sqldb/sql_store.py +0 -659
  250. mlrun/model_monitoring/db/stores/v3io_kv/__init__.py +0 -13
  251. mlrun/model_monitoring/db/stores/v3io_kv/kv_store.py +0 -726
  252. mlrun/model_monitoring/model_endpoint.py +0 -118
  253. mlrun-1.7.1rc10.dist-info/RECORD +0 -351
  254. {mlrun-1.7.1rc10.dist-info → mlrun-1.8.0rc8.dist-info}/LICENSE +0 -0
  255. {mlrun-1.7.1rc10.dist-info → mlrun-1.8.0rc8.dist-info}/WHEEL +0 -0
  256. {mlrun-1.7.1rc10.dist-info → mlrun-1.8.0rc8.dist-info}/entry_points.txt +0 -0
  257. {mlrun-1.7.1rc10.dist-info → mlrun-1.8.0rc8.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,60 @@ 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: str,
586
+ endpoint_id: str,
587
+ ):
506
588
  pass
507
589
 
508
590
  def list_model_endpoints(
509
591
  self,
510
592
  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
- ):
593
+ name: Optional[str] = None,
594
+ function_name: Optional[str] = None,
595
+ model_name: Optional[str] = None,
596
+ labels: Optional[Union[str, dict[str, Optional[str]], list[str]]] = None,
597
+ start: Optional[datetime.datetime] = None,
598
+ end: Optional[datetime.datetime] = None,
599
+ tsdb_metrics: bool = True,
600
+ top_level: bool = False,
601
+ uids: Optional[list[str]] = None,
602
+ latest_only: bool = False,
603
+ ) -> mlrun.common.schemas.ModelEndpointList:
518
604
  pass
519
605
 
520
606
  def get_model_endpoint(
521
607
  self,
608
+ name: str,
522
609
  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
- ):
610
+ function_name: Optional[str] = None,
611
+ endpoint_id: Optional[str] = None,
612
+ tsdb_metrics: bool = True,
613
+ feature_analysis: bool = False,
614
+ ) -> mlrun.common.schemas.ModelEndpoint:
529
615
  pass
530
616
 
531
- def patch_model_endpoint(self, project: str, endpoint_id: str, attributes: dict):
617
+ def patch_model_endpoint(
618
+ self,
619
+ name: str,
620
+ project: str,
621
+ attributes: dict,
622
+ function_name: Optional[str] = None,
623
+ endpoint_id: Optional[str] = None,
624
+ ) -> mlrun.common.schemas.ModelEndpoint:
532
625
  pass
533
626
 
534
627
  def create_hub_source(
@@ -560,9 +653,9 @@ class NopDB(RunDBInterface):
560
653
  def get_hub_catalog(
561
654
  self,
562
655
  source_name: str,
563
- channel: str = None,
564
- version: str = None,
565
- tag: str = None,
656
+ channel: Optional[str] = None,
657
+ version: Optional[str] = None,
658
+ tag: Optional[str] = None,
566
659
  force_refresh: bool = False,
567
660
  ):
568
661
  pass
@@ -572,7 +665,7 @@ class NopDB(RunDBInterface):
572
665
  source_name: str,
573
666
  item_name: str,
574
667
  channel: str = "development",
575
- version: str = None,
668
+ version: Optional[str] = None,
576
669
  tag: str = "latest",
577
670
  force_refresh: bool = False,
578
671
  ):
@@ -584,7 +677,7 @@ class NopDB(RunDBInterface):
584
677
  mlrun.common.schemas.APIGateway,
585
678
  mlrun.runtimes.nuclio.api_gateway.APIGateway,
586
679
  ],
587
- project: str = None,
680
+ project: Optional[str] = None,
588
681
  ) -> mlrun.common.schemas.APIGateway:
589
682
  pass
590
683
 
@@ -628,6 +721,7 @@ class NopDB(RunDBInterface):
628
721
  logs: bool = True,
629
722
  last_log_timestamp: float = 0.0,
630
723
  verbose: bool = False,
724
+ events_offset: int = 0,
631
725
  ):
632
726
  pass
633
727
 
@@ -651,7 +745,7 @@ class NopDB(RunDBInterface):
651
745
  self,
652
746
  notification_objects: list[mlrun.model.Notification],
653
747
  run_uid: str,
654
- project: str = None,
748
+ project: Optional[str] = None,
655
749
  mask_params: bool = True,
656
750
  ):
657
751
  pass
@@ -694,7 +788,9 @@ class NopDB(RunDBInterface):
694
788
  pass
695
789
 
696
790
  def start_function(
697
- self, func_url: str = None, function: "mlrun.runtimes.BaseRuntime" = None
791
+ self,
792
+ func_url: Optional[str] = None,
793
+ function: "mlrun.runtimes.BaseRuntime" = None,
698
794
  ):
699
795
  pass
700
796
 
@@ -712,7 +808,7 @@ class NopDB(RunDBInterface):
712
808
  source: Optional[str] = None,
713
809
  run_name: Optional[str] = None,
714
810
  namespace: Optional[str] = None,
715
- notifications: list["mlrun.model.Notification"] = None,
811
+ notifications: Optional[list["mlrun.model.Notification"]] = None,
716
812
  ) -> "mlrun.common.schemas.WorkflowResponse":
717
813
  pass
718
814
 
@@ -742,7 +838,7 @@ class NopDB(RunDBInterface):
742
838
  delete_stream_function: bool = False,
743
839
  delete_histogram_data_drift_app: bool = True,
744
840
  delete_user_applications: bool = False,
745
- user_application_list: list[str] = None,
841
+ user_application_list: Optional[list[str]] = None,
746
842
  ) -> bool:
747
843
  pass
748
844
 
@@ -774,6 +870,7 @@ class NopDB(RunDBInterface):
774
870
  alert_name: str,
775
871
  alert_data: Union[dict, mlrun.alerts.alert.AlertConfig],
776
872
  project="",
873
+ force_reset: bool = False,
777
874
  ):
778
875
  pass
779
876
 
@@ -794,3 +891,33 @@ class NopDB(RunDBInterface):
794
891
 
795
892
  def list_alert_templates(self):
796
893
  pass
894
+
895
+ def list_alert_activations(
896
+ self,
897
+ project: Optional[str] = None,
898
+ name: Optional[str] = None,
899
+ since: Optional[datetime.datetime] = None,
900
+ until: Optional[datetime.datetime] = None,
901
+ entity: Optional[str] = None,
902
+ severity: Optional[
903
+ list[Union[mlrun.common.schemas.alert.AlertSeverity, str]]
904
+ ] = None,
905
+ entity_kind: Optional[
906
+ Union[mlrun.common.schemas.alert.EventEntityKind, str]
907
+ ] = None,
908
+ event_kind: Optional[Union[mlrun.common.schemas.alert.EventKind, str]] = None,
909
+ ):
910
+ pass
911
+
912
+ def paginated_list_alert_activations(
913
+ self,
914
+ *args,
915
+ page: Optional[int] = None,
916
+ page_size: Optional[int] = None,
917
+ page_token: Optional[str] = None,
918
+ **kwargs,
919
+ ):
920
+ pass
921
+
922
+ def get_project_summary(self, project: str):
923
+ 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.