-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parameters in queries for attributes that are unions #913
Comments
Thanks for the report. If that code is failing, it's a bug. |
The error is as follows. I guess a possible fix would be to do something here Catlab.jl/src/wiring_diagrams/Algebras.jl Lines 169 to 179 in 6c7c935
julia> query(data, testquery, (attr=3, ))
ERROR: Feet of spans are not equal: TypeSet(Int64) != TypeSet(Union{Int64, Symbol})
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] oapply(composite::Catlab.Programs.RelationalPrograms.UntypedNamedRelationDiagram{…}, spans::Vector{…}; Ob::Type, Hom::Type, return_limit::Bool)
@ Catlab.WiringDiagrams.WiringDiagramAlgebras ~/.julia/packages/Catlab/YRhzN/src/wiring_diagrams/Algebras.jl:54
[3] query(X::TestData{…}, diagram::Catlab.Programs.RelationalPrograms.UntypedNamedRelationDiagram{…}, params::@NamedTuple{…}; table_type::Type)
@ Catlab.WiringDiagrams.WiringDiagramAlgebras ~/.julia/packages/Catlab/YRhzN/src/wiring_diagrams/Algebras.jl:182
[4] query(X::TestData{…}, diagram::Catlab.Programs.RelationalPrograms.UntypedNamedRelationDiagram{…}, params::@NamedTuple{…})
@ Catlab.WiringDiagrams.WiringDiagramAlgebras ~/.julia/packages/Catlab/YRhzN/src/wiring_diagrams/Algebras.jl:158
[5] top-level scope
@ ~/Desktop/misc/tmp.jl:21
Some type information was truncated. Use `show(err)` to see complete types. |
@epatters I thought about this a bit, there's some tricky issues (or maybe I'm not seeing something obvious). The issue is setting up the constant function in Even when calling the Any ideas? This may just be something to note and move on. Or insist that people use SumTypes.jl for these cases (kidding). |
When an
AttrType
is being modeled with some union type, queries with a parameter for something pointing to that attribute type won't work (errors). I am not sure if its possible to make them work given how the spans are set up inoapply
, but I am documenting it here.The text was updated successfully, but these errors were encountered: