https://flyte.org logo
#ask-the-community
Title
# ask-the-community
b

Byron Hsu

01/26/2023, 5:38 PM
Anyone able to set up debugger for flytekit in VScode? I kept seeing this:
d

David Espejo (he/him)

01/26/2023, 6:38 PM
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

Greg Gydush

01/26/2023, 9:27 PM
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

David Espejo (he/him)

01/31/2023, 10:54 PM
Thank you @Greg Gydush @Byron Hsu please let us know if there’s any progress on this matter
b

Byron Hsu

02/01/2023, 7:47 AM
oh it works…
cool
I personally found
pytest
+
pdb
is also easy to use and faster
d

David Espejo (he/him)

02/01/2023, 5:53 PM
btw, thank you @Greg Gydush for your help here 🙂
g

Greg Gydush

02/01/2023, 5:54 PM
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!
123 Views