ipython / ipython/ipykernel

UUID Normalization

Ouverte
#473 3 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Python
Étoiles
734
Forks
412
Merge moyen
1 j 5 h
PR mergées (30 j)
8

Description

Today I was looking into sticking messages into a database when I noticed that our `msg_id` and `session_id` for `jupyter console` and `ipython` don't match the canonical format (e.g. `3a9993f9-ba0c-4a75-bb58-62af0ac3d2d4`):

```
$ jupyter console --kernel python3
Jupyter console 6.0.0

Python 3.7.6 (default, Dec 30 2019, 19:38:26)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.6.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: ip = get_ipython()

In [2]: ip.parent_header
Out[2]:
{'header': {'msg_id': '46806cf5-b41b930ae1b3f209d20bcc8c',
'msg_type': 'execute_request',
'username': 'kylek',
'session': '97790200-f0614d420db48cbb8394735e',
'date': datetime.datetime(2020, 1, 6, 19, 50, 45, 482522, tzinfo=tzutc()),
'version': '5.3'},
'msg_id': '46806cf5-b41b930ae1b3f209d20bcc8c',
'msg_type': 'execute_request',
'parent_header': {},
'metadata': {},
'content': {'code': 'ip.parent_header',
'silent': False,
'store_history': True,
'user_expressions': {},
'allow_stdin': True,
'stop_on_error': True},
'buffers': []}

In [3]: %connect_info
{
"shell_port": 53739,
"iopub_port": 53740,
"stdin_port": 53741,
"control_port": 53742,
"hb_port": 53743,
"ip": "127.0.0.1",
"key": "c49fffbb-dfb77272de2bdb4133453432",
"transport": "tcp",
"signature_scheme": "hmac-sha256",
"kernel_name": ""
}

Paste the above JSON into a file, and connect with:
$> jupyter --existing
or, if you are local, you can connect with just:
$> jupyter --existing kernel-11139.json
or even just:
$> jupyter --existing
if this is the most recent Jupyter kernel you have started.
```

Is this intended?

Perhaps the following is a jupyter_client / protocol question though -- should we document that these are string based IDs and are sensitive to `-` placement, not to be relied on as UUIDs?

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

The issue names no repository files or tests; start by tracing how msg_id and session_id are produced in the jupyter console/IPython messaging path and review the referenced jupyter_client/protocol behavior. Determine whether the intended outcome is normalization or documentation of string-based IDs, then document that decision and add relevant coverage if the project identifies a test location.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
jupyter, python
Domaine
backend-api-design, documentation
Type d'issue
Documentation
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
30/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.