uranusjr commented on pull request #19830:
URL: https://github.com/apache/airflow/pull/19830#issuecomment-979439563


   Managed to reduce the problem and it became obvious. To properly “fake” an 
object, `lazy-object-proxy` uses a metaclass to “fake” things so 
`type(proxy).__module__` returns a “correct” value. But when the Proxy type is 
used directly, `Proxy.__module__` ends up not referencing the correct module 
bcause there is not a value to wrap. The behaviour actually depends on how 
`lazy-object-proxy` is implemented; the C version would just return NULL, which 
represents the builtin namespace, resulting in the cryptic error message.
   
   The Python version is even worse because it implements `Proxy.__module__` as 
a property, which cannot even be handled and would fail with something like
   
   ```
   _pickle.PicklingError: Can't pickle <class 'Proxy'>: import of module 
<property object at 0x7f7b1d3d4770> failed
   ```
   
   Either way, the issue is in `lazy-object-proxy`, and is a very nasty 
abstraction leakage. The C version is not actually too difficult to fix, but 
the Python version is not, and it does not make sense to only fix the issue in 
one implementation. So I guess the best we can do is just… avoid it, like how 
this PR does.


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