Skip to content

Commit 0bdd012

Browse files
committed
chore(ci): Pin Java 17 for lowest-direct cell
PySpark 3.4 (the declared floor) doesn't run on Java 21, the default JDK on ubuntu-latest runners -- it hits NoSuchMethodException on java.nio.DirectByteBuffer.<init>(long, int), removed in JDK 21. Pin the lowest-direct cell to Java 17 so the resolved pyspark==3.4.0 can actually start. The default cell (which resolves to a current pyspark 4.x) keeps the runner's default Java 21. Signed-off-by: Seth Fitzsimmons <seth@mojodna.net>
1 parent 8793c8d commit 0bdd012

18 files changed

Lines changed: 964 additions & 1317 deletions

.github/workflows/check-python-code.yaml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ jobs:
3131
# Default resolution exercises the committed lock against every
3232
# supported Python minor version. The lowest-direct cell pins each
3333
# direct dependency to its declared floor (see UV_RESOLUTION below)
34-
# and runs only on the Python floor.
34+
# and runs only on the Python floor, since the resolved-low pyspark
35+
# 3.4 wheels exist for 3.10/3.11 only.
3536
python: ["3.10", "3.11", "3.12", "3.13", "3.14"]
3637
resolution: [default]
3738
include:
@@ -56,9 +57,19 @@ jobs:
5657
with:
5758
python-version: ${{ matrix.python }}
5859

60+
# PySpark 3.4 (the declared minimum) does not support Java 21, which is
61+
# the default JDK on ubuntu-latest runners. Pin to Java 17 for the
62+
# lowest-direct cell so the resolved pyspark==3.4.0 can actually start.
63+
- name: Set up JDK 17
64+
if: matrix.resolution == 'lowest-direct'
65+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
66+
with:
67+
distribution: temurin
68+
java-version: '17'
69+
5970
# UV_RESOLUTION=lowest-direct makes `uv sync` re-resolve every direct
6071
# dependency to the lowest version permitted by pyproject.toml. This
61-
# exercises the declared floor (e.g. pydantic==2.12.0) instead of
72+
# exercises the declared floor (e.g. pyspark==3.4.0) instead of
6273
# whatever the committed lock happens to point at. Failures here mean
6374
# a direct dep's minimum needs to be bumped. Set via GITHUB_ENV only
6475
# in the relevant cell so default cells run with no UV_RESOLUTION at

packages/overture-schema-pyspark/tests/generated/overture/schema/addresses/test_address.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,13 @@
169169
expected_field="sources_min_length",
170170
expected_check="array_min_length",
171171
),
172+
Scenario(
173+
id="address::sources_unique:struct_unique",
174+
scaffold={"sources": [{"property": "/valid/pointer", "dataset": ""}]},
175+
mutate=lambda row: mutate_unique_items(row, "sources"),
176+
expected_field="sources_unique",
177+
expected_check="struct_unique",
178+
),
172179
Scenario(
173180
id="address::sources[].property:required",
174181
scaffold={"sources": [{"dataset": "", "property": "/valid/pointer"}]},
@@ -368,13 +375,6 @@
368375
expected_field="unit",
369376
expected_check="stripped",
370377
),
371-
Scenario(
372-
id="address::sources_unique:struct_unique",
373-
scaffold={"sources": [{"property": "/valid/pointer", "dataset": ""}]},
374-
mutate=lambda row: mutate_unique_items(row, "sources"),
375-
expected_field="sources_unique",
376-
expected_check="struct_unique",
377-
),
378378
]
379379

380380

packages/overture-schema-pyspark/tests/generated/overture/schema/base/test_bathymetry.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,13 @@
164164
expected_field="sources_min_length",
165165
expected_check="array_min_length",
166166
),
167+
Scenario(
168+
id="bathymetry::sources_unique:struct_unique",
169+
scaffold={"sources": [{"property": "/valid/pointer", "dataset": ""}]},
170+
mutate=lambda row: mutate_unique_items(row, "sources"),
171+
expected_field="sources_unique",
172+
expected_check="struct_unique",
173+
),
167174
Scenario(
168175
id="bathymetry::sources[].property:required",
169176
scaffold={"sources": [{"dataset": "", "property": "/valid/pointer"}]},
@@ -307,13 +314,6 @@
307314
expected_field="cartography.max_zoom",
308315
expected_check="bounds",
309316
),
310-
Scenario(
311-
id="bathymetry::sources_unique:struct_unique",
312-
scaffold={"sources": [{"property": "/valid/pointer", "dataset": ""}]},
313-
mutate=lambda row: mutate_unique_items(row, "sources"),
314-
expected_field="sources_unique",
315-
expected_check="struct_unique",
316-
),
317317
]
318318

