Skip to content

Commit

Permalink
address Tyler's feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
nowei committed Nov 22, 2024
1 parent 145aa49 commit 1e19245
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 10 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -301,20 +301,22 @@ jobs:
ref: ${{ inputs.ref }}
show-progress: 'false'
persist-credentials: 'false'
- uses: actions/setup-python@v3
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: '3.12'
- run: pip install mypy
python-version-file: 'python/pyproject.toml'
cache: poetry
- name: Get Python changed files
id: changed-py-files
uses: tj-actions/changed-files@v23
uses: tj-actions/changed-files@@4edd678ac3f81e2dc578756871e4d00c19191daf # v45.0.4
with:
files: |
*.py
**/*.py
- name: Run if any of the listed files above is changed
if: steps.changed-py-files.outputs.any_changed == 'true'
run: mypy ${{ steps.changed-py-files.outputs.all_changed_files }} --ignore-missing-imports
env:
CHANGED_PY_FILES: ${{ steps.changed-py-files.outputs.all_changed_files }}
run: mypy $CHANGED_PY_FILES --ignore-missing-imports


tflint:
Expand Down
67 changes: 65 additions & 2 deletions python/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ ipython = "^8.22.2"
pytest = "^8.1.1"
pytest-cov = "^5.0.0"
ruff = "^0.3.4"
mypy = "^1.13.0"

[build-system]
requires = ["poetry-core"]
Expand Down
4 changes: 2 additions & 2 deletions python/src/functions/create_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
import tempfile
import zipfile
from typing import Any
from typing import Any, Optional

import boto3
import structlog
Expand Down Expand Up @@ -68,7 +68,7 @@ def create_archive(
org_id: int,
reporting_period_id: int,
s3_client: S3Client,
logger: structlog.stdlib.BoundLogger = None,
logger: Optional[structlog.stdlib.BoundLogger] = None,
) -> None:
"""Create a zip archive of CSV files in S3"""

Expand Down
3 changes: 2 additions & 1 deletion python/src/functions/test_lambdas.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from typing import Any

from aws_lambda_typing.context import Context

from src.lib.logging import get_logger, reset_contextvars


Expand All @@ -15,7 +16,7 @@ def pre_create_archive(event: dict[str, Any], _context: Context) -> dict[str, An
"""
logger = get_logger()
logger.info("Received new invocation event from step function")
logger.info(event)
logger.info(str(event))
return {
"statusCode": 200,
"Payload": {
Expand Down

0 comments on commit 1e19245

Please sign in to comment.