Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-2656

Provide a no syntax sugar translator for python

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Done
    • 3.5.0
    • 3.6.0, 3.5.2
    • translator
    • None

    Description

      The Python translator, by default, uses the python syntanic sugar syntax https://tinkerpop.apache.org/docs/3.5.1/reference/#gremlin-python-sugar

      which translates queries from

      g.V().range(0, 10).has("person", "name", "marko").limit(2).values("name")
       
      to
      g.V()[0:10].has('person','name','marko')[0:2].name
       

      It is also missing some of the reserved words/global functions differences for built in Python keywords https://tinkerpop.apache.org/docs/3.5.1/reference/#gremlin-python-differences

      • range
      • filter
      • id
      • max
      • min
      • sum

       

      The Python translator should be updated to:

       

      1. Provide an option to translate to Python without the syntanic sugar
      2. Use the proper reserved words/global functions

       

      Attachments

        Activity

          People

            spmallette Stephen Mallette
            tkolanko Tom Kolanko
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: