getappmap / appmap-python

AppMap client agent for Python
https://appland.org
Other
99 stars 16 forks source link

No Json output. #284

Open crimson206 opened 8 months ago

crimson206 commented 8 months ago

IDE : VSCode I checked the output of events generated. However, the dumps function didn't generate the json file.

What is more stable?

  1. Clone Repository
  2. Intentionally write the code in unittest or pytest
apotterri commented 8 months ago

Hi @crimson206, thanks for trying AppMap!

Can you provide some more details about your project, please? How did you start your app? What operation did you perform with it that failed to generate an AppMap?

crimson206 commented 8 months ago

You can find the same exercise here The dump function didn't work properly.

image

apotterri commented 8 months ago

Ah, ok. Can you share the source of the app, please? That will make it much easier to investigate the behavior you're seeing.

Thanks!

crimson206 commented 8 months ago

@apotterri Sure. You can visit their github

apotterri commented 8 months ago

Sorry, I still don't really understand how you're trying to use the agent.

However, I was able to generate an AppMap from code based on the Quick Start: https://gist.github.com/apotterri/7db7253e76c6f05d68e4b473070a2f2b .

ajp@Alans-MacBook-Pro haystack % pip install -q -r requirements.txt                              
 20240225 053306
ajp@Alans-MacBook-Pro haystack % OPENAI_API_KEY="$MY_API_KEY" python main.py
Ranking by BM25...: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 48395.82 docs/s]
['Jean lives in Paris.']
[2024-02-25 05:33:34,636] WARNING _appmap.metadata: Failed running 'git rev-parse HEAD', fatal: not a git repository (or any of the parent directories): .git

{"version": "1.9", "metadata": {"language": {"name": "python", "engine": "CPython", "version": "3.10.13"}, "client": {"name": "appmap", "url": "https://github.com/applandinc/appmap-python"}}, "events": [{"static": true, "parameters": [], "id": 1, "event": "call", "thread_id": 1, "defined_class": "rag", "method_id": "run", "path": "rag.py", "lineno": 15}, {"return_value": {"object_id": 4450414656, "value": "None", "class": "builtins.NoneType"}, "parent_id": 1, "elapsed": 0.4633517265319824, "id": 2, "event": "return", "thread_id": 1}], "classMap": [{"name": "rag", "type": "class", "children": [{"name": "run", "type": "function", "location": "rag.py:15", "static": true}]}]}%                                       
 20240225 053335
ajp@Alans-MacBook-Pro haystack %