From 53148f0c607c0f298bd1d0e6064f9cffebc1a33d Mon Sep 17 00:00:00 2001 From: Keshav Maheshwari Date: Fri, 18 Jun 2021 01:31:23 -0400 Subject: [PATCH 1/4] bumped up numpy pandas etc version --- requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index 613dd6e..8451435 100644 --- a/requirements.txt +++ b/requirements.txt @@ -23,8 +23,8 @@ MarkupSafe==1.1.1 mccabe==0.6.1 mongoengine==0.18.2 more-itertools==7.2.0 -numpy==1.17.4 -pandas==0.25.3 +numpy==1.20.3 +pandas==1.2.4 pylint==2.4.2 pymongo==3.9.0 pyrsistent==0.15.4 @@ -34,7 +34,7 @@ PyYAML==5.2 s3transfer==0.2.1 six==1.12.0 sendgrid==6.4.4 -typed-ast==1.4.0 +typed-ast==1.4.3 urllib3==1.25.7 Werkzeug==0.16.0 wrapt==1.11.2 From 6c58ea31fa4cab215ee218643864d7b64817672c Mon Sep 17 00:00:00 2001 From: Keshav Maheshwari Date: Fri, 18 Jun 2021 01:32:00 -0400 Subject: [PATCH 2/4] error grammar fix --- Controllers/AgriWatchViewController.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Controllers/AgriWatchViewController.py b/Controllers/AgriWatchViewController.py index ff816f9..67aa611 100644 --- a/Controllers/AgriWatchViewController.py +++ b/Controllers/AgriWatchViewController.py @@ -31,7 +31,7 @@ def post(self): class FetchViews(Resource): @view_ns.doc( responses = { - 400: "Fetch AgriWatch views error." + 400: "Error fetching AgriWatch views." }, params = { 'SID': {'in': 'cookies', 'required': True}, From a95bdbf9b9f90e2c7c5efbfb91ac6323f237cf2f Mon Sep 17 00:00:00 2001 From: Keshav Maheshwari Date: Fri, 18 Jun 2021 01:32:28 -0400 Subject: [PATCH 3/4] fixed logout error language --- Controllers/AuthenticationController.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Controllers/AuthenticationController.py b/Controllers/AuthenticationController.py index 5a319bb..015e4b1 100644 --- a/Controllers/AuthenticationController.py +++ b/Controllers/AuthenticationController.py @@ -103,7 +103,7 @@ def post(self): AuthenticationService.logout(sessionId) return Response("Successfully logged out.", status=200) except: - return Response("Unable to process request. Please reload and try again later.", status=400) + return Response("Unable to logout. Please reload and try again later.", status=400) @auth_ns.route("/signup") class Signup(Resource): From 1144fcff7ea121aa13470a8e0e3c7fc30cf6e8e3 Mon Sep 17 00:00:00 2001 From: Keshav Maheshwari Date: Fri, 18 Jun 2021 01:33:27 -0400 Subject: [PATCH 4/4] changed error messages to be more specific and appropriate --- Controllers/DatasetController.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Controllers/DatasetController.py b/Controllers/DatasetController.py index 5292364..d600db4 100644 --- a/Controllers/DatasetController.py +++ b/Controllers/DatasetController.py @@ -191,7 +191,7 @@ def delete(self, datasetId): class Search(Resource): @dataset_ns.doc( responses={ - 400: "Error processing request. Please try again later.", + 400: "Error processing search request. Please try again later.", 400: "Unable to retrieve datasets with the given search parameter.", }, params={ @@ -228,7 +228,7 @@ def get(self, searchQuery): typeUser = False else: # invalid referrer url - return Response("Error processing request. Please try again later.", status=400) + return Response("Error processing search request. Please try again later.", status=400) for dataset in matchedDatasets: datasets.append(DatasetService.createDatasetInfoObject(dataset)) @@ -244,7 +244,7 @@ def get(self, searchQuery): class GetUsersDatasets(Resource): @dataset_ns.doc( responses={ - 400: "No datasets found", + 400: "No user datasets found", }, params={ 'SID': {'in': 'cookies', 'required': True}, @@ -257,7 +257,7 @@ def get(self): datasets = Dataset.objects.filter(author=user).order_by('-dateCreated') for dataset in datasets: if dataset == None: - return Response("No datasets found", status=400) + return Response("No user datasets found", status=400) retList.append(DatasetService.createDatasetInfoObject(dataset)) return Response(retList) @@ -265,7 +265,7 @@ def get(self): class Popular(Resource): @dataset_ns.doc( responses={ - 400: "No datasets found", + 400: "No popular datasets found", 400: "Couldn't retrieve popular datasets" }, params={ @@ -280,7 +280,7 @@ def get(self): datasets = Dataset.objects.filter(Q(author=user) | Q(public=True)).order_by("-views")[:5] for dataset in datasets: if dataset == None: - return Response("No datasets found", status=400) + return Response("No popular datasets found", status=400) retList.append(DatasetService.createDatasetInfoObject(dataset)) return Response(retList) except: @@ -319,8 +319,8 @@ def get(self): class New(Resource): @dataset_ns.doc( responses={ - 400: "Couldn't retrieve recent datasets", - 404: "No datasets found" + 400: "Couldn't retrieve new datasets", + 404: "No new datasets found" }, params={ 'SID': {'in': 'cookies', 'required': True}, @@ -335,12 +335,12 @@ def get(self): newDatasets = Dataset.objects(author=user).order_by("-dateCreated")[:5] for dataset in newDatasets: if dataset == None: - return Response("No datasets found", status=404) + return Response("No new datasets found", status=404) retList.append(DatasetService.createDatasetInfoObject(dataset)) return Response(retList) except Exception as e: print(e) - return Response("Couldn't retrieve recent datasets", status=400) + return Response("Couldn't retrieve new datasets", status=400) @dataset_ns.route("/changeLabel/") class ChangeLabel(Resource):