Skip to content

Commit

Permalink
Merge pull request #71 from astronomer/dev
Browse files Browse the repository at this point in the history
v1.2.1
  • Loading branch information
fritz-astronomer authored Jan 3, 2024
2 parents 9d23e3d + aee2947 commit 22c1ed7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/setup-python@v5
id: setup-python
- name: Install Poetry
uses: snok/install-poetry@v1
with:
Expand All @@ -22,7 +23,7 @@ jobs:
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/pyproject.toml') }}

- name: Run pre-commit
run: |
Expand All @@ -43,6 +44,7 @@ jobs:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
id: setup-python
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
Expand All @@ -58,7 +60,7 @@ jobs:
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/pyproject.toml') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
Expand Down
7 changes: 4 additions & 3 deletions astronomer_starship/starship/services/local_airflow_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing import List, Dict, Any

from sqlalchemy.dialects.postgresql import insert
from sqlalchemy import desc

from airflow import DAG
from airflow.models import DagModel, DagRun
Expand Down Expand Up @@ -104,7 +105,7 @@ def receive_dag(session: Session, data: list = None):

@provide_session
def get_dag_runs_and_task_instances(
session: Session, dag_id: str
session: Session, dag_id: str, limit: int = 5
) -> List[Dict[str, Any]]:
def _as_json_with_table(_row):
_r = {col.name: getattr(_row, col.name) for col in _row.__table__.columns}
Expand All @@ -117,8 +118,8 @@ def _as_json_with_table(_row):
dag_runs = (
session.query(DagRun)
.filter(DagRun.dag_id == dag_id)
.order_by(DagRun.start_date)
.limit(5)
.order_by(desc(DagRun.start_date))
.limit(limit)
.all()
)
logging.debug(
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "astronomer-starship"
version = "1.2.0"
version = "1.2.1"
description = "Migrations to Astro"
authors = ["CSE Team <[email protected]>"]
readme = "README.rst"
Expand Down Expand Up @@ -48,7 +48,7 @@ pyupgrade = "^3.3.1"
pyyaml = "^6.0"
pulumi = "^3.63.0"
pulumi-aws = "^5.35.0"
apache-airflow = "<2.6"
apache-airflow = ">=2"
isort = {version = "^5.12.0", python = ">=3.8.1"}
python-dotenv = {version = "^1.0.0", python = ">=3.8.1"}
sh = {version = "^2.0.4", python = ">=3.8.1"}
Expand Down

0 comments on commit 22c1ed7

Please sign in to comment.