Skip to content

Commit b4466dd

Browse files
Simplify workflow for default input
2 parents ca48071 + d7fe19c commit b4466dd

File tree

5 files changed

+149
-131
lines changed

5 files changed

+149
-131
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ classifiers = [
2121
packages = [{include = "sidekick"}]
2222

2323
[tool.poetry.dependencies]
24-
python = ">=3.8.1,<=3.10"
24+
python = ">=3.8.1,<=3.11"
2525
pandas = "^1.3.3"
2626
numpy = "^1.21.2"
2727
click = "^8.0.1"

requirements.txt

Lines changed: 89 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,89 @@
1-
accelerate==0.21.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
2-
aiohttp==3.8.5 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
3-
aiosignal==1.3.1 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
4-
ansicon==1.89.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0" and platform_system == "Windows"
5-
anyio==3.7.1 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
6-
async-timeout==4.0.3 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
7-
attrs==23.1.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
8-
bitsandbytes==0.41.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
9-
blessed==1.20.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
10-
cachetools==5.3.1 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
11-
certifi==2023.7.22 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
12-
charset-normalizer==3.2.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
13-
click==8.1.6 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
14-
colorama==0.4.6 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
15-
dataclasses-json==0.5.14 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
16-
exceptiongroup==1.1.3 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
17-
filelock==3.12.2 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
18-
frozenlist==1.4.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
19-
fsspec==2023.6.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
20-
gptcache==0.1.39.1 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
21-
greenlet==2.0.2 ; python_full_version >= "3.8.1" and platform_machine == "aarch64" and python_full_version <= "3.10.0" or python_full_version >= "3.8.1" and platform_machine == "ppc64le" and python_full_version <= "3.10.0" or python_full_version >= "3.8.1" and platform_machine == "x86_64" and python_full_version <= "3.10.0" or python_full_version >= "3.8.1" and platform_machine == "amd64" and python_full_version <= "3.10.0" or python_full_version >= "3.8.1" and platform_machine == "AMD64" and python_full_version <= "3.10.0" or python_full_version >= "3.8.1" and platform_machine == "win32" and python_full_version <= "3.10.0" or python_full_version >= "3.8.1" and platform_machine == "WIN32" and python_full_version <= "3.10.0"
22-
h11==0.14.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
23-
h2o-wave==0.26.1 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
24-
httpcore==0.17.3 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
25-
httpx==0.24.1 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
26-
huggingface-hub==0.16.4 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
27-
idna==3.4 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
28-
inquirer==3.1.3 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
29-
instructorembedding==1.0.1 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
30-
jinja2==3.1.2 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
31-
jinxed==1.2.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0" and platform_system == "Windows"
32-
joblib==1.3.2 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
33-
langchain==0.0.142 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
34-
llama-index==0.5.27 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
35-
loguru==0.7.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
36-
markupsafe==2.1.3 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
37-
marshmallow==3.20.1 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
38-
mpmath==1.3.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
39-
multidict==6.0.4 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
40-
mypy-extensions==1.0.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
41-
networkx==3.1 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
42-
nltk==3.8.1 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
43-
numexpr==2.8.5 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
44-
numpy==1.24.4 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
45-
openai==0.27.8 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
46-
openapi-schema-pydantic==1.2.4 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
47-
packaging==23.1 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
48-
pandas==1.5.3 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
49-
pandasql==0.7.3 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
50-
pillow==10.0.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
51-
psutil==5.9.5 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
52-
psycopg2-binary==2.9.7 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
53-
pydantic==1.10.12 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
54-
python-dateutil==2.8.2 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
55-
python-editor==1.0.4 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
56-
pytz==2023.3 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
57-
pyyaml==6.0.1 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
58-
readchar==4.0.5 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
59-
regex==2023.8.8 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
60-
requests==2.31.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
61-
safetensors==0.3.2 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
62-
scikit-learn==1.3.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
63-
scipy==1.10.1 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
64-
sentence-transformers==2.2.2 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
65-
sentencepiece==0.1.99 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
66-
setuptools==68.1.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
67-
six==1.16.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
68-
sniffio==1.3.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
69-
sqlalchemy-utils==0.41.1 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
70-
sqlalchemy==1.4.49 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
71-
sqlglot==12.4.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
72-
starlette==0.31.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
73-
sympy==1.12 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
74-
tenacity==8.2.3 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
75-
threadpoolctl==3.2.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
76-
tiktoken==0.4.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
77-
tokenizers==0.13.3 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
78-
toml==0.10.2 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
79-
torch==2.0.1 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
80-
torchvision==0.15.2 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
81-
tqdm==4.66.1 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
82-
transformers==4.31.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
83-
typing-extensions==4.7.1 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
84-
typing-inspect==0.9.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
85-
urllib3==2.0.4 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
86-
uvicorn==0.23.2 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
87-
wcwidth==0.2.6 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
88-
win32-setctime==1.1.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0" and sys_platform == "win32"
89-
yarl==1.9.2 ; python_full_version >= "3.8.1" and python_full_version <= "3.10.0"
1+
accelerate==0.21.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
2+
aiohttp==3.8.5 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
3+
aiosignal==1.3.1 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
4+
ansicon==1.89.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0" and platform_system == "Windows"
5+
anyio==4.0.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
6+
async-timeout==4.0.3 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
7+
attrs==23.1.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
8+
bitsandbytes==0.41.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
9+
blessed==1.20.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
10+
cachetools==5.3.1 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
11+
certifi==2023.7.22 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
12+
charset-normalizer==3.3.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
13+
click==8.1.7 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
14+
colorama==0.4.6 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
15+
dataclasses-json==0.5.14 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
16+
exceptiongroup==1.1.3 ; python_full_version >= "3.8.1" and python_version < "3.11"
17+
filelock==3.12.4 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
18+
frozenlist==1.4.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
19+
fsspec==2023.9.2 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
20+
gptcache==0.1.42 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
21+
greenlet==3.0.0 ; python_full_version >= "3.8.1" and platform_machine == "aarch64" and python_full_version <= "3.11.0" or python_full_version >= "3.8.1" and platform_machine == "ppc64le" and python_full_version <= "3.11.0" or python_full_version >= "3.8.1" and platform_machine == "x86_64" and python_full_version <= "3.11.0" or python_full_version >= "3.8.1" and platform_machine == "amd64" and python_full_version <= "3.11.0" or python_full_version >= "3.8.1" and platform_machine == "AMD64" and python_full_version <= "3.11.0" or python_full_version >= "3.8.1" and platform_machine == "win32" and python_full_version <= "3.11.0" or python_full_version >= "3.8.1" and platform_machine == "WIN32" and python_full_version <= "3.11.0"
22+
h11==0.14.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
23+
h2o-wave==0.26.1 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
24+
httpcore==0.18.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
25+
httpx==0.25.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
26+
huggingface-hub==0.17.3 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
27+
idna==3.4 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
28+
inquirer==3.1.3 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
29+
instructorembedding==1.0.1 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
30+
jinja2==3.1.2 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
31+
jinxed==1.2.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0" and platform_system == "Windows"
32+
joblib==1.3.2 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
33+
langchain==0.0.142 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
34+
llama-index==0.5.27 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
35+
loguru==0.7.2 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
36+
markupsafe==2.1.3 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
37+
marshmallow==3.20.1 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
38+
mpmath==1.3.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
39+
multidict==6.0.4 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
40+
mypy-extensions==1.0.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
41+
networkx==3.1 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
42+
nltk==3.8.1 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
43+
numexpr==2.8.6 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
44+
numpy==1.24.4 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
45+
openai==0.28.1 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
46+
openapi-schema-pydantic==1.2.4 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
47+
packaging==23.2 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
48+
pandas==1.5.3 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
49+
pandasql==0.7.3 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
50+
pillow==10.0.1 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
51+
psutil==5.9.5 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
52+
psycopg2-binary==2.9.9 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
53+
pydantic==1.10.13 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
54+
python-dateutil==2.8.2 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
55+
python-editor==1.0.4 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
56+
pytz==2023.3.post1 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
57+
pyyaml==6.0.1 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
58+
readchar==4.0.5 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
59+
regex==2023.10.3 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
60+
requests==2.31.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
61+
safetensors==0.4.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
62+
scikit-learn==1.3.1 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
63+
scipy==1.10.1 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
64+
sentence-transformers==2.2.2 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
65+
sentencepiece==0.1.99 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
66+
setuptools==68.2.2 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
67+
six==1.16.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
68+
sniffio==1.3.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
69+
sqlalchemy-utils==0.41.1 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
70+
sqlalchemy==1.4.49 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
71+
sqlglot==12.4.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
72+
starlette==0.31.1 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
73+
sympy==1.12 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
74+
tenacity==8.2.3 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
75+
threadpoolctl==3.2.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
76+
tiktoken==0.5.1 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
77+
tokenizers==0.14.1 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
78+
toml==0.10.2 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
79+
torch==2.1.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
80+
torchvision==0.16.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
81+
tqdm==4.66.1 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
82+
transformers==4.34.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
83+
typing-extensions==4.8.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
84+
typing-inspect==0.9.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
85+
urllib3==2.0.6 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
86+
uvicorn==0.23.2 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
87+
wcwidth==0.2.8 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"
88+
win32-setctime==1.1.0 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0" and sys_platform == "win32"
89+
yarl==1.9.2 ; python_full_version >= "3.8.1" and python_full_version <= "3.11.0"

sidekick/db_config.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,19 +166,20 @@ def has_table(self):
166166
def add_samples(self, data_csv_path=None):
167167
conn_str = self._url
168168
try:
169-
df_chunks = pd.read_csv(data_csv_path, chunksize=10000)
169+
logger.debug(f"Adding sample values to table: {data_csv_path}")
170+
df_chunks = pd.read_csv(data_csv_path, chunksize=5000)
170171
engine = create_engine(conn_str, isolation_level="AUTOCOMMIT")
171172

172-
sample_query = f"SELECT COUNT(*) AS ROWS FROM {self.table_name} LIMIT 1"
173173
for idx, chunk in enumerate(df_chunks):
174174
# Write rows to database
175175
logger.debug(f"Inserting chunk: {idx}")
176176
chunk.columns = self.column_names
177177
# Make sure column names in the data-frame match the schema
178-
chunk.to_sql(self.table_name, engine, if_exists="append", index=False, method="multi")
178+
chunk.to_sql(self.table_name, engine, if_exists="replace", index=False, method="multi")
179179

180180
logger.info(f"Data inserted into table: {self.table_name}")
181181
# Fetch the number of rows from the table
182+
sample_query = f"SELECT COUNT(*) AS ROWS FROM {self.table_name} LIMIT 1"
182183
num_rows = pd.read_sql_query(sample_query, engine)
183184
logger.info(f"Number of rows inserted: {num_rows.values[0][0]}")
184185
engine.dispose()

0 commit comments

Comments
 (0)