Skip to content

Commit

Permalink
chore(deps): update minor updates (#34)
Browse files Browse the repository at this point in the history
* chore(deps): update minor updates

* ruff: 2025 format

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jakob van Santen <jvansanten@gmail.com>
  • Loading branch information
renovate[bot] and jvansanten authored Feb 3, 2025
1 parent 232bb21 commit 171ea91
Show file tree
Hide file tree
Showing 8 changed files with 523 additions and 524 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3
uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a # v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3
- name: Login to Github Packages
Expand All @@ -52,7 +52,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build
id: docker_build
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6
with:
load: true
- name: Smoke test
Expand All @@ -77,7 +77,7 @@ jobs:
- name: Build and push
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
id: docker_push
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
# renovate: datasource=python-version depName=python versioning=python
python-version: "3.13.1"
# renovate: datasource=pypi depName=ruff
ruff-version: "0.8.6"
ruff-version: "0.9.4"
6 changes: 4 additions & 2 deletions ampel/ztf/archive/server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def post_alert_chunk(
alerts, schema = content_and_schema

blob, ranges = pack_records(alerts, schema)
key = f'{hashlib.sha256(json.dumps(sorted(alert["candid"] for alert in alerts)).encode("utf-8")).hexdigest()}.avro'
key = f"{hashlib.sha256(json.dumps(sorted(alert['candid'] for alert in alerts)).encode('utf-8')).hexdigest()}.avro"
md5 = base64.b64encode(hashlib.md5(blob).digest()).decode("utf-8")

obj = bucket.Object(key)
Expand Down Expand Up @@ -766,7 +766,9 @@ def create_stream_from_query(
) from None

conn.execute(
sqlalchemy.text(f"set statement_timeout={settings.stream_query_timeout*1000};")
sqlalchemy.text(
f"set statement_timeout={settings.stream_query_timeout * 1000};"
)
)
group_id = archive._create_read_queue(conn, name, query.chunk_size) # noqa: SLF001
conn.commit()
Expand Down
2 changes: 1 addition & 1 deletion migrations/01_update_hpx.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@
],
)
dt = time.time() - t0
log.info(f"updated {len(rows)/dt:.1f} rows/s")
log.info(f"updated {len(rows) / dt:.1f} rows/s")
1,015 changes: 506 additions & 509 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def archive(integration):
"ARCHIVE_WRITE_USER=ampel-client",
"-P",
"-v",
f"{Path(__file__).parent/'test-data'/'initdb'/'archive'}:/docker-entrypoint-initdb.d",
f"{Path(__file__).parent / 'test-data' / 'initdb' / 'archive'}:/docker-entrypoint-initdb.d",
POSTGRES_IMAGE,
],
)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_archivedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,4 +665,4 @@ def test_seekable_avro(alert_generator, cutouts: bool):
assert reco == alert
break
else:
raise ValueError(f'{alert["candid"]} not found')
raise ValueError(f"{alert['candid']} not found")
12 changes: 6 additions & 6 deletions tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,15 +260,15 @@ async def test_programid_auth(
assert response.status_code == status.HTTP_200_OK
assert mock_db.get_alerts_for_object.call_args.kwargs[
"programid"
] == params.get(
"programid"
), "programid is passed through for partnership token"
] == params.get("programid"), (
"programid is passed through for partnership token"
)
else:
assert response.status_code == status_code
if response.status_code == status.HTTP_200_OK:
assert (
mock_db.get_alerts_for_object.call_args.kwargs["programid"] == 1
), "non-partnership tokens always query programid 1"
assert mock_db.get_alerts_for_object.call_args.kwargs["programid"] == 1, (
"non-partnership tokens always query programid 1"
)


@pytest.mark.asyncio
Expand Down

0 comments on commit 171ea91

Please sign in to comment.