fix(validation): reject None in validate() and validate_json() #636
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Check Python package code | |
| on: | |
| # No path filter on pull_request: "All Python checks pass" is a required | |
| # status check (see schema.yml in omf-github-terraform), and GitHub never | |
| # satisfies a required check that a path filter prevents from running. | |
| pull_request: {} | |
| push: | |
| branches: [main, dev] | |
| paths: | |
| - 'packages/**' | |
| - 'pyproject.toml' | |
| - 'uv.lock' | |
| - 'Makefile' | |
| - '.github/workflows/check-python-code.yaml' | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| check: | |
| name: Check (${{ matrix.resolution }}, py${{ matrix.python }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # locked exercises the committed lock against every supported Python | |
| # minor version. The lowest-direct cell pins each direct dependency | |
| # to its declared floor (see UV_RESOLUTION below) and runs only on | |
| # the Python floor, since the resolved-low pyspark 3.4 wheels exist | |
| # for 3.10/3.11 only. | |
| python: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| resolution: [locked] | |
| include: | |
| - python: "3.10" | |
| resolution: lowest-direct | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1 | |
| with: | |
| version: "latest" | |
| - name: Set up Python | |
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| # PySpark 3.4 (the declared minimum) does not support Java 21, which is | |
| # the default JDK on ubuntu-latest runners. Pin to Java 17 for the | |
| # lowest-direct cell so the resolved pyspark==3.4.0 can actually start. | |
| - name: Set up JDK 17 | |
| if: matrix.resolution == 'lowest-direct' | |
| uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0 | |
| with: | |
| distribution: temurin | |
| java-version: '17' | |
| # UV_RESOLUTION=lowest-direct makes `uv sync` re-resolve every direct | |
| # dependency to the lowest version permitted by pyproject.toml. This | |
| # exercises the declared floor (e.g. pyspark==3.4.0) instead of | |
| # whatever the committed lock happens to point at. Failures here mean | |
| # a direct dep's minimum needs to be bumped. Set via GITHUB_ENV only | |
| # in the relevant cell so default cells run with no UV_RESOLUTION at | |
| # all -- otherwise an empty value is rejected by uv. | |
| - name: Configure resolution | |
| if: matrix.resolution == 'lowest-direct' | |
| run: echo "UV_RESOLUTION=lowest-direct" >> "$GITHUB_ENV" | |
| # Fail fast if uv.lock is stale (e.g. a pyproject.toml version bump | |
| # landed without a matching `uv lock` run). Only for the locked | |
| # resolution cells -- lowest-direct intentionally re-resolves away | |
| # from the committed lock, so `--locked` would always fail there. | |
| - name: Configure lock check | |
| if: matrix.resolution == 'locked' | |
| run: echo "UV_LOCKED=1" >> "$GITHUB_ENV" | |
| - name: Run make check | |
| run: make check | |
| # Single stable check-run name for the whole matrix, so a required-status- | |
| # check rule never has to track individual Python-version cells. Add or | |
| # drop a cell above and this job's name still covers it. | |
| all-python-checks-pass: | |
| name: All Python checks pass | |
| needs: [check] | |
| if: always() | |
| runs-on: ubuntu-slim | |
| permissions: {} | |
| steps: | |
| - uses: lowlydba/are-we-good@f506ed6324f55ec5e4ff5d92204a72c7f1c2b4f8 # v1.0.5 | |
| with: | |
| jobs: ${{ toJSON(needs) }} |