noahxzhu opened a new issue, #1722:
URL: https://github.com/apache/age/issues/1722

   **Describe the bug**
   An error is observed when a property parameter includes a single quote.
   
   **How are you accessing AGE (Command line, driver, etc.)?**
   - I'm using the apache-age-python package in a python project.
   
   **What data setup do we need to do?**
   ```python
   def upsert_triplet_test(subj: str, rel: str, obj: str) -> None:
       prepared_statement = f"""
           MERGE (n1:`Entity` {{id: %s}})
           MERGE (n2:`Entity` {{id: %s}})
           MERGE (n1)-[:`{rel.replace(" ", "_").upper()}`]->(n2)
       """
   
       ag.execCypher(
           prepared_statement,
           params=(
               subj,
               obj,
           ),
       )
   
       ag.commit()
   
   
   upsert_triplet_test(
       "I", "Learned", "It's better for technology companies to be run by 
product people"
   )
   ```
   
   This is the error
   ```
       cursor.execute(stmt)
   psycopg2.errors.SyntaxError: syntax error at or near "'s better for 
technology companies to be run by product people'"
   ```
   
   **What is the necessary configuration info needed?**
   - nothing
   
   **What is the command that caused the error?**
   ```pgsql
   SELECT * from ag_catalog.cypher('graph_store', $$
        MERGE (n1:`Entity` {id: 'I'})
        MERGE (n2:`Entity` {id: 'It's better for technology companies to be run 
by product people'})
        MERGE (n1)-[:`Learned`]->(n2)
   $$) as (a ag_catalog.agtype);
   ```
   Not sure how to handle this case
   
   ```
   ERROR:  syntax error at or near "s"
   LINE 3:      MERGE (n2:`Entity` {id: 'It's better for technology com...
   ```
   
   **Expected behavior**
   This merge operation should be succeed.
   
   **Environment (please complete the following information):**
   - Version: package version 0.0.7
   - AGE Version: 1.5.0
   
   **Additional context**
   no
   


-- 
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.

To unsubscribe, e-mail: dev-unsubscr...@age.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to