Skip to content

tests: accept AbstractDict for compatibility with JSON.jl v1#23

Merged
lamdor merged 1 commit into
mainfrom
la/fix-json1-test-compat
Jun 11, 2026
Merged

tests: accept AbstractDict for compatibility with JSON.jl v1#23
lamdor merged 1 commit into
mainfrom
la/fix-json1-test-compat

Conversation

@lamdor

@lamdor lamdor commented Jun 10, 2026

Copy link
Copy Markdown
Member

Summary

JSON.jl v1 parses JSON objects into JSON.Object{String,Any} rather than Dict{String,Any}. Several method signatures were restricted to Dict{String,Any}, so OPA partial-compile results (which are JSON-parsed) no longer matched on current Julia — breaking the Config API and Compile API testsets. The suite still passed on Julia 1.6, which resolves an older JSON.jl that returns Dict, which is why this only surfaced recently.

Changes

Widen the affected signatures to AbstractDict (JSON.Object <: AbstractDict):

  • src/utils/ast.jl — the QuerySet AST-walk entry point _visit(::ASTVisitor, ::Type{QuerySet}, node). This is production code, so consumers passing JSON.Object-typed partial-compile results now work.
  • test/sql_translate.jl — the standalone reference translator's translate().
  • test/runtests.jl — two isa(..., Dict) assertions in the Config API testset.

Verification

Full suite passes (155/155) on current Julia with JSON v1.6.1.

JSON.jl v1 parses JSON objects into JSON.Object{String,Any} rather than Dict{String,Any}. Several method signatures were restricted to Dict{String,Any}, so the OPA partial-compile results (which are JSON-parsed) no longer matched on current Julia, breaking the Config API and Compile API testsets. (The suite still passed on Julia 1.6, which resolves an older JSON.jl that returns Dict.)

Widen the affected signatures to AbstractDict, which JSON.Object is a subtype of: the QuerySet AST-walk entry point in src/utils/ast.jl (production code, so consumers passing JSON.Object results now work), the standalone reference translator's translate(), and two Config API isa(..., Dict) assertions in the test suite.
@lamdor lamdor marked this pull request as ready for review June 10, 2026 11:25
@lamdor lamdor merged commit 629e607 into main Jun 11, 2026
11 checks passed
@lamdor lamdor deleted the la/fix-json1-test-compat branch June 11, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant