mage-ai 0.9.49__py3-none-any.whl → 0.9.51__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 mage-ai might be problematic. Click here for more details.
- mage_ai/api/operations/base.py +11 -2
- mage_ai/api/presenters/WorkspacePresenter.py +1 -0
- mage_ai/api/resources/PipelineResource.py +28 -19
- mage_ai/cache/utils.py +2 -0
- mage_ai/cluster_manager/kubernetes/workload_manager.py +184 -147
- mage_ai/cluster_manager/workspace/kubernetes.py +25 -3
- mage_ai/data_preparation/executors/block_executor.py +10 -4
- mage_ai/data_preparation/models/global_hooks/models.py +9 -3
- mage_ai/data_preparation/models/pipeline.py +1 -47
- mage_ai/data_preparation/preferences.py +71 -27
- mage_ai/data_preparation/templates/custom/python/default.jinja +3 -5
- mage_ai/io/postgres.py +1 -0
- mage_ai/server/constants.py +1 -1
- mage_ai/server/frontend_dist/404.html +2 -2
- mage_ai/server/frontend_dist/_next/static/chunks/4138-1ffb2d1ab4fc61f2.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{5499-f60c2fc8ed0442d5.js → 5499-6f0bc8a94f2b78b4.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/manage-221f6ba4b04367c6.js → frontend_dist/_next/static/chunks/pages/manage-41c56c0ae1c15cb6.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-006a61883c0a6fce.js +1 -0
- mage_ai/server/frontend_dist/_next/static/{chun9Xv4R2ZZyX0zoxPm1 → z6eg1yN60N6gosbEr2pGr}/_buildManifest.js +1 -1
- mage_ai/server/frontend_dist/block-layout.html +2 -2
- mage_ai/server/frontend_dist/compute.html +2 -2
- mage_ai/server/frontend_dist/files.html +2 -2
- mage_ai/server/frontend_dist/global-data-products/[...slug].html +2 -2
- mage_ai/server/frontend_dist/global-data-products.html +2 -2
- mage_ai/server/frontend_dist/global-hooks/[...slug].html +2 -2
- mage_ai/server/frontend_dist/global-hooks.html +2 -2
- mage_ai/server/frontend_dist/index.html +2 -2
- mage_ai/server/frontend_dist/manage/files.html +2 -2
- mage_ai/server/frontend_dist/manage/settings.html +2 -2
- mage_ai/server/frontend_dist/manage/users/[user].html +2 -2
- mage_ai/server/frontend_dist/manage/users/new.html +2 -2
- mage_ai/server/frontend_dist/manage/users.html +2 -2
- mage_ai/server/frontend_dist/manage.html +2 -2
- mage_ai/server/frontend_dist/oauth.html +3 -3
- mage_ai/server/frontend_dist/overview.html +2 -2
- mage_ai/server/frontend_dist/pipeline-runs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills/[...slug].html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/dashboard.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/edit.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/logs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runtime.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs/[run].html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/settings.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/syncs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers/[...slug].html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline].html +2 -2
- mage_ai/server/frontend_dist/pipelines.html +2 -2
- mage_ai/server/frontend_dist/settings/account/profile.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/permissions/[...slug].html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/permissions.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/preferences.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/roles/[...slug].html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/roles.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/sync-data.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/users/[...slug].html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/users.html +2 -2
- mage_ai/server/frontend_dist/settings.html +2 -2
- mage_ai/server/frontend_dist/sign-in.html +3 -3
- mage_ai/server/frontend_dist/templates/[...slug].html +2 -2
- mage_ai/server/frontend_dist/templates.html +2 -2
- mage_ai/server/frontend_dist/terminal.html +2 -2
- mage_ai/server/frontend_dist/test.html +3 -3
- mage_ai/server/frontend_dist/triggers.html +2 -2
- mage_ai/server/frontend_dist/version-control.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/404.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/_next/static/{hcfGediUFcOE3vcIGjt-n → GkYZIZv7ClhebnBGgTrwO}/_buildManifest.js +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{1952-0f9a12782f0aaae6.js → 1952-0c8a3cb84da67f53.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{2714-68fef54789d7eaeb.js → 2714-1e79e9f2e998b544.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{2717-82a714ddff3edf43.js → 2717-e599ab448e3c1b7f.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{3437-ed09bb896e50e022.js → 3437-0712d7142aed2c46.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4138-1ffb2d1ab4fc61f2.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{4783-422429203610c318.js → 4783-1a21d9be47574bba.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{5499-f60c2fc8ed0442d5.js → 5499-6f0bc8a94f2b78b4.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{5896-7b8e36634d7d94eb.js → 5896-14e5a23b1c6a0769.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{6285-648f9a732e100b2f.js → 6285-e9b45335bfb9ccaf.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{6798-b904395b0c18647b.js → 6798-1ef0247e65215a0f.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{976-0a8c2c4d7acd957b.js → 976-18c98af60b76f1a7.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/manage-221f6ba4b04367c6.js → frontend_dist_base_path_template/_next/static/chunks/pages/manage-41c56c0ae1c15cb6.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{edit-0cd2a275eb8b6345.js → edit-285ea9b8083b5f22.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/{[run]-e9c1506c0a1f87b6.js → [run]-15deea898d2fa18b.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{settings-495e877aa7ed709e.js → settings-6f5a7e367ec63c43.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-006a61883c0a6fce.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{preferences-f3c29ec53ee35795.js → preferences-b058d0ff37970cd9.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/block-layout.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/compute.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/files.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/global-data-products/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/global-data-products.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/global-hooks/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/global-hooks.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/index.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/files.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/manage/settings.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/manage/users/[user].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/manage/users/new.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/manage/users.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/manage.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/oauth.html +3 -3
- mage_ai/server/frontend_dist_base_path_template/overview.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipeline-runs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/dashboard.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/edit.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/logs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runtime.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs/[run].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/settings.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/syncs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/account/profile.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/preferences.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/sync-data.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/sign-in.html +11 -11
- mage_ai/server/frontend_dist_base_path_template/templates/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/templates.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/terminal.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/test.html +4 -4
- mage_ai/server/frontend_dist_base_path_template/triggers.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/version-control.html +5 -5
- mage_ai/settings/__init__.py +32 -13
- mage_ai/tests/cache/test_pipeline_cache.py +1 -0
- mage_ai/tests/cluster_manager/kubernetes/test_workload_manager.py +76 -12
- {mage_ai-0.9.49.dist-info → mage_ai-0.9.51.dist-info}/METADATA +1 -1
- {mage_ai-0.9.49.dist-info → mage_ai-0.9.51.dist-info}/RECORD +149 -149
- mage_ai/server/frontend_dist/_next/static/chunks/4138-a2c37d37dba2f44c.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-34317532903c1ec9.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4138-a2c37d37dba2f44c.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-34317532903c1ec9.js +0 -1
- /mage_ai/server/frontend_dist/_next/static/{chun9Xv4R2ZZyX0zoxPm1 → z6eg1yN60N6gosbEr2pGr}/_ssgManifest.js +0 -0
- /mage_ai/server/frontend_dist_base_path_template/_next/static/{hcfGediUFcOE3vcIGjt-n → GkYZIZv7ClhebnBGgTrwO}/_ssgManifest.js +0 -0
- {mage_ai-0.9.49.dist-info → mage_ai-0.9.51.dist-info}/LICENSE +0 -0
- {mage_ai-0.9.49.dist-info → mage_ai-0.9.51.dist-info}/WHEEL +0 -0
- {mage_ai-0.9.49.dist-info → mage_ai-0.9.51.dist-info}/entry_points.txt +0 -0
- {mage_ai-0.9.49.dist-info → mage_ai-0.9.51.dist-info}/top_level.txt +0 -0
mage_ai/api/operations/base.py
CHANGED
|
@@ -42,6 +42,7 @@ from mage_ai.orchestration.db import db_connection
|
|
|
42
42
|
from mage_ai.orchestration.db.errors import DoesNotExistError
|
|
43
43
|
from mage_ai.settings import REQUIRE_USER_PERMISSIONS
|
|
44
44
|
from mage_ai.shared.array import flatten
|
|
45
|
+
from mage_ai.shared.environments import is_debug
|
|
45
46
|
from mage_ai.shared.hash import ignore_keys, merge_dict
|
|
46
47
|
from mage_ai.shared.strings import classify
|
|
47
48
|
|
|
@@ -325,9 +326,17 @@ class BaseOperation():
|
|
|
325
326
|
resource_parent_id=self.resource_parent_id,
|
|
326
327
|
resource_parent_type=self.__resource_parent_entity_name(),
|
|
327
328
|
resources=resources,
|
|
328
|
-
user=dict(
|
|
329
|
+
user=dict(
|
|
330
|
+
avatar=self.user.avatar,
|
|
331
|
+
first_name=self.user.first_name,
|
|
332
|
+
id=self.user.id,
|
|
333
|
+
last_name=self.user.last_name,
|
|
334
|
+
username=self.user.username,
|
|
335
|
+
) if self.user else None,
|
|
329
336
|
)
|
|
330
|
-
except Exception:
|
|
337
|
+
except Exception as err:
|
|
338
|
+
if is_debug():
|
|
339
|
+
raise err
|
|
331
340
|
hooks = []
|
|
332
341
|
|
|
333
342
|
try:
|
|
@@ -207,25 +207,6 @@ class PipelineResource(BaseResource):
|
|
|
207
207
|
)
|
|
208
208
|
|
|
209
209
|
pipelines = [p for p in pipelines if p is not None]
|
|
210
|
-
if sorts:
|
|
211
|
-
def _sort_key(p, sorts=sorts, reverse_sort=reverse_sort):
|
|
212
|
-
bools = []
|
|
213
|
-
vals = []
|
|
214
|
-
for k in sorts:
|
|
215
|
-
if hasattr(p, k):
|
|
216
|
-
val = getattr(p, k)
|
|
217
|
-
vals.append(val)
|
|
218
|
-
bools.append(val is None if not reverse_sort else val is not None)
|
|
219
|
-
else:
|
|
220
|
-
bools.append(False)
|
|
221
|
-
|
|
222
|
-
return tuple(bools + vals)
|
|
223
|
-
|
|
224
|
-
pipelines = sorted(
|
|
225
|
-
pipelines,
|
|
226
|
-
key=_sort_key,
|
|
227
|
-
reverse=reverse_sort,
|
|
228
|
-
)
|
|
229
210
|
|
|
230
211
|
@safe_db_query
|
|
231
212
|
def query_pipeline_schedules(pipeline_uuids):
|
|
@@ -287,6 +268,34 @@ class PipelineResource(BaseResource):
|
|
|
287
268
|
if pipeline.uuid in history_by_pipeline_uuid:
|
|
288
269
|
pipeline.history = history_by_pipeline_uuid.get(pipeline.uuid)
|
|
289
270
|
|
|
271
|
+
if sorts:
|
|
272
|
+
def _sort_key(p, sorts=sorts, reverse_sort=reverse_sort):
|
|
273
|
+
bools = []
|
|
274
|
+
vals = []
|
|
275
|
+
for k in sorts:
|
|
276
|
+
if 'blocks' == k.lower():
|
|
277
|
+
val = len(p.blocks_by_uuid)
|
|
278
|
+
vals.append(val)
|
|
279
|
+
bools.append(val is None if not reverse_sort else val is not None)
|
|
280
|
+
elif 'triggers' == k.lower():
|
|
281
|
+
val = len(p.blocks_by_uuid)
|
|
282
|
+
vals.append(val)
|
|
283
|
+
bools.append(val is None if not reverse_sort else val is not None)
|
|
284
|
+
elif hasattr(p, k):
|
|
285
|
+
val = getattr(p, k)
|
|
286
|
+
vals.append(val)
|
|
287
|
+
bools.append(val is None if not reverse_sort else val is not None)
|
|
288
|
+
else:
|
|
289
|
+
bools.append(False)
|
|
290
|
+
|
|
291
|
+
return tuple(bools + vals)
|
|
292
|
+
|
|
293
|
+
pipelines = sorted(
|
|
294
|
+
pipelines,
|
|
295
|
+
key=_sort_key,
|
|
296
|
+
reverse=reverse_sort,
|
|
297
|
+
)
|
|
298
|
+
|
|
290
299
|
if offset_limit_applied:
|
|
291
300
|
results = pipelines
|
|
292
301
|
else:
|
mage_ai/cache/utils.py
CHANGED
|
@@ -6,6 +6,7 @@ from mage_ai.shared.hash import extract, merge_dict
|
|
|
6
6
|
PIPELINE_KEYS = [
|
|
7
7
|
'description',
|
|
8
8
|
'name',
|
|
9
|
+
'tags',
|
|
9
10
|
'type',
|
|
10
11
|
'updated_at',
|
|
11
12
|
'uuid',
|
|
@@ -28,6 +29,7 @@ def build_pipeline_dict(
|
|
|
28
29
|
pipeline_output_dict = dict(
|
|
29
30
|
description=None,
|
|
30
31
|
name=None,
|
|
32
|
+
tags=None,
|
|
31
33
|
type=None,
|
|
32
34
|
updated_at=None,
|
|
33
35
|
uuid=None,
|