Skip to content

Commit 9f83408

Browse files
committed
revert accidental changes
1 parent b18d63d commit 9f83408

File tree

4 files changed

+8
-1000
lines changed

4 files changed

+8
-1000
lines changed

examples/bulk-ingest/bulk-ingest.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@
66
"""Script that downloads a public dataset and streams it to an Elasticsearch cluster"""
77

88
import csv
9-
from os.path import abspath, dirname, exists, join
10-
9+
from os.path import abspath, join, dirname, exists
1110
import tqdm
1211
import urllib3
13-
1412
from elasticsearch import Elasticsearch
1513
from elasticsearch.helpers import streaming_bulk
1614

15+
1716
NYC_RESTAURANTS = (
1817
"https://data.cityofnewyork.us/api/views/43nn-pn8j/rows.csv?accessType=DOWNLOAD"
1918
)
@@ -100,9 +99,7 @@ def main():
10099
progress = tqdm.tqdm(unit="docs", total=number_of_docs)
101100
successes = 0
102101
for ok, action in streaming_bulk(
103-
client=client,
104-
index="nyc-restaurants",
105-
actions=generate_actions(),
102+
client=client, index="nyc-restaurants", actions=generate_actions(),
106103
):
107104
progress.update(1)
108105
successes += ok

examples/fastapi-apm/app.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
33
# See the LICENSE file in the project root for more information
44

5+
import aiohttp
56
import datetime
67
import os
7-
8-
import aiohttp
9-
from elasticapm.contrib.starlette import ElasticAPM, make_apm_client
108
from fastapi import FastAPI
119
from fastapi.encoders import jsonable_encoder
12-
1310
from elasticsearch import AsyncElasticsearch, NotFoundError
1411
from elasticsearch.helpers import async_streaming_bulk
12+
from elasticapm.contrib.starlette import ElasticAPM, make_apm_client
13+
1514

1615
apm = make_apm_client(
1716
{"SERVICE_NAME": "fastapi-app", "SERVER_URL": "http://apm-server:8200"}
@@ -61,9 +60,7 @@ async def search(query):
6160

6261
@app.get("/delete")
6362
async def delete():
64-
return await client.delete_by_query(
65-
index="games", body={"query": {"match_all": {}}}
66-
)
63+
return await client.delete_by_query(index="games", body={"query": {"match_all": {}}})
6764

6865

6966
@app.get("/delete/{id}")

examples/fastapi-apm/ping.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
# See the LICENSE file in the project root for more information
44

55
import random
6+
import urllib3
67
import time
78

8-
import urllib3
99

1010
endpoints = [
1111
"http://app:9292/",

0 commit comments

Comments
 (0)