Anyone able to set up debugger for flytekit in VSc...
# ask-the-community
b
Anyone able to set up debugger for flytekit in VScode? I kept seeing this:
d
Hi Byron, I haven't done it myself but probably for context, could you provide the VScode version and the config file you are using for pytest?
g
When this happens, I find it easiest to check if it’s a problem with pytest/my environment. If running
pytest
in the terminal with the environment works, it should work for Vscode test discovery
Or, you could check for specific error in the Output section located in the same panel as the terminal
I did try on latest flytekit and received the following error:
Copy code
E   TypeError: Descriptors cannot not be created directly.
E   If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
E   If you cannot immediately regenerate your protos, some other possible workarounds are:
E    1. Downgrade the protobuf package to 3.20.x or lower.
E    2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
Commenting out
tensorflow/record/test_record.py
and
tensorflow/record/test_transformations.py
resolved - but the test wizard is very slow with this many tests 😅
d
Thank you @Greg Gydush @Byron Hsu please let us know if there’s any progress on this matter
b
oh it works…
cool
I personally found
pytest
+
pdb
is also easy to use and faster
d
btw, thank you @Greg Gydush for your help here 🙂
g
Of course! Vscode is actually rewriting their pytest discovery code to both improve performance and prevent errors like this from breaking all tests (will discover all non-broken tests). So hopefully in the future, using the test UI will be better for large repos such as Flytekit!
218 Views