neo4j-apoc-procedures icon indicating copy to clipboard operation
neo4j-apoc-procedures copied to clipboard

Fixes #2978: The apoc.custom.declareProcedure does not accept default string values

Open vga91 opened this issue 2 years ago • 2 comments

Fixes #2978

  • Updated SIGNATURE_SYNTAX_ERROR
  • Fixed default string handling
  • Added getDefaultParameterValue to differentiate between plain text and other data types

With these changes the apoc.custom.declareFunction/Procedure should be able to accept any kind of default value, except for float type fixed here.

vga91 avatar Jul 06 '22 10:07 vga91

The reason for originally leaving it out in the parser was that the default signature output doesn't put quotes around strings, which made it too hard to parse for me.

jexp avatar Aug 25 '22 11:08 jexp

The reason for originally leaving it out in the parser was that the default signature output doesn't put quotes around strings, which made it too hard to parse for me.

@jexp Just to be sure, so do you think the changes are ok? Or should I change them in another way?

Anyway, the pr change the Signature.g4 placed in core, but indeed this file is only called by Signature.java (in full), therefore since we are not changing core functionality, I think it may be mergeable.

vga91 avatar Aug 31 '22 12:08 vga91

@Lojjs we should still adjust the grammar file in core. (And possible also fix the signature output in cypher for strings)

jexp avatar Dec 12 '22 12:12 jexp

Actually @vga91 @Lojjs we should move the grammar file to extended as it's not used anywhere in core, at least not to my knowledge.

jexp avatar Dec 12 '22 12:12 jexp

Actually @vga91 @Lojjs we should move the grammar file to extended as it's not used anywhere in core, at least not to my knowledge.

I will move it as part of this PR in dev: https://github.com/neo4j/apoc/pull/261. So if you can do your cherry-pick after that goes in, that would be good. Otherwise there is a risk I will write over your changes to the file by moving it

Lojjs avatar Dec 12 '22 15:12 Lojjs