id
int64
0
190k
prompt
stringlengths
21
13.4M
docstring
stringlengths
1
12k
27,322
import urllib.parse from typing import Dict, List, Tuple from mage_ai.api.operations.constants import OperationType from mage_ai.command_center.constants import ( ApplicationType, ButtonActionType, ItemType, ObjectType, ) from mage_ai.data_preparation.models.constants import PIPELINE_TYPE_DISPLAY_NAME_M...
null
27,323
import urllib.parse from typing import Dict from mage_ai.api.operations.constants import OperationType from mage_ai.api.policies.FilePolicy import FilePolicy from mage_ai.command_center.constants import ( ApplicationType, ButtonActionType, InteractionType, ItemType, ObjectType, ) from mage_ai.presen...
null
27,324
import os from typing import Dict import yaml from jinja2 import Template from mage_ai.command_center.constants import SETTINGS_FILENAME from mage_ai.shared.io import safe_write def __settings_full_path() -> str: from mage_ai.settings.repo import get_variables_dir variables_dir = get_variables_dir(root_project=...
null
27,325
import os from typing import Dict import yaml from jinja2 import Template from mage_ai.command_center.constants import SETTINGS_FILENAME from mage_ai.shared.io import safe_write def __settings_full_path() -> str: def safe_write(filepath: str, content: str, write_func: Callable = None): def save_settings(settings: Dic...
null
27,326
import urllib.parse from datetime import datetime from typing import Dict, List from uuid import uuid4 from mage_ai.api.operations.constants import OperationType from mage_ai.api.policies.FilePolicy import FilePolicy from mage_ai.command_center.constants import ( ApplicationType, ButtonActionType, ItemType,...
null
27,327
import urllib.parse from datetime import datetime from typing import Dict, List from uuid import uuid4 from mage_ai.api.operations.constants import OperationType from mage_ai.api.policies.FilePolicy import FilePolicy from mage_ai.command_center.constants import ( ApplicationType, ButtonActionType, ItemType,...
null
27,328
import urllib.parse from datetime import datetime from typing import Dict, List from uuid import uuid4 from mage_ai.api.operations.constants import OperationType from mage_ai.api.policies.FilePolicy import FilePolicy from mage_ai.command_center.constants import ( ApplicationType, ButtonActionType, ItemType,...
null
27,329
import urllib.parse from datetime import datetime from typing import Dict, List from uuid import uuid4 from mage_ai.api.operations.constants import OperationType from mage_ai.api.policies.FilePolicy import FilePolicy from mage_ai.command_center.constants import ( ApplicationType, ButtonActionType, ItemType,...
null
27,330
from typing import List from mage_ai.command_center.applications.factory import ApplicationFactory from mage_ai.command_center.blocks.factory import BlockFactory from mage_ai.command_center.factory import BaseFactory from mage_ai.command_center.files.factory import FileFactory from mage_ai.command_center.models import ...
null
27,331
import json import traceback from typing import Any, Dict, Union The provided code snippet includes necessary dependencies for implementing the `get_value` function. Write a Python function `def get_value(value: Union[str, None]) -> Any` to solve the following problem: Returns parsed value. If the string is a valid JS...
Returns parsed value. If the string is a valid JSON object, deserializes it to a Python object. Otherwise, passes the original value.
27,332
import json import os import sys from typing import Union import typer from click import Context from rich import print from typer.core import TyperGroup from mage_ai.cli.utils import parse_runtime_variables from mage_ai.data_preparation.repo_manager import ProjectType from mage_ai.services.newrelic import initialize_n...
Start Mage server and UI.
27,333
import json import os import sys from typing import Union import typer from click import Context from rich import print from typer.core import TyperGroup from mage_ai.cli.utils import parse_runtime_variables from mage_ai.data_preparation.repo_manager import ProjectType from mage_ai.services.newrelic import initialize_n...
Run pipeline.
27,334
import json import os import sys from typing import Union import typer from click import Context from rich import print from typer.core import TyperGroup from mage_ai.cli.utils import parse_runtime_variables from mage_ai.data_preparation.repo_manager import ProjectType from mage_ai.services.newrelic import initialize_n...
null
27,335
import json import os import sys from typing import Union import typer from click import Context from rich import print from typer.core import TyperGroup from mage_ai.cli.utils import parse_runtime_variables from mage_ai.data_preparation.repo_manager import ProjectType from mage_ai.services.newrelic import initialize_n...
null
27,336
import json import os import sys from typing import Union import typer from click import Context from rich import print from typer.core import TyperGroup from mage_ai.cli.utils import parse_runtime_variables from mage_ai.data_preparation.repo_manager import ProjectType from mage_ai.services.newrelic import initialize_n...
Create EMR cluster for Mage project.
27,337
from datetime import datetime from typing import Any, Dict, List import mage_ai from mage_ai.data_preparation.models.pipeline import Pipeline from mage_ai.data_preparation.models.triggers import ScheduleInterval from mage_ai.shared.hash import ignore_keys, merge_dict def create_dag( project_path: str, pipeline_...
null
27,338
from datetime import datetime, timedelta from typing import Dict, List import dateutil.parser from dateutil.relativedelta import relativedelta from mage_ai.data_preparation.models.triggers import ScheduleInterval, ScheduleStatus from mage_ai.orchestration.db.models.schedules import ( Backfill, PipelineRun, ...
null
27,339
from datetime import datetime, timedelta from typing import Dict, List import dateutil.parser from dateutil.relativedelta import relativedelta from mage_ai.data_preparation.models.triggers import ScheduleInterval, ScheduleStatus from mage_ai.orchestration.db.models.schedules import ( Backfill, PipelineRun, ...
null
27,340
from datetime import datetime, timedelta from typing import Dict, List import dateutil.parser from dateutil.relativedelta import relativedelta from mage_ai.data_preparation.models.triggers import ScheduleInterval, ScheduleStatus from mage_ai.orchestration.db.models.schedules import ( Backfill, PipelineRun, ...
null
27,341
import multiprocessing as mp import os import signal import time from enum import Enum from multiprocessing import Manager from typing import Callable, Dict import newrelic.agent import psutil import sentry_sdk from sentry_sdk import capture_exception from mage_ai.orchestration.db.process import start_session_and_run f...
Continuously polls the job queue and executes jobs in a worker pool. Args: queue: The multiprocessing queue from which jobs are fetched. size: The size of the worker pool. job_dict: The shared job dictionary.
27,342
import asyncio import collections import os import traceback from datetime import datetime, timedelta from typing import Any, Dict, Generator, List, Set, Tuple import pytz from dateutil.relativedelta import relativedelta from sqlalchemy import desc, func from mage_ai.data_integrations.utils.scheduler import ( clear...
null
27,343
import asyncio import collections import os import traceback from datetime import datetime, timedelta from typing import Any, Dict, Generator, List, Set, Tuple import pytz from dateutil.relativedelta import relativedelta from sqlalchemy import desc, func from mage_ai.data_integrations.utils.scheduler import ( clear...
null
27,344
import asyncio import collections import os import traceback from datetime import datetime, timedelta from typing import Any, Dict, Generator, List, Set, Tuple import pytz from dateutil.relativedelta import relativedelta from sqlalchemy import desc, func from mage_ai.data_integrations.utils.scheduler import ( clear...
null
27,345
import asyncio import collections import os import traceback from datetime import datetime, timedelta from typing import Any, Dict, Generator, List, Set, Tuple import pytz from dateutil.relativedelta import relativedelta from sqlalchemy import desc, func from mage_ai.data_integrations.utils.scheduler import ( clear...
null
27,346
import asyncio import collections import os import traceback from datetime import datetime, timedelta from typing import Any, Dict, Generator, List, Set, Tuple import pytz from dateutil.relativedelta import relativedelta from sqlalchemy import desc, func from mage_ai.data_integrations.utils.scheduler import ( clear...
Stop a pipeline run. This function stops a pipeline run by cancelling the pipeline run and its associated block runs. If a pipeline object is provided, it also kills the jobs associated with the pipeline run and its integration streams if applicable. Args: pipeline_run (PipelineRun): The pipeline run to stop. pipeline ...
27,347
import asyncio import collections import os import traceback from datetime import datetime, timedelta from typing import Any, Dict, Generator, List, Set, Tuple import pytz from dateutil.relativedelta import relativedelta from sqlalchemy import desc, func from mage_ai.data_integrations.utils.scheduler import ( clear...
null
27,348
import asyncio import collections import os import traceback from datetime import datetime, timedelta from typing import Any, Dict, Generator, List, Set, Tuple import pytz from dateutil.relativedelta import relativedelta from sqlalchemy import desc, func from mage_ai.data_integrations.utils.scheduler import ( clear...
This method manages the scheduling and execution of pipeline runs based on specified concurrency and pipeline scheduling rules. 1. Check whether any new pipeline runs need to be scheduled. 2. Group active pipeline runs by pipeline. 3. Run git sync if "sync_on_pipeline_run" is enabled. 4. For each pipeline, check whethe...
27,349
import asyncio import collections import os import traceback from datetime import datetime, timedelta from typing import Any, Dict, Generator, List, Set, Tuple import pytz from dateutil.relativedelta import relativedelta from sqlalchemy import desc, func from mage_ai.data_integrations.utils.scheduler import ( clear...
This method manages the scheduling and execution of pipeline runs for event triggered schedules. The logic is relatively similar to the `schedule_all()` method. 1. Evaluate event matchers and get active pipeline schedules for each matched event matcher. 2. Group matched pipeline schedules by pipeline. 3. Create a new p...
27,350
import asyncio import collections import os import traceback from datetime import datetime, timedelta from typing import Any, Dict, List, Set, Tuple import pytz from dateutil.relativedelta import relativedelta from sqlalchemy import desc, func from mage_ai.data_integrations.utils.scheduler import ( clear_source_out...
null
27,351
import asyncio import collections import os import traceback from datetime import datetime, timedelta from typing import Any, Dict, List, Set, Tuple import pytz from dateutil.relativedelta import relativedelta from sqlalchemy import desc, func from mage_ai.data_integrations.utils.scheduler import ( clear_source_out...
null
27,352
import asyncio import collections import os import traceback from datetime import datetime, timedelta from typing import Any, Dict, List, Set, Tuple import pytz from dateutil.relativedelta import relativedelta from sqlalchemy import desc, func from mage_ai.data_integrations.utils.scheduler import ( clear_source_out...
null
27,353
import asyncio import collections import os import traceback from datetime import datetime, timedelta from typing import Any, Dict, List, Set, Tuple import pytz from dateutil.relativedelta import relativedelta from sqlalchemy import desc, func from mage_ai.data_integrations.utils.scheduler import ( clear_source_out...
null
27,354
import asyncio import collections import os import traceback from datetime import datetime, timedelta from typing import Any, Dict, List, Set, Tuple import pytz from dateutil.relativedelta import relativedelta from sqlalchemy import desc, func from mage_ai.data_integrations.utils.scheduler import ( clear_source_out...
Stop a pipeline run. This function stops a pipeline run by cancelling the pipeline run and its associated block runs. If a pipeline object is provided, it also kills the jobs associated with the pipeline run and its integration streams if applicable. Args: pipeline_run (PipelineRun): The pipeline run to stop. pipeline ...
27,355
import asyncio import collections import os import traceback from datetime import datetime, timedelta from typing import Any, Dict, List, Set, Tuple import pytz from dateutil.relativedelta import relativedelta from sqlalchemy import desc, func from mage_ai.data_integrations.utils.scheduler import ( clear_source_out...
null
27,356
import asyncio import collections import os import traceback from datetime import datetime, timedelta from typing import Any, Dict, List, Set, Tuple import pytz from dateutil.relativedelta import relativedelta from sqlalchemy import desc, func from mage_ai.data_integrations.utils.scheduler import ( clear_source_out...
This method manages the scheduling and execution of pipeline runs based on specified concurrency and pipeline scheduling rules. 1. Check whether any new pipeline runs need to be scheduled. 2. Group active pipeline runs by pipeline. 3. Run git sync if "sync_on_pipeline_run" is enabled. 4. For each pipeline, check whethe...
27,357
import asyncio import collections import os import traceback from datetime import datetime, timedelta from typing import Any, Dict, List, Set, Tuple import pytz from dateutil.relativedelta import relativedelta from sqlalchemy import desc, func from mage_ai.data_integrations.utils.scheduler import ( clear_source_out...
This method manages the scheduling and execution of pipeline runs for event triggered schedules. The logic is relatively similar to the `schedule_all()` method. 1. Evaluate event matchers and get active pipeline schedules for each matched event matcher. 2. Group matched pipeline schedules by pipeline. 3. Create a new p...
27,358
import contextlib import enum import logging import os from typing import Generator from alembic import command from alembic.config import Config from sqlalchemy import text from mage_ai.orchestration.db import db_connection, db_connection_url class DBLocks(enum.IntEnum): """ Cross-db Identifiers for advisory g...
Contextmanager that will create and teardown a global db lock. Based on airflow.utils.db.create_global_lock
27,359
import json import os from typing import Optional from mage_ai.orchestration.constants import ( AWS_DB_SECRETS_NAME, PG_DB_HOST, PG_DB_NAME, PG_DB_PASS, PG_DB_PORT, PG_DB_USER, ) DEFAULT_POSTGRES_HOST = '127.0.0.1' DEFAULT_POSTGRES_PORT = '5432' import os try: # if OpenTelemetry is ...
null
27,360
from typing import Optional, Tuple The provided code snippet includes necessary dependencies for implementing the `get_user_info_from_db_connection_url` function. Write a Python function `def get_user_info_from_db_connection_url( url: str, ) -> Tuple[Optional[str], Optional[str]]` to solve the following problem: A...
Attempt to parse db connection url to get username and password. urllib.parse does not work for all cases. Args: url (str): db connection url usually in the form of "scheme://username:password@host:port/dbname?options" Returns: Tuple[str, str]: tuple of username, password
27,361
from typing import List from sqlalchemy.sql import func from mage_ai.orchestration.db import db_connection_url from mage_ai.orchestration.db.constants import DatabaseType def database_type() -> DatabaseType: if db_connection_url.startswith('postgresql'): return DatabaseType.POSTGRESQL elif db_connection...
null
27,362
from alembic import op import sqlalchemy as sa def upgrade() -> None: bind = op.get_bind() if bind.engine.name == 'postgresql': with op.get_context().autocommit_block(): op.execute("ALTER TYPE scheduletype ADD VALUE 'API'") op.execute("ALTER TYPE scheduletype ADD VALUE 'EVENT'")
null
27,363
from alembic import op import sqlalchemy as sa def downgrade() -> None: bind = op.get_bind() if bind.engine.name == 'postgresql': op.execute("ALTER TYPE scheduletype RENAME TO scheduletype_old") op.execute("CREATE TYPE scheduletype AS ENUM('TIME')") op.execute(( "ALTER TABLE...
null
27,364
from alembic import op import sqlalchemy as sa def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.create_table('secret', sa.Column('id', sa.Integer(), autoincrement=True, nullable=False), sa.Column('created_at', sa.DateTime(timezone=True), server_default=sa.text('(C...
null
27,365
from alembic import op import sqlalchemy as sa def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.drop_table('secret') # ### end Alembic commands ###
null
27,366
from alembic import op import sqlalchemy as sa def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.add_column('pipeline_run', sa.Column('passed_sla', sa.Boolean(), default=False)) # ### end Alembic commands ###
null
27,367
from alembic import op import sqlalchemy as sa def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.drop_column('pipeline_run', 'passed_sla') # ### end Alembic commands ###
null
27,368
from alembic import op import sqlalchemy as sa def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.add_column('block_run', sa.Column('started_at', sa.DateTime(timezone=True), nullable=True)) # ### end Alembic commands ###
null
27,369
from alembic import op import sqlalchemy as sa def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.drop_column('block_run', 'started_at') # ### end Alembic commands ###
null
27,370
from alembic import op import sqlalchemy as sa def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### with op.batch_alter_table('pipeline_schedule', schema=None) as batch_op: batch_op.add_column(sa.Column('global_data_product_uuid', sa.String(length=255), nullable=True)) ...
null
27,371
from alembic import op import sqlalchemy as sa def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### with op.batch_alter_table('pipeline_schedule', schema=None) as batch_op: batch_op.drop_index(batch_op.f('ix_pipeline_schedule_global_data_product_uuid')) batch_o...
null
27,372
from alembic import op import sqlalchemy as sa def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.create_table('event_matcher', sa.Column('id', sa.Integer(), autoincrement=True, nullable=False), sa.Column('created_at', sa.DateTime(timezone=True), server_default=sa.t...
null
27,373
from alembic import op import sqlalchemy as sa def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.drop_table('pipeline_schedule_event_matcher_association') op.drop_table('event_matcher') # ### end Alembic commands ###
null
27,374
from alembic import op import sqlalchemy as sa def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### with op.batch_alter_table('pipeline_schedule', schema=None) as batch_op: batch_op.add_column(sa.Column('description', sa.Text(), nullable=True)) # ### end Alembic com...
null
27,375
from alembic import op import sqlalchemy as sa def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### with op.batch_alter_table('pipeline_schedule', schema=None) as batch_op: batch_op.drop_column('description') # ### end Alembic commands ###
null
27,376
from alembic import op import sqlalchemy as sa def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.add_column('pipeline_run', sa.Column('variables', sa.JSON(), nullable=True)) # ### end Alembic commands ###
null
27,377
from alembic import op import sqlalchemy as sa def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.drop_column('pipeline_run', 'variables') # ### end Alembic commands ###
null
27,378
from alembic import op import sqlalchemy as sa def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### with op.batch_alter_table('pipeline_schedule', schema=None) as batch_op: batch_op.create_index(batch_op.f('ix_pipeline_schedule_pipeline_uuid'), ['pipeline_uuid'], unique=...
null
27,379
from alembic import op import sqlalchemy as sa def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### with op.batch_alter_table('pipeline_schedule', schema=None) as batch_op: batch_op.drop_index(batch_op.f('ix_pipeline_schedule_pipeline_uuid')) # ### end Alembic com...
null
27,380
from alembic import op import sqlalchemy as sa def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.add_column('pipeline_schedule', sa.Column('settings', sa.JSON(), nullable=True)) # ### end Alembic commands ###
null
27,381
from alembic import op import sqlalchemy as sa def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.drop_column('pipeline_schedule', 'settings') # ### end Alembic commands ###
null
27,382
from alembic import op import sqlalchemy as sa def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.create_index(op.f('ix_pipeline_run_execution_date'), 'pipeline_run', ['execution_date'], unique=False) op.create_index(op.f('ix_pipeline_run_pipeline_uuid'), 'pipeline_run'...
null
27,383
from alembic import op import sqlalchemy as sa def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.drop_index(op.f('ix_pipeline_run_status'), table_name='pipeline_run') op.drop_index(op.f('ix_pipeline_run_pipeline_uuid'), table_name='pipeline_run') op.drop_index(op...
null
27,384
from alembic import op import sqlalchemy as sa def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.create_table('pipeline_schedule', sa.Column('id', sa.Integer(), autoincrement=True, nullable=False), sa.Column('created_at', sa.DateTime(timezone=True), server_default=...
null
27,385
from alembic import op import sqlalchemy as sa def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.drop_table('block_run') op.drop_table('pipeline_run') op.drop_table('pipeline_schedule') # ### end Alembic commands ###
null
27,386
from alembic import op import sqlalchemy as sa def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### with op.batch_alter_table('pipeline_schedule', schema=None) as batch_op: batch_op.add_column(sa.Column('last_enabled_at', sa.DateTime(timezone=True), nullable=True)) ...
null
27,387
from alembic import op import sqlalchemy as sa def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### with op.batch_alter_table('pipeline_schedule', schema=None) as batch_op: batch_op.drop_column('last_enabled_at') # ### end Alembic commands ###
null
27,388
from alembic import op import sqlalchemy as sa def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### try: bind = op.get_bind() insp = sa.inspect(bind) if bind.engine.name == 'mssql': indexes = insp.get_indexes('secret') for i in ind...
null
27,389
from alembic import op import sqlalchemy as sa def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### pass # ### end Alembic commands ###
null
27,390
from alembic import op import sqlalchemy as sa def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.create_table('user', sa.Column('id', sa.Integer(), autoincrement=True, nullable=False), sa.Column('created_at', sa.DateTime(timezone=True), server_default=sa.text('(CUR...
null
27,391
from alembic import op import sqlalchemy as sa def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.drop_table('oauth2_access_token') op.drop_table('oauth2_application') op.drop_table('user') # ### end Alembic commands ###
null
27,392
from alembic import op import sqlalchemy as sa def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.add_column('pipeline_schedule', sa.Column('sla', sa.Integer(), nullable=True)) # ### end Alembic commands ###
null
27,393
from alembic import op import sqlalchemy as sa def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.drop_column('pipeline_schedule', 'sla') # ### end Alembic commands ###
null
27,394
from alembic import op import sqlalchemy as sa def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### with op.batch_alter_table('pipeline_schedule', schema=None) as batch_op: batch_op.add_column(sa.Column('repo_path', sa.String(length=255), nullable=True)) with op.bat...
null
27,395
from alembic import op import sqlalchemy as sa def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### with op.batch_alter_table('role', schema=None) as batch_op: batch_op.drop_index(batch_op.f('ix_role_name')) with op.batch_alter_table('pipeline_schedule', schema=No...
null
27,396
from alembic import op import sqlalchemy as sa def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.add_column('block_run', sa.Column('completed_at', sa.DateTime(timezone=True), nullable=True)) op.add_column('pipeline_run', sa.Column('completed_at', sa.DateTime(timezone=T...
null
27,397
from alembic import op import sqlalchemy as sa def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.drop_column('pipeline_run', 'completed_at') op.drop_column('block_run', 'completed_at') # ### end Alembic commands ###
null
27,398
from alembic import op import sqlalchemy as sa def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### with op.batch_alter_table('permission', schema=None) as batch_op: batch_op.add_column(sa.Column('user_id', sa.Integer(), nullable=True)) batch_op.add_column(sa.Col...
null
27,399
from alembic import op import sqlalchemy as sa def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### with op.batch_alter_table('role', schema=None) as batch_op: batch_op.drop_constraint('role_user_id', type_='foreignkey') batch_op.drop_column('user_id') wit...
null
27,400
from alembic import op import sqlalchemy as sa def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### bind = op.get_bind() if bind.engine.name == 'postgresql': with op.get_context().autocommit_block(): op.execute("ALTER TYPE blockrunstatus ADD VALUE 'CONDIT...
null
27,401
from alembic import op import sqlalchemy as sa def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### bind = op.get_bind() if bind.engine.name == 'postgresql': op.execute("ALTER TYPE blockrunstatus RENAME TO blockrunstatus_old") op.execute("CREATE TYPE blockr...
null
27,402
from alembic import op import sqlalchemy as sa def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.add_column('user', sa.Column('preferences', sa.JSON(), nullable=True)) # ### end Alembic commands ###
null
27,403
from alembic import op import sqlalchemy as sa def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.drop_column('user', 'preferences') # ### end Alembic commands ###
null
27,404
from alembic import op import sqlalchemy as sa def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### with op.batch_alter_table('backfill', schema=None) as batch_op: batch_op.add_column(sa.Column('settings', sa.JSON(), nullable=True)) # ### end Alembic commands ###
null
27,405
from alembic import op import sqlalchemy as sa def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### with op.batch_alter_table('backfill', schema=None) as batch_op: batch_op.drop_column('settings') # ### end Alembic commands ###
null
27,406
from alembic import op import sqlalchemy as sa def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### with op.batch_alter_table('block_run', schema=None) as batch_op: batch_op.create_index(batch_op.f('ix_block_run_pipeline_run_id'), ['pipeline_run_id'], unique=False) ...
null
27,407
from alembic import op import sqlalchemy as sa def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### with op.batch_alter_table('pipeline_run', schema=None) as batch_op: batch_op.drop_index(batch_op.f('ix_pipeline_run_pipeline_schedule_id')) batch_op.drop_index(b...
null
27,408
from alembic import op import sqlalchemy as sa def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### with op.batch_alter_table('secret', schema=None) as batch_op: batch_op.drop_constraint('name_unique', type_='unique') batch_op.add_column(sa.Column('key_uuid', sa....
null
27,409
from alembic import op import sqlalchemy as sa def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### with op.batch_alter_table('secret', schema=None) as batch_op: batch_op.drop_constraint('name_key_uuid_uc', type_='unique') batch_op.drop_column('key_uuid') ...
null
27,410
from alembic import op import sqlalchemy as sa def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.add_column('pipeline_schedule', sa.Column('token', sa.String(length=255), nullable=True)) op.create_index(op.f('ix_pipeline_schedule_token'), 'pipeline_schedule', ['token']...
null
27,411
from alembic import op import sqlalchemy as sa def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.drop_index(op.f('ix_pipeline_schedule_token'), table_name='pipeline_schedule') op.drop_column('pipeline_schedule', 'token') # ### end Alembic commands ###
null
27,412
from alembic import op from mage_ai.data_preparation.models.constants import ExecutorType import sqlalchemy as sa class ExecutorType(str, Enum): def is_valid_type(cls, executor_type: str) -> bool: def upgrade() -> None: # bind = op.get_bind() executor_type_enum = sa.Enum(ExecutorType, name='executortype'...
null
27,413
from alembic import op from mage_ai.data_preparation.models.constants import ExecutorType import sqlalchemy as sa class ExecutorType(str, Enum): AZURE_CONTAINER_INSTANCE = 'azure_container_instance' ECS = 'ecs' GCP_CLOUD_RUN = 'gcp_cloud_run' K8S = 'k8s' LOCAL_PYTHON = 'local_python' # Force us...
null
27,414
from alembic import op import sqlalchemy as sa def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### with op.batch_alter_table('pipeline_run', schema=None) as batch_op: batch_op.add_column(sa.Column('started_at', sa.DateTime(timezone=True), nullable=True)) # ### end A...
null
27,415
from alembic import op import sqlalchemy as sa def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### with op.batch_alter_table('pipeline_run', schema=None) as batch_op: batch_op.drop_column('started_at') # ### end Alembic commands ###
null
27,416
from alembic import op import sqlalchemy as sa def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### with op.batch_alter_table('oauth2_access_token', schema=None) as batch_op: batch_op.add_column(sa.Column('refresh_token', sa.String(length=255), nullable=True)) # ###...
null
27,417
from alembic import op import sqlalchemy as sa def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### with op.batch_alter_table('oauth2_access_token', schema=None) as batch_op: batch_op.drop_column('refresh_token') # ### end Alembic commands ###
null
27,418
from alembic import op import sqlalchemy as sa def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.add_column('pipeline_run', sa.Column('event_variables', sa.JSON(), nullable=True)) op.add_column('pipeline_run', sa.Column('metrics', sa.JSON(), nullable=True)) # ### e...
null
27,419
from alembic import op import sqlalchemy as sa def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.drop_column('pipeline_run', 'event_variables') op.drop_column('pipeline_run', 'metrics') # ### end Alembic commands ###
null
27,420
from alembic import op import sqlalchemy as sa def upgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.add_column('pipeline_schedule', sa.Column('variables', sa.JSON(), nullable=True)) # ### end Alembic commands ###
null
27,421
from alembic import op import sqlalchemy as sa def downgrade() -> None: # ### commands auto generated by Alembic - please adjust! ### op.drop_column('pipeline_schedule', 'variables') # ### end Alembic commands ###
null