319319

packages/overture-schema-pyspark/tests/generated/overture/schema/base/test_infrastructure.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,13 @@
184184
expected_field="sources_min_length",
185185
expected_check="array_min_length",
186186
),
187+
Scenario(
188+
id="infrastructure::sources_unique:struct_unique",
189+
scaffold={"sources": [{"property": "/valid/pointer", "dataset": ""}]},
190+
mutate=lambda row: mutate_unique_items(row, "sources"),
191+
expected_field="sources_unique",
192+
expected_check="struct_unique",
193+
),
187194
Scenario(
188195
id="infrastructure::sources[].property:required",
189196
scaffold={"sources": [{"dataset": "", "property": "/valid/pointer"}]},
@@ -463,6 +470,26 @@
463470
expected_field="names.rules[].perspectives.countries_min_length",
464471
expected_check="array_min_length",
465472
),
473+
Scenario(
474+
id="infrastructure::names.rules[].perspectives.countries_unique:struct_unique",
475+
scaffold={
476+
"names": {
477+
"primary": "a",
478+
"rules": [
479+
{
480+
"value": "a",
481+
"variant": "common",
482+
"perspectives": {"mode": "accepted_by", "countries": ["US"]},
483+
}
484+
],
485+
}
486+
},
487+
mutate=lambda row: mutate_unique_items(
488+
row, "names.rules[].perspectives.countries"
489+
),
490+
expected_field="names.rules[].perspectives.countries_unique",
491+
expected_check="struct_unique",
492+
),
466493
Scenario(
467494
id="infrastructure::names.rules[].perspectives.countries[]:country_code_alpha2",
468495
scaffold={
@@ -536,33 +563,6 @@
536563
expected_field="wikidata",
537564
expected_check="wikidata_id",
538565
),
539-
Scenario(
540-
id="infrastructure::sources_unique:struct_unique",
541-
scaffold={"sources": [{"property": "/valid/pointer", "dataset": ""}]},
542-
mutate=lambda row: mutate_unique_items(row, "sources"),
543-
expected_field="sources_unique",
544-
expected_check="struct_unique",
545-
),
546-
Scenario(
547-
id="infrastructure::names.rules[].perspectives.countries_unique:struct_unique",
548-
scaffold={
549-
"names": {
550-
"primary": "a",
551-
"rules": [
552-
{
553-
"value": "a",
554-
"variant": "common",
555-
"perspectives": {"mode": "accepted_by", "countries": ["US"]},
556-
}
557-
],
558-
}
559-
},
560-
mutate=lambda row: mutate_unique_items(
561-
row, "names.rules[].perspectives.countries"
562-
),
563-
expected_field="names.rules[].perspectives.countries_unique",
564-
expected_check="struct_unique",
565-
),
566566
]
567567

568568

packages/overture-schema-pyspark/tests/generated/overture/schema/base/test_land.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,13 @@
182182
expected_field="sources_min_length",
183183
expected_check="array_min_length",
184184
),
185+
Scenario(
186+
id="land::sources_unique:struct_unique",
187+
scaffold={"sources": [{"property": "/valid/pointer", "dataset": ""}]},
188+
mutate=lambda row: mutate_unique_items(row, "sources"),
189+
expected_field="sources_unique",
190+
expected_check="struct_unique",
191+
),
185192
Scenario(
186193
id="land::sources[].property:required",
187194
scaffold={"sources": [{"dataset": "", "property": "/valid/pointer"}]},
@@ -447,6 +454,26 @@
447454
expected_field="names.rules[].perspectives.countries_min_length",
448455
expected_check="array_min_length",
449456
),
457+
Scenario(
458+
id="land::names.rules[].perspectives.countries_unique:struct_unique",
459+
scaffold={
460+
"names": {
461+
"primary": "a",
462+
"rules": [
463+
{
464+
"value": "a",
465+
"variant": "common",
466+
"perspectives": {"mode": "accepted_by", "countries": ["US"]},
467+
}
468+
],
469+
}
470+
},
471+
mutate=lambda row: mutate_unique_items(
472+
row, "names.rules[].perspectives.countries"
473+
),
474+
expected_field="names.rules[].perspectives.countries_unique",
475+
expected_check="struct_unique",
476+
),
450477
Scenario(
451478
id="land::names.rules[].perspectives.countries[]:country_code_alpha2",
452479
scaffold={
@@ -520,33 +547,6 @@
520547
expected_field="wikidata",
521548
expected_check="wikidata_id",
522549
),
523-
Scenario(
524-
id="land::sources_unique:struct_unique",
525-
scaffold={"sources": [{"property": "/valid/pointer", "dataset": ""}]},
526-
mutate=lambda row: mutate_unique_items(row, "sources"),
527-
expected_field="sources_unique",
528-
expected_check="struct_unique",
529-
),
530-
Scenario(
531-
id="land::names.rules[].perspectives.countries_unique:struct_unique",
532-
scaffold={
533-
"names": {
534-
"primary": "a",
535-
"rules": [
536-
{
537-
"value": "a",
538-
"variant": "common",
539-
"perspectives": {"mode": "accepted_by", "countries": ["US"]},
540-
}
541-
],
542-
}
543-
},
544-
mutate=lambda row: mutate_unique_items(
545-
row, "names.rules[].perspectives.countries"
546-
),
547-
expected_field="names.rules[].perspectives.countries_unique",
548-
expected_check="struct_unique",
549-
),
550550
]
551551

