-
-
Notifications
You must be signed in to change notification settings - Fork 87
Fix(jupyter):use non-blocking stdin check to prevent hanging #380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kafka1991
wants to merge
3
commits into
main
Choose a base branch
from
non_blocking_stdin
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"metadata": { | ||
"ExecuteTime": { | ||
"end_time": "2025-09-17T06:03:01.458132Z", | ||
"start_time": "2025-09-17T06:03:00.939968Z" | ||
} | ||
}, | ||
"source": [ | ||
"print(\"start\")\n", | ||
"from chdb import session\n", | ||
"print(\"Connecting to database\")\n", | ||
"chs = session.Session()\n", | ||
"print(\"Creating database\")\n", | ||
"chs.query(\"CREATE DATABASE IF NOT EXISTS movie_embeddings ENGINE = Atomic\")\n", | ||
"print(\"Creating table\")\n", | ||
"chs.query(\"USE movie_embeddings\")\n", | ||
"chs.query('DROP TABLE IF EXISTS embeddings')\n", | ||
"chs.query('DROP TABLE IF EXISTS embeddings_with_title')\n", | ||
"\n", | ||
"print(\"Creating table with movie titles\")\n", | ||
"\n", | ||
"chs.query(\"\"\"CREATE TABLE embeddings (\n", | ||
" movieId UInt32 NOT NULL,\n", | ||
" embedding Array(Float32) NOT NULL\n", | ||
" ) ENGINE = MergeTree()\n", | ||
" ORDER BY movieId\"\"\")\n", | ||
"\n", | ||
"print(\"Inserting movie embeddings into the database\")\n", | ||
"\n", | ||
"# Insert from INFILE and VALUES got stuck either\n", | ||
"# chs.query(\"INSERT INTO embeddings FROM INFILE 'movie_embeddings.csv' FORMAT CSV\")\n", | ||
"chs.query(\"INSERT INTO embeddings VALUES (1, [1,2,3,4,5,6,7,8,9,10])\")\n", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe gen some bigger CSV to test it is better |
||
"print(chs.query('SELECT * FROM embeddings LIMIT 5'))" | ||
], | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"start\n", | ||
"Connecting to database\n", | ||
"Creating database\n", | ||
"Creating table\n", | ||
"Creating table with movie titles\n", | ||
"Inserting movie embeddings into the database\n", | ||
"1,\"[1,2,3,4,5,6,7,8,9,10]\"\n", | ||
"\n" | ||
] | ||
} | ||
], | ||
"execution_count": 1 | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.8.0" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This changed the behavior of stdin empty check. The orginal one will block wait for data if not eol found.
I still think this mod is risky while processing large chunk of input data with slow IO.