
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
airflow-provider-alembic
Advanced tools
An Airflow Provider to use Alembic to manage database migrations Read more here
Install the Alembic CLI with pip install alembic
Add airflow-provider-alembic
to your requirements.txt
or equivalent
dags
folder or the include
foldermkdir dags/migrations
cd dags/migrations
alembic init .
alembic revision -m "My Database Revision"
...
def upgrade():
# Use ORM to create objects
op.create_table(
'foo',
sa.Column('id', sa.Integer, primary_key=True),
sa.Column('name', sa.String(50), nullable=False),
sa.Column('description', sa.Unicode(200)),
)
# Or run raw SQL
op.execute("SELECT 1;")
def downgrade():
# Specify the opposite of your upgrade, to rollback
op.drop_table('account')
sqlite
via our .env
file:AIRFLOW_CONN_SQLITE="sqlite:///:memory:"
astro dev restart
@once
, it will run as soon as the DAG is turned on. Future runs for future revisions will need to be triggered.import os
from datetime import datetime
from airflow.models import DAG
from airflow.models.param import Param
from airflow_provider_alembic.operators.alembic import AlembicOperator
with DAG(
"example_alembic",
schedule="@once", # also consider "None"
start_date=datetime(1970, 1, 1),
params={
"command": Param("upgrade"),
"revision": Param("head")
}
) as dag:
AlembicOperator(
task_id="alembic_op",
conn_id="sqlite",
command="{{ params.command }}",
revision="{{ params.revision }}",
script_location="/usr/local/airflow/dags/migrations",
)
AlembicOperator
- such as downgrade
AlembicHook
has methods to run any alembic commandsFAQs
Apache Airflow Alembic provider containing Operators & Hooks.
We found that airflow-provider-alembic demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.