mhmaguire commented on PR #1793:
URL: https://github.com/apache/age/pull/1793#issuecomment-2083512386

   @aked21 I attempted to change as little as possible and swap psycopg2 for 
v3. That being said some changes were necessary as psycopg3 introduces a new 
type adaptation system, no longer has an `ext` module, and doesn't have a 
replacement implementation for `execute_values`:
   
   - `drivers/python/age/age.py`
     - `Loader` subclass to cast `ag_type`. `AgeLoader` decodes bytes and 
passes the string to `parseAgeValue`. 
     - It's unclear if it is necessary to implement a `Dumper` as well? 
     - Additionally we can rely on `TypeInfo.fetch(typename)` to fetch type 
details from pg. 
     - `cursor_factotry=ClientCursor` in  `Age` constructor so that we have 
access to `.mogrify()`.
     - unsure why previous implementation did this: 
     `cypher = cypher[2:len(cypher)-1]`
     For me this was mangling the produced cypher statements so replaced with 
`cypher = cypher.strip()` 
   - `drivers/python/networkx/lib.py` 
     -  `execute_values` in `networkx/lib.py` replaced with `executemany`
   - Misc
     - updated all type hints 
     - ensure tests pass
     - updated tests so parsed args actually get passed to `Age` constructor
     - ensure notebooks work


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to