Skip to content

Commit c2836b8

Browse files
committed
update black lint
1 parent b8c2ca1 commit c2836b8

File tree

2 files changed

+172
-173
lines changed

2 files changed

+172
-173
lines changed

docs/document_loader.ipynb

Lines changed: 170 additions & 171 deletions
Original file line numberDiff line numberDiff line change
@@ -1,173 +1,172 @@
11
{
2-
"cells": [
3-
{
4-
"cell_type": "markdown",
5-
"metadata": {},
6-
"source": [
7-
"# Google DATABASE\n",
8-
"\n",
9-
"[Google DATABASE](https://cloud.google.com/DATABASE).\n",
10-
"\n",
11-
"Load documents from `DATABASE`."
12-
]
13-
},
14-
{
15-
"cell_type": "markdown",
16-
"metadata": {},
17-
"source": [
18-
"## Pre-reqs"
19-
]
20-
},
21-
{
22-
"cell_type": "code",
23-
"execution_count": null,
24-
"metadata": {
25-
"tags": []
26-
},
27-
"outputs": [],
28-
"source": [
29-
"%pip install PACKAGE_NAME"
30-
]
31-
},
32-
{
33-
"cell_type": "code",
34-
"execution_count": 3,
35-
"metadata": {
36-
"tags": []
37-
},
38-
"outputs": [],
39-
"source": [
40-
"from PACKAGE import LOADER"
41-
]
42-
},
43-
{
44-
"cell_type": "markdown",
45-
"metadata": {},
46-
"source": [
47-
"## Basic Usage"
48-
]
49-
},
50-
{
51-
"cell_type": "markdown",
52-
"metadata": {},
53-
"source": [
54-
"### Load from table"
55-
]
56-
},
57-
{
58-
"cell_type": "code",
59-
"execution_count": 6,
60-
"metadata": {},
61-
"outputs": [],
62-
"source": [
63-
"loader = LOADER()\n",
64-
"\n",
65-
"data = loader.load()"
66-
]
67-
},
68-
{
69-
"cell_type": "markdown",
70-
"metadata": {},
71-
"source": [
72-
"### Load from query"
73-
]
74-
},
75-
{
76-
"cell_type": "code",
77-
"execution_count": null,
78-
"metadata": {},
79-
"outputs": [],
80-
"source": [
81-
"loader = LOADER()\n",
82-
"\n",
83-
"data = loader.load()"
84-
]
85-
},
86-
{
87-
"cell_type": "markdown",
88-
"metadata": {},
89-
"source": [
90-
"## Customize Document Page Content & Metadata"
91-
]
92-
},
93-
{
94-
"cell_type": "code",
95-
"execution_count": 8,
96-
"metadata": {},
97-
"outputs": [],
98-
"source": [
99-
"loader = LOADER(\n",
100-
"\n",
101-
")\n",
102-
"\n",
103-
"data = loader.load()"
104-
]
105-
},
106-
{
107-
"cell_type": "markdown",
108-
"metadata": {},
109-
"source": [
110-
"### Customize Page Content Format"
111-
]
112-
},
113-
{
114-
"cell_type": "markdown",
115-
"metadata": {},
116-
"source": [
117-
"## Save Documents to table"
118-
]
119-
},
120-
{
121-
"cell_type": "code",
122-
"execution_count": null,
123-
"metadata": {},
124-
"outputs": [],
125-
"source": [
126-
"saver = SAVER()\n",
127-
"saver.add_documents(docs)"
128-
]
129-
},
130-
{
131-
"cell_type": "markdown",
132-
"metadata": {},
133-
"source": [
134-
"## Customize Connection & Authentication"
135-
]
136-
},
137-
{
138-
"cell_type": "code",
139-
"execution_count": null,
140-
"metadata": {},
141-
"outputs": [],
142-
"source": [
143-
"from google.cloud.DATABASE import Client\n",
144-
"creds = \"\"\n",
145-
"client = Client(creds=creds)\n",
146-
"loader = LOADER(\n",
147-
" client=client,\n",
148-
")"
149-
]
150-
}
151-
],
152-
"metadata": {
153-
"kernelspec": {
154-
"display_name": "Python 3 (ipykernel)",
155-
"language": "python",
156-
"name": "python3"
157-
},
158-
"language_info": {
159-
"codemirror_mode": {
160-
"name": "ipython",
161-
"version": 3
162-
},
163-
"file_extension": ".py",
164-
"mimetype": "text/x-python",
165-
"name": "python",
166-
"nbconvert_exporter": "python",
167-
"pygments_lexer": "ipython3",
168-
"version": "3.10.6"
169-
}
170-
},
171-
"nbformat": 4,
172-
"nbformat_minor": 4
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# Google DATABASE\n",
8+
"\n",
9+
"[Google DATABASE](https://cloud.google.com/DATABASE).\n",
10+
"\n",
11+
"Load documents from `DATABASE`."
12+
]
13+
},
14+
{
15+
"cell_type": "markdown",
16+
"metadata": {},
17+
"source": [
18+
"## Pre-reqs"
19+
]
20+
},
21+
{
22+
"cell_type": "code",
23+
"execution_count": null,
24+
"metadata": {
25+
"tags": []
26+
},
27+
"outputs": [],
28+
"source": [
29+
"%pip install PACKAGE_NAME"
30+
]
31+
},
32+
{
33+
"cell_type": "code",
34+
"execution_count": 3,
35+
"metadata": {
36+
"tags": []
37+
},
38+
"outputs": [],
39+
"source": [
40+
"from PACKAGE import LOADER"
41+
]
42+
},
43+
{
44+
"cell_type": "markdown",
45+
"metadata": {},
46+
"source": [
47+
"## Basic Usage"
48+
]
49+
},
50+
{
51+
"cell_type": "markdown",
52+
"metadata": {},
53+
"source": [
54+
"### Load from table"
55+
]
56+
},
57+
{
58+
"cell_type": "code",
59+
"execution_count": 6,
60+
"metadata": {},
61+
"outputs": [],
62+
"source": [
63+
"loader = LOADER()\n",
64+
"\n",
65+
"data = loader.load()"
66+
]
67+
},
68+
{
69+
"cell_type": "markdown",
70+
"metadata": {},
71+
"source": [
72+
"### Load from query"
73+
]
74+
},
75+
{
76+
"cell_type": "code",
77+
"execution_count": null,
78+
"metadata": {},
79+
"outputs": [],
80+
"source": [
81+
"loader = LOADER()\n",
82+
"\n",
83+
"data = loader.load()"
84+
]
85+
},
86+
{
87+
"cell_type": "markdown",
88+
"metadata": {},
89+
"source": [
90+
"## Customize Document Page Content & Metadata"
91+
]
92+
},
93+
{
94+
"cell_type": "code",
95+
"execution_count": 8,
96+
"metadata": {},
97+
"outputs": [],
98+
"source": [
99+
"loader = LOADER()\n",
100+
"\n",
101+
"data = loader.load()"
102+
]
103+
},
104+
{
105+
"cell_type": "markdown",
106+
"metadata": {},
107+
"source": [
108+
"### Customize Page Content Format"
109+
]
110+
},
111+
{
112+
"cell_type": "markdown",
113+
"metadata": {},
114+
"source": [
115+
"## Save Documents to table"
116+
]
117+
},
118+
{
119+
"cell_type": "code",
120+
"execution_count": null,
121+
"metadata": {},
122+
"outputs": [],
123+
"source": [
124+
"saver = SAVER()\n",
125+
"saver.add_documents(docs)"
126+
]
127+
},
128+
{
129+
"cell_type": "markdown",
130+
"metadata": {},
131+
"source": [
132+
"## Customize Connection & Authentication"
133+
]
134+
},
135+
{
136+
"cell_type": "code",
137+
"execution_count": null,
138+
"metadata": {},
139+
"outputs": [],
140+
"source": [
141+
"from google.cloud.DATABASE import Client\n",
142+
"\n",
143+
"creds = \"\"\n",
144+
"client = Client(creds=creds)\n",
145+
"loader = LOADER(\n",
146+
" client=client,\n",
147+
")"
148+
]
149+
}
150+
],
151+
"metadata": {
152+
"kernelspec": {
153+
"display_name": "Python 3 (ipykernel)",
154+
"language": "python",
155+
"name": "python3"
156+
},
157+
"language_info": {
158+
"codemirror_mode": {
159+
"name": "ipython",
160+
"version": 3
161+
},
162+
"file_extension": ".py",
163+
"mimetype": "text/x-python",
164+
"name": "python",
165+
"nbconvert_exporter": "python",
166+
"pygments_lexer": "ipython3",
167+
"version": "3.10.6"
168+
}
169+
},
170+
"nbformat": 4,
171+
"nbformat_minor": 4
173172
}

src/tests/document_loader_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
instance = os.environ["INSTANCE_ID"]
2626
google_database = os.environ["GOOGLE_DATABASE"]
2727
pg_database = os.environ["PG_DATABASE"]
28-
table_name = os.environ["TABLE_NAME"].replace("-","_")
28+
table_name = os.environ["TABLE_NAME"].replace("-", "_")
2929

3030
OPERATION_TIMEOUT_SECONDS = 240
3131

@@ -34,6 +34,7 @@
3434
def client() -> Client:
3535
return Client(project=project_id)
3636

37+
3738
class TestSpannerDocumentLoaderGoogleSQL:
3839
@pytest.fixture(autouse=True, scope="class")
3940
def setup_database(self, client):
@@ -597,7 +598,6 @@ def setup_google_client(self, client) -> Client:
597598
operation.result(OPERATION_TIMEOUT_SECONDS)
598599
yield client
599600

600-
601601
@pytest.fixture(name="pg_client")
602602
def setup_pg_client(self, client) -> Client:
603603
database = client.instance(instance).database(pg_database)

0 commit comments

Comments
 (0)