MarjG commited on
Commit
ec67395
·
1 Parent(s): 86b347f

modif app.py

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. test.py +2 -2
app.py CHANGED
@@ -98,7 +98,7 @@ async def preview(rows: int = 10):
98
  """
99
  df = pd.read_csv("https://full-stack-assets.s3.eu-west-3.amazonaws.com/Deployment/get_around_pricing_project.csv", index_col=0)
100
  sample = df.sample(rows)
101
- return sample.to_json()
102
 
103
 
104
  @app.get("/unique-values", tags=["Preview"])
 
98
  """
99
  df = pd.read_csv("https://full-stack-assets.s3.eu-west-3.amazonaws.com/Deployment/get_around_pricing_project.csv", index_col=0)
100
  sample = df.sample(rows)
101
+ return sample.to_dict(orient="records")
102
 
103
 
104
  @app.get("/unique-values", tags=["Preview"])
test.py CHANGED
@@ -10,7 +10,7 @@ def test_preview():
10
  r = requests.get("https://marjg-getaround-api.hf.space/preview")
11
 
12
  response = r.json()
13
- print(pd.DataFrame(json.loads(response)))
14
 
15
  test_preview()
16
 
@@ -54,7 +54,7 @@ def test_filterBy():
54
 
55
  response = r.json()
56
  print(pd.DataFrame(response))
57
-
58
  test_filterBy()
59
 
60
 
 
10
  r = requests.get("https://marjg-getaround-api.hf.space/preview")
11
 
12
  response = r.json()
13
+ print(pd.DataFrame(response))
14
 
15
  test_preview()
16
 
 
54
 
55
  response = r.json()
56
  print(pd.DataFrame(response))
57
+
58
  test_filterBy()
59
 
60