[ 
https://issues.apache.org/jira/browse/TINKERPOP-2216?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16839096#comment-16839096
 ] 

ASF GitHub Bot commented on TINKERPOP-2216:
-------------------------------------------

dalaro commented on pull request #1113: TINKERPOP-2216 add status attribute for 
warnings
URL: https://github.com/apache/tinkerpop/pull/1113
 
 
   JIRA link: https://issues.apache.org/jira/browse/TINKERPOP-2216
   
   There are a lot of alternative ways to approach this.  I'm just opening this 
PR, with this specific approach, because it illustrates the suggested feature a 
bit more clearly than the prose in the JIRA issue description.
   
   This adds a new {{Tokens}} string literal with the value `"warnings"`.  The 
console's `DriverRemoteAcceptor` checks for this status attribute every time it 
receives a remote resultset, printing the value above the results (to `err` 
when available).  If the value is a list, each element gets passed through 
`String#valueOf` and printed on a separate line.  Otherwise, it's just passed 
through `String#valueOf` and printed once.
   
   Testing this in isolation seems a bit tricky.  I've been testing this 
coupled with a remote graph running in Gremlin-Server. If anyone has 
suggestions about reusable test harness bits underneath 
`gremlin-console/src/test` that I should reuse for this, I'd be interested.
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Consider adding conventional status attribute key for warnings
> --------------------------------------------------------------
>
>                 Key: TINKERPOP-2216
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2216
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: console, server
>    Affects Versions: 3.4.2
>            Reporter: Dan LaRocque
>            Priority: Minor
>
> [Status 
> attributes|http://tinkerpop.apache.org/docs/3.4.1/upgrade/#_status_attributes]
>  let server-side graph providers send arbitrary metadata alongside graph 
> resultsets.  The client can either ignore attributes or check for them.
> A remote graph implementation might want to send warning information back to 
> the client along with a resultset.  Maybe a traversal executed successfully, 
> but it contained some kind of implementation-specific antipattern that 
> justifies a warning.
> For instance, {{Tokens}} defines {{STATUS_ATTRIBUTE_EXCEPTIONS}} and 
> {{STATUS_ATTRIBUTE_STACK_TRACE}}.  Perhaps we could add a new 
> {{STATUS_ATTRIBUTE_WARNINGS}} alongside those two.  The console's 
> {{DriverRemoteAcceptor}} could check for this key when processing each result 
> set, printing the associated value (when an entry is present).
> I've already done this on the 3.4.x line.  I don't know whether this is 
> something TinkerPop would want, or whether it should remain in 
> vendor-specific extensions, or if there is some other approach that might fit 
> better; but I'll open a PR with what I've been using.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to