mlrun 1.7.1rc10__py3-none-any.whl → 1.7.2rc3__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.

@@ -47,6 +47,12 @@ class ArtifactCategories(mlrun.common.types.StrEnum):
47
47
  True,
48
48
  )
49
49
 
50
+ @classmethod
51
+ def from_kind(cls, kind: str) -> "ArtifactCategories":
52
+ if kind in [cls.model.value, cls.dataset.value]:
53
+ return cls(kind)
54
+ return cls.other
55
+
50
56
 
51
57
  class ArtifactIdentifier(pydantic.BaseModel):
52
58
  # artifact kind
mlrun/config.py CHANGED
@@ -120,6 +120,14 @@ default_config = {
120
120
  "projects": {
121
121
  "summaries": {
122
122
  "cache_interval": "30",
123
+ "feature_gates": {
124
+ "artifacts": "enabled",
125
+ "schedules": "enabled",
126
+ "feature_sets": "enabled",
127
+ "models": "enabled",
128
+ "runs": "enabled",
129
+ "pipelines": "enabled",
130
+ },
123
131
  },
124
132
  },
125
133
  },
@@ -124,6 +124,7 @@ def spark_to_value_type(data_type):
124
124
  "double": ValueType.DOUBLE,
125
125
  "boolean": ValueType.BOOL,
126
126
  "timestamp": ValueType.DATETIME,
127
+ "timestamp_ntz": ValueType.DATETIME,
127
128
  "string": ValueType.STRING,
128
129
  "array": "list",
129
130
  "map": "dict",
mlrun/data_types/spark.py CHANGED
@@ -18,7 +18,7 @@ from os import environ
18
18
  import numpy as np
19
19
  import pytz
20
20
  from pyspark.sql.functions import to_utc_timestamp
21
- from pyspark.sql.types import BooleanType, DoubleType, TimestampType
21
+ from pyspark.sql.types import BooleanType, DoubleType
22
22
 
23
23
  from mlrun.feature_store.retrieval.spark_merger import spark_df_to_pandas
24
24
  from mlrun.utils import logger
@@ -143,7 +143,8 @@ def get_df_stats_spark(df, options, num_bins=20, sample_size=None):
143
143
  timestamp_columns = set()
144
144
  boolean_columns = set()
145
145
  for field in df_after_type_casts.schema.fields:
146
- is_timestamp = isinstance(field.dataType, TimestampType)
146
+ # covers TimestampType and TimestampNTZType, which was added in PySpark 3.4.0
147
+ is_timestamp = field.dataType.typeName().startswith("timestamp")
147
148
  is_boolean = isinstance(field.dataType, BooleanType)
148
149
  if is_timestamp:
149
150
  df_after_type_casts = df_after_type_casts.withColumn(
@@ -244,6 +244,15 @@ def _to_corrected_pandas_type(dt):
244
244
 
245
245
 
246
246
  def spark_df_to_pandas(spark_df):
247
+ import pyspark
248
+
249
+ if semver.parse(pyspark.__version__) >= semver.Version(3, 5, 0):
250
+
251
+ def to_pandas(spark_df_inner):
252
+ return spark_df_inner.toPandas()
253
+ else:
254
+ to_pandas = _to_pandas
255
+
247
256
  # as of pyspark 3.2.3, toPandas fails to convert timestamps unless we work around the issue
248
257
  # when we upgrade pyspark, we should check whether this workaround is still necessary
249
258
  # see https://stackoverflow.com/questions/76389694/transforming-pyspark-to-pandas-dataframe
@@ -262,9 +271,9 @@ def spark_df_to_pandas(spark_df):
262
271
  )
263
272
  type_conversion_dict[field.name] = "datetime64[ns]"
264
273
 
265
- df = _to_pandas(spark_df)
274
+ df = to_pandas(spark_df)
266
275
  if type_conversion_dict:
267
276
  df = df.astype(type_conversion_dict)
268
277
  return df
269
278
  else:
