Fix psycopg array parameter handling for Cypher queries#2606
Merged
Conversation
… queries Co-authored-by: robfrank <413587+robfrank@users.noreply.github.com>
Co-authored-by: robfrank <413587+robfrank@users.noreply.github.com>
…lization Co-authored-by: robfrank <413587+robfrank@users.noreply.github.com>
Co-authored-by: robfrank <413587+robfrank@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] psycopg Error
Fix psycopg array parameter handling for Cypher queries
Oct 5, 2025
class java.lang.String cannot be cast to class java.util.Collection
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
Collaborator
|
@copilot the tests are now running. Verify that all the tests you added are green |
Copilot stopped work on behalf of
robfrank due to an error
October 5, 2025 20:16
robfrank
pushed a commit
that referenced
this pull request
Nov 10, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When using psycopg (Python PostgreSQL driver) to execute Cypher queries with array parameters through ArcadeDB's PostgreSQL wire protocol, a
ClassCastExceptionoccurred:This happened when passing list parameters for use in Cypher
INclauses:Root Cause
psycopg serializes list parameters as PostgreSQL array strings (e.g.,
{val1,val2,val3}). When parameter type codes are UNSPECIFIED (0), ArcadeDB's deserialization was returning these as raw Strings instead of parsing them into Collections. This caused issues when Cypher queries tried to use them as lists inINclauses.Solution
Modified
PostgresType.deserializeText()to automatically detect and parse PostgreSQL array format strings into Lists when the type code is UNSPECIFIED:This fix is minimal (6 lines), operates at the deserialization layer for consistency across all query languages, and is fully backwards compatible.
Testing
Fixes #[issue_number]
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
repository.apache.org/usr/lib/jvm/temurin-21-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.11/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.11/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.11 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.11/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/arcadedb/arcadedb org.codehaus.plexus.classworlds.launcher.Launcher clean install -DskipTests -T 2(dns block)/usr/lib/jvm/temurin-21-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.11/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.11/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.11 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.11/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/arcadedb/arcadedb org.codehaus.plexus.classworlds.launcher.Launcher clean compile -pl postgresw -am -q(dns block)scarf.shIf you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.