PyCall.jl icon indicating copy to clipboard operation
PyCall.jl copied to clipboard

recent changes to propertynames spits out key error

Open ppalmes opened this issue 4 years ago • 4 comments

  • this happens when you call propertynames in sklearn to check for fit or transform vs predict. once you call one them, it throws a key error exception because while propertynames say fit or transform/predict is available, actually calling one of them breaks. getmember is a more stable call instead of dir which list methods which may not be callable.

ppalmes avatar Apr 13 '21 09:04 ppalmes

https://github.com/IBM/Lale.jl/runs/2329281498?check_suite_focus=true

ppalmes avatar Apr 13 '21 09:04 ppalmes

cc @sethaxen since #879 is at issue here.

stevengj avatar Apr 15 '21 13:04 stevengj

yes. i have to copy the old code which uses getmember so that my fit/transform call to sklearn works. i’m not sure why python returns key error. it seems the dir command has bogus return of fit/transform such that calling python object returns error because it doesn’t support it.

ppalmes avatar Apr 15 '21 14:04 ppalmes

Could you provide a minimal example of a Python class for which dir fails but getmember works? See for example the test class added in #879 for which dir works but getmember fails.

sethaxen avatar Apr 15 '21 19:04 sethaxen