552552

packages/overture-schema-pyspark/tests/generated/overture/schema/base/test_land_cover.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,13 @@
164164
expected_field="sources_min_length",
165165
expected_check="array_min_length",
166166
),
167+
Scenario(
168+
id="land_cover::sources_unique:struct_unique",
169+
scaffold={"sources": [{"property": "/valid/pointer", "dataset": ""}]},
170+
mutate=lambda row: mutate_unique_items(row, "sources"),
171+
expected_field="sources_unique",
172+
expected_check="struct_unique",
173+
),
167174
Scenario(
168175
id="land_cover::sources[].property:required",
169176
scaffold={"sources": [{"dataset": "", "property": "/valid/pointer"}]},
@@ -307,13 +314,6 @@
307314
expected_field="cartography.max_zoom",
308315
expected_check="bounds",
309316
),
310-
Scenario(
311-
id="land_cover::sources_unique:struct_unique",
312-
scaffold={"sources": [{"property": "/valid/pointer", "dataset": ""}]},
313-
mutate=lambda row: mutate_unique_items(row, "sources"),
314-
expected_field="sources_unique",
315-
expected_check="struct_unique",
316-
),
317317
]
318318

319319

packages/overture-schema-pyspark/tests/generated/overture/schema/base/test_land_use.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,13 @@
184184
expected_field="sources_min_length",
185185
expected_check="array_min_length",
186186
),
187+
Scenario(
188+
id="land_use::sources_unique:struct_unique",
189+
scaffold={"sources": [{"property": "/valid/pointer", "dataset": ""}]},
190+
mutate=lambda row: mutate_unique_items(row, "sources"),
191+
expected_field="sources_unique",
192+
expected_check="struct_unique",
193+
),
187194
Scenario(
188195
id="land_use::sources[].property:required",
189196
scaffold={"sources": [{"dataset": "", "property": "/valid/pointer"}]},
@@ -463,6 +470,26 @@
463470
expected_field="names.rules[].perspectives.countries_min_length",
464471
expected_check="array_min_length",
465472
),
473+
Scenario(
474+
id="land_use::names.rules[].perspectives.countries_unique:struct_unique",
475+
scaffold={
476+
"names": {
477+
"primary": "a",
478+
"rules": [
479+
{
480+
"value": "a",
481+
"variant": "common",
482+
"perspectives": {"mode": "accepted_by", "countries": ["US"]},
483+
}
484+
],
485+
}
486+
},
487+
mutate=lambda row: mutate_unique_items(
488+
row, "names.rules[].perspectives.countries"
489+
),
490+
expected_field="names.rules[].perspectives.countries_unique",
491+
expected_check="struct_unique",
492+
),
466493
Scenario(
467494
id="land_use::names.rules[].perspectives.countries[]:country_code_alpha2",
468495
scaffold={
@@ -536,33 +563,6 @@
536563
expected_field="wikidata",
537564
expected_check="wikidata_id",
538565
),
539-
Scenario(
540-
id="land_use::sources_unique:struct_unique",
541-
scaffold={"sources": [{"property": "/valid/pointer", "dataset": ""}]},
542-
mutate=lambda row: mutate_unique_items(row, "sources"),
543-
expected_field="sources_unique",
544-
expected_check="struct_unique",
545-
),
546-
Scenario(
547-
id="land_use::names.rules[].perspectives.countries_unique:struct_unique",
548-
scaffold={
549-
"names": {
550-
"primary": "a",
551-
"rules": [
552-
{
553-
"value": "a",
554-
"variant": "common",
555-
"perspectives": {"mode": "accepted_by", "countries": ["US"]},
556-
}
557-
],
558-
}
559-
},
560-
mutate=lambda row: mutate_unique_items(
561-
row, "names.rules[].perspectives.countries"
562-
),
563-
expected_field="names.rules[].perspectives.countries_unique",
564-
expected_check="struct_unique",
565-
),
566566
]
567567

568568

0 commit comments

Comments
 (0)