bolkedebruin commented on PR #36205:
URL: https://github.com/apache/airflow/pull/36205#issuecomment-1866102823

   Overall I like the change quite a lot, still I am confused by what is 
`_make_common _data_structure` is doing in `DBApiHook`. Its comments says that 
the output is a common format but that format is not stipulated neither checked 
for or enforced in that function. The implementing functions do a better job, 
but their signatures are still confusing. Why can they return/accept None? Why 
do they return T if conversion needs to happen -> you dont apply a common 
structure then.
   
   can the signature and (pseudo) code of that base function be and others keep 
using that signature?
   
   ```python
   T = TypeVar("T")
   
   def _make_common _data_structure(self, result:  T | Sequence[T]) -> tuple | 
list[tuple]:
     if instance(T,  Sequence):
       return cast(list[tuple], [rows_object(*row) for row in rows])
     
     return cast(tuple, T)
   ```


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