270
- return _to_pandas(spark_df)
279
+ return to_pandas(spark_df)
@@ -1136,7 +1136,8 @@ class CSVTarget(BaseStoreTarget):
1136
1136
  import pyspark.sql.functions as funcs
1137
1137
 
1138
1138
  for col_name, col_type in df.dtypes:
1139
- if col_type == "timestamp":
1139
+ # covers TimestampType and TimestampNTZType, which was added in PySpark 3.4.0
1140
+ if col_type.startswith("timestamp"):
1140
1141
  # df.write.csv saves timestamps with millisecond precision, but we want microsecond precision
1141
1142
  # for compatibility with storey.
1142
1143
  df = df.withColumn(
mlrun/db/factory.py CHANGED
@@ -54,9 +54,6 @@ class RunDBFactory(
54
54
  self._run_db = self._rundb_container.nop(url)
55
55
 
56
56
  else:
57
- # TODO: this practically makes the SQLRunDB a singleton, which mean that its session is shared, needs
58
- # to be refreshed frequently and cannot be used concurrently.
59
- # The SQLRunDB should always get its session from the FastAPI dependency injection.
60
57
  self._run_db = self._rundb_container.run_db(url)
61
58
 
62
59
  self._run_db.connect(secrets=secrets)
@@ -1035,9 +1035,10 @@ class RemoteRuntime(KubeResource):
1035
1035
  if args and sidecar.get("command"):
1036
1036
  sidecar["args"] = mlrun.utils.helpers.as_list(args)
1037
1037
 
1038
- # populate the sidecar resources from the function spec
1038
+ # put the configured resources on the sidecar container instead of the reverse proxy container
1039
1039
  if self.spec.resources:
1040
1040
  sidecar["resources"] = self.spec.resources
1041
+ self.spec.resources = None
1041
1042
 
1042
1043
  def _set_sidecar(self, name: str) -> dict:
1043
1044
  self.spec.config.setdefault("spec.sidecars", [])
@@ -12,6 +12,7 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
+ import re
15
16
  import typing
16
17
 
17
18
  import aiohttp
@@ -93,7 +94,6 @@ class WebhookNotification(NotificationBase):
93
94
 
94
95
  @staticmethod
95
96
  def _serialize_runs_in_request_body(override_body, runs):
96
- str_parsed_runs = ""
97
97
  runs = runs or []
98
98
 
99
99
  def parse_runs():
@@ -105,22 +105,26 @@ class WebhookNotification(NotificationBase):
105
105
  parsed_run = {
106
106
  "project": run["metadata"]["project"],
107
107
  "name": run["metadata"]["name"],
108
- "host": run["metadata"]["labels"]["host"],
109
108
  "status": {"state": run["status"]["state"]},
110
109
  }
111
- if run["status"].get("error", None):
112
- parsed_run["status"]["error"] = run["status"]["error"]
113
- elif run["status"].get("results", None):
114
- parsed_run["status"]["results"] = run["status"]["results"]
110
+ if host := run["metadata"].get("labels", {}).get("host", ""):
111
+ parsed_run["host"] = host
112
+ if error := run["status"].get("error"):
113
+ parsed_run["status"]["error"] = error
114
+ elif results := run["status"].get("results"):
115
+ parsed_run["status"]["results"] = results
115
116
  parsed_runs.append(parsed_run)
116
117
  return str(parsed_runs)
117
118
 
118
119
  if isinstance(override_body, dict):
119
120
  for key, value in override_body.items():
120
- if "{{ runs }}" or "{{runs}}" in value:
121
- if not str_parsed_runs:
122
- str_parsed_runs = parse_runs()
123
- override_body[key] = value.replace(
124
- "{{ runs }}", str_parsed_runs
125
- ).replace("{{runs}}", str_parsed_runs)
121
+ if not isinstance(value, str):
122
+ # If the value is not a string, we don't want to parse it
123
+ continue
124
+ if re.search(r"{{\s*runs\s*}}", value):
125
+ str_parsed_runs = parse_runs()
126
+ override_body[key] = re.sub(
127
+ r"{{\s*runs\s*}}", str_parsed_runs, value
128
+ )
129
+
126
130
  return override_body
@@ -168,6 +168,11 @@ class NotificationPusher(_NotificationPusherBase):
168
168
  logger.warning(
169
169
  "Failed to push notification async",
170
170
  error=mlrun.errors.err_to_str(result),
171
+ traceback=traceback.format_exception(
172
+ etype=type(result),
173
+ value=result,
174
+ tb=result.__traceback__,
175
+ ),
171
176
  )
172
177
 
173
178
  logger.debug(
@@ -1,4 +1,4 @@
1
1
  {
2
- "git_commit": "837dd64ab75493fe34986c6203d884a0ae33843b",
3
- "version": "1.7.1-rc10"
2
+ "git_commit": "3440c50863afd3b3dd850ade4ee237e8a1eb3211",
3
+ "version": "1.7.2-rc3"
4
4
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mlrun
3
- Version: 1.7.1rc10
3
+ Version: 1.7.2rc3
4
4
  Summary: Tracking and config of machine learning runs
5
5
  Home-page: https://github.com/mlrun/mlrun
6
6
  Author: Yaron Haviv
@@ -1,6 +1,6 @@
1
1
  mlrun/__init__.py,sha256=y08M1JcKXy5-9_5WaI9fn5aV5BxIQ5QkbduJK0OxWbA,7470
2
2
  mlrun/__main__.py,sha256=mC_Izs4kuHUHQi88QJFLN22n1kbygGM0wAirjNt7uj4,45938
3
- mlrun/config.py,sha256=DbVVAW1kgjtW0Bkm5bymE2_Wxd-0iHV_hoAlRDnQZDA,68743
3
+ mlrun/config.py,sha256=wSwpgwg3dCTogMSLX5AX0tcZKuafSnv1RaoL1Ws7vlk,69056
4
4
  mlrun/errors.py,sha256=G8GP4_wb3v2UEbiAS8OlamC7nYJNzbSvQ3sViZlyYhk,8063
5
5
  mlrun/execution.py,sha256=nXvvN8euzjuxhJouJD8VxfK0keTTA6UoMrcD_17AL-4,44252
6
6
  mlrun/features.py,sha256=1VlN5mdSvUrLSJJlJWk4mXp9YoNxkFTu36IGn9AbN7s,15539
@@ -40,7 +40,7 @@ mlrun/common/runtimes/constants.py,sha256=Rl0Sd8n_L7Imo-uF1LL9CJ5Szi0W1gUm36yrF8
40
40
  mlrun/common/schemas/__init__.py,sha256=QZMyVHjIoa88JmyVy45JGkNGz5K39XX7A72TUnXrLNA,5267
41
41
  mlrun/common/schemas/alert.py,sha256=qWYCISNYMdkgAARVQNxshVr9d-s8LGscfLKpczkTBms,6749
42
42
  mlrun/common/schemas/api_gateway.py,sha256=9ilorgLOiWxFZbv89-dbPNfVdaChlGOIdC4SLTxQwNI,7118
43
- mlrun/common/schemas/artifact.py,sha256=V3ngobnzI1v2eoOroWBEedjAZu0ntCSIQ-LzsOK1Z9k,3570
43
+ mlrun/common/schemas/artifact.py,sha256=lX0tAjvIxrMDmubvTUKKKl-BAt0FKDG0s7lzfvi1jb0,3758
44
44
  mlrun/common/schemas/auth.py,sha256=7XpEXICjDhHHkAppOp0mHvEtCwG68L3mhgSHPqqTBMk,6584
45
45
  mlrun/common/schemas/background_task.py,sha256=2qZxib2qrF_nPZj0ncitCG-2jxz2hg1qj0hFc8eswWQ,1707
46
46
  mlrun/common/schemas/client_spec.py,sha256=wqzQ5R4Zc7FL-8lV_BRN6nLrD0jK1kon05-JQ3fy2KY,2892
@@ -73,10 +73,10 @@ mlrun/common/schemas/model_monitoring/constants.py,sha256=Wha21Iev3Nr9ugB1Ms_wrm
73
73
  mlrun/common/schemas/model_monitoring/grafana.py,sha256=SG13MFUUz_tk6-mWeSx17qcdEW4ekicxqNtnMSwRTCY,1559
74
74
  mlrun/common/schemas/model_monitoring/model_endpoints.py,sha256=5vvjNX1bV98VSGdT4jwHr5ArKC9v_c1iHlaTf82fSUY,13198
75
75
  mlrun/data_types/__init__.py,sha256=EkxfkFoHb91zz3Aymq-KZfCHlPMzEc3bBqgzPUwmHWY,1087
76
- mlrun/data_types/data_types.py,sha256=uB9qJusSvPRK2PTvrFBXrS5jcDXMuwqXokJGToDg4VA,4953
76
+ mlrun/data_types/data_types.py,sha256=0_oKLC6-sXL2_nnaDMP_HSXB3fD1nJAG4J2Jq6sGNNw,4998
77
77
  mlrun/data_types/infer.py,sha256=z2EbSpR6xWEE5-HRUtDZkapHQld3xMbzXtTX83K-690,6134
78
- mlrun/data_types/spark.py,sha256=xfcr6lcaLcHepnrHavx_vacMJK7BC8FWsUKjwrjjn6w,9509
79
- mlrun/data_types/to_pandas.py,sha256=-ZbJBg00x4xxyqqqu3AVbEh-HaO2--DrChyPuedRhHA,11215
78
+ mlrun/data_types/spark.py,sha256=ADlhaPPRDbHFrQA1jmMldGx8SP4dNBCL8Pyt0WyXWmU,9588
79
+ mlrun/data_types/to_pandas.py,sha256=KOy0FLXPJirsgH6szcC5BI6t70yVDCjuo6LmuYHNTuI,11429
80
80
  mlrun/datastore/__init__.py,sha256=y2_NkHUiz9WKJ1XWeUHX-MKErwmIag6nxZ7Z06EcSk0,4180
81
81
  mlrun/datastore/alibaba_oss.py,sha256=-RMA4vCE4rar-D57Niy3tY_6bXKHLFpMp28z5YR7-jI,4888
82
82
  mlrun/datastore/azure_blob.py,sha256=9qkgrEMXGiuYYcc6b6HkuHlRHDbl0p7tIzeWxAAcEVs,12724
@@ -96,7 +96,7 @@ mlrun/datastore/spark_udf.py,sha256=NnnB3DZxZb-rqpRy7b-NC7QWXuuqFn3XkBDc86tU4mQ,
96
96
  mlrun/datastore/spark_utils.py,sha256=_AsVoU5Ix_-W7Gyq8io8V-2GTk0m8THJNDP3WGGaWJY,2865
97
97
  mlrun/datastore/store_resources.py,sha256=rcLoG506AMmR8qPJU_gE-G5d34VJVV_vNlZ3VHqho6c,6869
98
98
  mlrun/datastore/storeytargets.py,sha256=uNYG4nCBD3JIfa51CG4cDe9ryc9oIcqUdUXKvCPB6uE,5086
99
- mlrun/datastore/targets.py,sha256=TkG2HG4h7SaQ3qG2sKAHAuJJyj_gnE-eChaIsyjlq1o,80450
99
+ mlrun/datastore/targets.py,sha256=R-w-_pDlg_fzM5zdzBfdyBQ7PW8q2MqO8Z4k-Xuaw90,80549
100
100
  mlrun/datastore/utils.py,sha256=l9dLZb_VCbHs_htqMFRv4qiestZ8z8K-4eY1MxHS8wE,7720
101
101
  mlrun/datastore/v3io.py,sha256=HxP6mygiYM6leDAbQ9KdTxObLCt9yGMro0YhfdU6KUo,8157
102
102
  mlrun/datastore/wasbfs/__init__.py,sha256=s5Ul-0kAhYqFjKDR2X0O2vDGDbLQQduElb32Ev56Te4,1343
@@ -104,7 +104,7 @@ mlrun/datastore/wasbfs/fs.py,sha256=MnSj7Q4OKA2L55ihCmUnj2t3GA3B77oLMdAw-yxvN9w,
104
104
  mlrun/db/__init__.py,sha256=WqJ4x8lqJ7ZoKbhEyFqkYADd9P6E3citckx9e9ZLcIU,1163
105
105
  mlrun/db/auth_utils.py,sha256=hpg8D2r82oN0BWabuWN04BTNZ7jYMAF242YSUpK7LFM,5211
106
106
  mlrun/db/base.py,sha256=lUfJrCWbuRUErIrUUXAKI2sSlrwfB-dHDz-Ck_cnZHU,24297
107
- mlrun/db/factory.py,sha256=ibIrE5QkIIyzDU1FXKrfbc31cZiRLYKDZb8dqCpQwyU,2397
107
+ mlrun/db/factory.py,sha256=yP2vVmveUE7LYTCHbS6lQIxP9rW--zdISWuPd_I3d_4,2111
108
108
  mlrun/db/httpdb.py,sha256=VSk5lCrxBQydla9Cw4lYLA7W9o0Ge4WNfmmKFB4x3WM,184966
109
109
  mlrun/db/nopdb.py,sha256=1oCZR2EmQQDkwXUgmyI3SB76zvOwA6Ml3Lk_xvuwHfc,21620
110
110
  mlrun/feature_store/__init__.py,sha256=FhHRc8NdqL_HWpCs7A8dKruxJS5wEm55Gs3dcgBiRUg,1522
@@ -294,7 +294,7 @@ mlrun/runtimes/mpijob/abstract.py,sha256=kDWo-IY1FKLZhI30j38Xx9HMhlUvHezfd1DT2Sh
294
294
  mlrun/runtimes/mpijob/v1.py,sha256=1XQZC7AIMGX_AQCbApcwpH8I7y39-v0v2O35MvxjXoo,3213
295
295
  mlrun/runtimes/nuclio/__init__.py,sha256=gx1kizzKv8pGT5TNloN1js1hdbxqDw3rM90sLVYVffY,794
296
296
  mlrun/runtimes/nuclio/api_gateway.py,sha256=oQRSOvqtODKCzT2LqlqSXZbq2vcZ7epsFZwO9jvarhc,26899
297
- mlrun/runtimes/nuclio/function.py,sha256=TQt6RyxK_iyzNJr2r57BRtVXuy2GMrhdeFOlFjb2AZg,52106
297
+ mlrun/runtimes/nuclio/function.py,sha256=jtwtD9xfH3261cuekuHT97oBhNDqjBXCzHgQ2Y6IYs8,52184
298
298
  mlrun/runtimes/nuclio/nuclio.py,sha256=sLK8KdGO1LbftlL3HqPZlFOFTAAuxJACZCVl1c0Ha6E,2942
299
299
  mlrun/runtimes/nuclio/serving.py,sha256=L1Tz5EZyo8JZmUBNmIRYL9AoWfqSm4zLQQ9DWbnlmp8,29726
300
300
  mlrun/runtimes/nuclio/application/__init__.py,sha256=rRs5vasy_G9IyoTpYIjYDafGoL6ifFBKgBtsXn31Atw,614
@@ -332,20 +332,20 @@ mlrun/utils/singleton.py,sha256=p1Y-X0mPSs_At092GS-pZCA8CTR62HOqPU07_ZH6-To,869
332
332
  mlrun/utils/v3io_clients.py,sha256=0aCFiQFBmgdSeLzJr_nEP6SG-zyieSgH8RdtcUq4dc0,1294
333
333
  mlrun/utils/vault.py,sha256=xUiKL17dCXjwQJ33YRzQj0oadUXATlFWPzKKYAESoQk,10447
334
334
  mlrun/utils/notifications/__init__.py,sha256=eUzQDBxSQmMZASRY-YAnYS6tL5801P0wEjycp3Dvoe0,990
335
- mlrun/utils/notifications/notification_pusher.py,sha256=4ecV6JfCtvYpb0kl1-sdg4Cw6XTrAjmmh2olhUenesY,26752
335
+ mlrun/utils/notifications/notification_pusher.py,sha256=ASBnYSjroV4y2BDK93w_0ZDSp92F6oDZWEax07uvAdY,26984
336
336
  mlrun/utils/notifications/notification/__init__.py,sha256=o1OgBKFSQoD6g8Lh20Cw-_CLa-FPVaL33Kv6YwKiLGA,2154
337
337
  mlrun/utils/notifications/notification/base.py,sha256=hf3BDZ4-bq92MsqofQHt8DZqqlcKbWHscZFvzHdMcw4,4265
338
338
  mlrun/utils/notifications/notification/console.py,sha256=MAVk7v5PJ52vdGRv76YcEPixWgV0licBPWGpR01uR40,2643
339
339
  mlrun/utils/notifications/notification/git.py,sha256=g_8RksjCboGrKKjyhkePk5nSWrfdT61JkhMeg9EeGcY,6119
340
340
  mlrun/utils/notifications/notification/ipython.py,sha256=ZtVL30B_Ha0VGoo4LxO-voT1U41IYwyytovv5X_LsI4,2066
341
341
  mlrun/utils/notifications/notification/slack.py,sha256=wqpFGr5BTvFO5KuUSzFfxsgmyU1Ohq7fbrGeNe9TXOk,7006
342
- mlrun/utils/notifications/notification/webhook.py,sha256=cb9w1Mc8ENfJBdgan7iiVHK9eVls4-R3tUxmXM-P-8I,4746
342
+ mlrun/utils/notifications/notification/webhook.py,sha256=ux-KGV0mjFtpgq5NvgMhNfjjMZwlVjpQKNBDFvRJKBo,4841
343
343
  mlrun/utils/version/__init__.py,sha256=7kkrB7hEZ3cLXoWj1kPoDwo4MaswsI2JVOBpbKgPAgc,614
344
- mlrun/utils/version/version.json,sha256=rEraRuFIouYMRuXUyMajVSxbq-8ul-ZfqZGCQFrheTg,89
344
+ mlrun/utils/version/version.json,sha256=tXyLyaj-oqIunewjazCj0NU4jQGIy1cB9Kh9K9g_5AY,88
345
345
  mlrun/utils/version/version.py,sha256=eEW0tqIAkU9Xifxv8Z9_qsYnNhn3YH7NRAfM-pPLt1g,1878
346
- mlrun-1.7.1rc10.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
347
- mlrun-1.7.1rc10.dist-info/METADATA,sha256=dFxhKtPDI0LjkbvOl4pjTIilyBqBmhaHhFuuXPFqVTg,24168
348
- mlrun-1.7.1rc10.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
349
- mlrun-1.7.1rc10.dist-info/entry_points.txt,sha256=1Owd16eAclD5pfRCoJpYC2ZJSyGNTtUr0nCELMioMmU,46
350
- mlrun-1.7.1rc10.dist-info/top_level.txt,sha256=NObLzw3maSF9wVrgSeYBv-fgnHkAJ1kEkh12DLdd5KM,6
351
- mlrun-1.7.1rc10.dist-info/RECORD,,
346
+ mlrun-1.7.2rc3.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
347
+ mlrun-1.7.2rc3.dist-info/METADATA,sha256=eFKRh0Nnt0IZ6fOD7VIUf-iRxCZEUHt0ywZLbqaHu7w,24167
348
+ mlrun-1.7.2rc3.dist-info/WHEEL,sha256=A3WOREP4zgxI0fKrHUG8DC8013e3dK3n7a6HDbcEIwE,91
349
+ mlrun-1.7.2rc3.dist-info/entry_points.txt,sha256=1Owd16eAclD5pfRCoJpYC2ZJSyGNTtUr0nCELMioMmU,46
350
+ mlrun-1.7.2rc3.dist-info/top_level.txt,sha256=NObLzw3maSF9wVrgSeYBv-fgnHkAJ1kEkh12DLdd5KM,6
351
+ mlrun-1.7.2rc3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.6.0)
2
+ Generator: setuptools (75.7.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5