metaflow icon indicating copy to clipboard operation
metaflow copied to clipboard

IDEs (e.g. PyCharm) don't recognize Metaflow decorators

Open tuulos opened this issue 5 years ago • 4 comments

Metaflow decorators are imported at the runtime, so IDEs can't find them based on static analysis. We could find a way to make the setup more IDE-friendly.

Context: https://gitter.im/metaflow_org/community?at=5f8e151898a7774f1b53afc6

tuulos avatar Oct 19 '20 23:10 tuulos

Hello, any update on this? Would love to help improve this. Will be very helpful for beginners to understand how to use decorators and options it has without having to open the document

bsridatta avatar Apr 03 '23 08:04 bsridatta

@bsridatta there has been some progress on this issue: You can get tooltips now for many Metaflow's public APIs, like self.next, metaflow.S3 etc.

Decorators are a bit of a special case because they are constructed dynamically on the fly, making it harder for IDEs to recognize them. We are still working on to fix that issue

tuulos avatar Apr 03 '23 16:04 tuulos

Got it @tuulos , thanks for the quick reponse!

Yes its only decorators that are without tool tips. Although other modules throw warnings, not a problem but just sharing. For example FlowSpec shows warning like below in VSCode.

"FlowSpec" is not exported from module "metaflow"
  Import from "metaflow.flowspec" instead

bsridatta avatar Apr 04 '23 08:04 bsridatta

This should be fixed by #1557

romain-intel avatar Jan 11 '24 09:01 romain-intel

Still have the issue. Any fixes? image

solesensei avatar May 13 '24 14:05 solesensei

Worked for me

pip install metaflow-stubs -U

It should be added to docs.

solesensei avatar May 13 '24 14:05 solesensei